Hello guys,
I would like to ask for little help... I have some product with radio options and I would like when the customer choose the radio option, set the quantity in the input field and finally click on add to cart button, the input field to be nulled (refreshed) to 1 as default. On this way the user will be able to select another radio option and set new quantity. At the moment, the user is able to add in cart 5 items from Option 1 but if they wanna add several items from Option 2, I would like after they select and add to cart 5 from Option one, the input field to be refreshed to 1 again. And for each option... Is there a way? If I have not explained good, let's ask in short... Product A is with 5 options. The user select Option 1, make the quantity and after Add to cart button is clicked, I need the input quantity filed to be refreshed with 1 again as default. Thank you.
Hi
If I understand you correctly, please edit this file:
catalog\view\theme\{your-theme}\template\product\product.twig
Find:
Add before it:
$('#input-quantity').val(1);
And clear the theme cache if it is enabled, you may need to refresh the modifications too.
If I understand you correctly, please edit this file:
catalog\view\theme\{your-theme}\template\product\product.twig
Find:
Code: Select all
$('#cart > button')
$('#input-quantity').val(1);
And clear the theme cache if it is enabled, you may need to refresh the modifications too.
Many thanks for your fast response but unfortunately I do not have such a line but this one:
And several lines below, I have this block:
Code: Select all
<input type="button" value="<?php echo $button_cart; ?>" id="button-cart" rel="<?php echo $product_id; ?>" data-loading-text="<?php echo $text_loading; ?>" class="button" />
Code: Select all
$('#cart_block #cart_content').load('index.php?route=common/cart/info #cart_content_ajax');
$('#cart_block #total_price_ajax').load('index.php?route=common/cart/info #total_price');
$('#cart_block #total_item_ajax').load('index.php?route=common/cart/info #total_item');
Hi
You are using a custom theme, add it before:
$('#cart_block #cart_content').load
if it does not work, please share a link to your product page.
You are using a custom theme, add it before:
$('#cart_block #cart_content').load
if it does not work, please share a link to your product page.
It doesn't work... I use this theme and my settings are the same as here... Thank you for taking a look:
http://ninethemes.net/epro/opencart/2/i ... duct_id=31
http://ninethemes.net/epro/opencart/2/i ... duct_id=31
I do not see the new code in your page source, please clear the theme cache and refresh the modifications.
Oh, sorry, I showed you the template but not my page... here you can see my product page with your code inside... I cleared the cache...
https://divage.steliyan.com/index.php?r ... duct_id=75
https://divage.steliyan.com/index.php?r ... duct_id=75
I have Same problem. im using Claue - The Clean & Minimalist OpenCart Theme but i cant fixed. can you help me pls
Who is online
Users browsing this forum: mattltm, Semrush [Bot] and 332 guests