Skip to main content

Preventing users updating quantity on checkout.

More
15 years 1 month ago - 15 years 1 month ago #22736 by brainforge
I had a requirement, for selected products, to prevent users updating the quantity field in the checkout.
The solution I used in my template cart.php as this:
<?php if ($noupdate) {?>
<input style="display:none;" id="hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>" type="text" name="item[<?php echo $row->cart_product_id;?>]" class="hikashop_product_quantity_field" value="<?php echo $row->cart_product_quantity; ?>" />
<span class="hikashop_product_quantity_value">'<?php echo $row->cart_product_quantity; ?></span>
<?php } else { ... as normal ... } ?>

If I left the <input> tag out or set type to hidden I got a Javascript null pointer error.
Using an inline style fixed the problem.
Last edit: 15 years 1 month ago by nicolas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.176 seconds
Powered by Kunena Forum