I found the ability to add to the cart through URL:
http://yoururl.com/cart/?add-to-cart=ID
I also found how to add quantity and attributes using this link, but can’t find a way to add a price.
How to use this link to add a price to the cart?
I found the ability to add to the cart through URL:
http://yoururl.com/cart/?add-to-cart=ID
I also found how to add quantity and attributes using this link, but can’t find a way to add a price.
How to use this link to add a price to the cart?
2
Answers
If it is a simple product, the price is the one declared.
If it is a variable product, you can use the variation id.
You can find more info about that, here. https://businessbloomer.com/woocommerce-custom-add-cart-urls-ultimate-guide/
If is not working, please provide what code are you trying to use and more info about your issue.
If you want to add the product to cart with a custom price, you can’t via URL.
You need to do it via PHP (if you are currently using JS, you will need to use an AJAX function like jQuery $.post and call a PHP function).
In the PHP function you add the product:
You will also need to modify the price in the cart