• Resolved amc11

    (@amc11)


    Hi,

    Im having some problem saving a new price for a product adding to the cart.
    I would like to change the price across all pages of woocommerce, so the price of the product remains. Its not neccessary to change the price in db. But if this must be done thats the way we need to do.

    Ive added a form to the single productpage that reloads the page.
    Then I try to get the new price and change it. But somehow using $_POST is not allowed? I guess its for security reasons. Is the anyway to get around this?

    We use one product that a store clark should be able to change without going through the WP admin in products to change the price.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @amc11,

    By default, each product in WooCommerce has a price which is added from the products edit screen from within the field named Regular Price. You can read more about how to add prices to WooCommerce products within this documentation below as only these prices will be the ones displayed in a site cart.

    https://docs.woocommerce.com/document/managing-products/#section-6

    You could assign your clerks the user role of Shop Manager which would allow them to login and alter the price on your product.

    https://docs.woocommerce.com/document/roles-capabilities/#section-2

    I hope this helps.

    Thread Starter amc11

    (@amc11)

    Hi Stuart,

    Thanks!

    But, I think you missunderstand me.

    I would like to keep the shop clerks outside the WP Admin.

    So, in order for them to shop for a customer that calls in. They need
    to add products to the cart. BUT here is the tricky part. There is only one product they should be able to add to the cart, and also they need to change the amount of the product. So, to make it easier for them, we would like to point them to a custom single product page, in the frontend. And on this page a field to change the price. In one or the other way, directly to the db, or just within the session. Ive tried a few ways, but without much success. Save to db works, but not when using $_GET och $_POST for price before updating the db.

    Is this possible?

    Thanks!

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @amc11,

    There is only one product they should be able to add to the cart, and also they need to change the amount of the product.

    For what you describe would require some kind of customer user authentication to be developed so what you refer to as a clerk could change a price via the front end. Otherwise, any visitor to your site could add products to your sites cart and change the price.

    An extension called Name Your Price would allow you to set a custom price from the product page.

    To restrict access to that product you could use a plugin called WooCommerce Memberships creating a membership plan which only your clerks have access to when logged in.

    This would allow your clerks to login to WooCommerce (Not the admin dashboard ), access the product and set a price before adding the product to cart.

    I hope this helps and offers a possible solution for you!

    Moderator Hari Shanker R

    (@harishanker)

    Hi @amc11

    Just checking-in on this for you to see if you were able to get to the bottom of this. I hope that the suggestions from @stuartduff guided you in the right direction.

    Since we haven’t heard from you in a while, I’m going to mark this topic as Resolved. Let us know if you keep running into troubles. You can either reply here to follow-up with the same problem, or create a new thread to report your troubles to us.

    All the best!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change product price on single product page’ is closed to new replies.