Answer the question
In order to leave comments, you need to log in
How to add your own price in woocommerce (the second one, the discount option is not suitable) for a product?
There is a showcase of goods, you need to implement a checkbox when you click which the price changes (ajax) and if the checkbox is checked, then this price (changed) flies into the cart (ajax "Buy" button). How to add a second price for a product so that it can be changed in the admin panel and when the checkbox is checked, it is it that flies into the basket? Tell me good people where to dig :)
Answer the question
In order to leave comments, you need to log in
Here in this plugin this mechanism is made https://docs.woocommerce.com/document/product-add-ons/
You can buy and install it.
You can unscramble it.
You can plug in the ACF plugin and make a field like "Special price with a checkmark" through it, then find the hook that is responsible for adding the product to the cart, change the price and note to the product there. Type "Product A, with a tick pressed" - the price is 99 rubles. Despite the fact that the main price of the product is 77.
I won’t tell you the exact code. You have to read the source. I just know it's technically real :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question