Preventing users updating quantity on checkout.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 4 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: 13 years 4 months ago by nicolas.

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

Time to create page: 0.051 seconds
Powered by Kunena Forum