[Skip to main content](#vessel-content)

#   Preventing users updating quantity on checkout.

##

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 3 months ago -  15 years 3 months ago [\#22736](#22736) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  *[Preventing users updating quantity on checkout.](/forum/3-bug-report/22736-preventing-users-updating-quantity-on-checkout#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:  nput style=&quot;display:none;&quot; id=&quot;hikashop&#95;checkout&#95;quantity&#95;cart&#95;product&#95;id;?&gt;&quot; type=&quot;text&quot; name=&quot;item&#91;cart&#95;product&#95;id;?&gt;&#93;&quot; class=&quot;hikashop&#95;product&#95;quantity&#95;field&quot; value=&quot;cart&#95;product&#95;quantity; ?&gt;&quot; /&gt; 'cart&#95;product&#95;quantity; ?&gt;   If I left the  tag out or set type to hidden I got a Javascript null pointer error. Using an inline style fixed the problem.")* was created by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")*

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:
&lt;?php if ($noupdate) {?&gt;
&lt;input style="display:none;" id="hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;" type="text" name="item[&lt;?php echo $row-&gt;cart_product_id;?&gt;]" class="hikashop_product_quantity_field" value="&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;" /&gt;
&lt;span class="hikashop_product_quantity_value"&gt;'&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;&lt;/span&gt;
&lt;?php } else { ... as normal ... } ?&gt;

If I left the *&lt;input&gt;* 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 3 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMjczNi1wcmV2ZW50aW5nLXVzZXJzLXVwZGF0aW5nLXF1YW50aXR5LW9uLWNoZWNrb3V0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.038 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
