I am building custom WooCommerce Add to Cart buttons and I'm encountering the following problem.
The URL for the buttons are as simple as: https://mywebsite.com/shop/?add-to-cart=131&quantity=6
131 is the product ID which is dynamically pulled from the product page. However, I also want to make the quantity input dynamic. On the page I inserted a simple HTML number input field with the ID: QTY.
What I want is that when the Add to Car button is clicked, the input from the number input field is added to the URL and then of course adds the right amount of products in the cart.
Thanks in advance!
Related
I am currently working on a ecommerce site. The word press theme I'm using is Astra. I have a form which calculate the prices for certain products. I want the add to cart button to get the final price from the form. How can I do that? Please help.
I'm trying to add a second button to a product page with a updated price.
For example I'm using [add_to_cart id='$product->id'] which displays correctly, but I would like to assign this short code a custom price.
The results should show two buttons on a single product page. One with the regular price value and the other with the custom price value.
I tried doing this through variables, but need them in two buttons instead of a drop down.
Thanks for the help!
I have a single product with variables but I need it to show on a user profile page. I can easily put a sidebar in with best products or popular products but that means it needs another click to get to the product page. So I need the product displayed on a certain page with all the variables showing and add to cart also showing.
I've added custom products fields with this tutorial http://www.remicorson.com/mastering-woocommerce-products-custom-fields/
Now i need to show them in the products loop like shown in the image below
The left part are table headings with the custom field names, on the rigs side are products with up to 4 products on one page (the client doesn't want more).
I'm stuck on the product loop display here, got the procuct variations to show on category page with the ability to add to cart, but can't wrap my head around this task so any advice how to show this would be appreciated
I'm trying to make this work but i cannot solve it. In the single product page i have placed the product details in a tab, but the quantity box is no longer working. I also tried it with a text field, but it constantly adds just one product. Can anybody help me with this?
It seems that the submit button is not taking the amount into account...
Add to cart
Where data-quantity is not updating...