Preventing users updating quantity on checkout.

  • Posts: 291
  • Thank you received: 4
  • Hikashop Business
12 years 7 months ago #22736

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: 12 years 7 months ago by nicolas.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum