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

#   Update product\_quantity with -1 turns out unlimited

##

- **[haur0214](/forum/user/39931-haur0214 "View haur0214's Profile")**
- [![haur0214's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39931-haur0214 "View haur0214's Profile") Topic Author
- [ Offline](/forum/user/39931-haur0214)

Less More

- Posts: 29
- Thank you received: 1
-
-

9 years 10 months ago [\#258419](#258419) by [haur0214](/forum/user/39931-haur0214 "View haur0214's Profile")  *[Update product\_quantity with -1 turns out unlimited](/forum/37-import-export-csv-xls/888083-update-product-quantity-with-1-turns-out-unlimited#258419 "-- HikaShop version -- : 2.6.4  Dear support,  We encounter that when we import csv file to update product&#95;quantity (with 'Update the product quantity instead of replacing it' turns on), product quantity become unlimited instead of deduct 1 from current product quantity.  Is this a bug or we have another solution to have this problem solve?  Thank you :)")* was created by *[haur0214](/forum/user/39931-haur0214 "View haur0214's Profile")*

-- HikaShop version -- : 2.6.4

Dear support,

We encounter that when we import csv file to update product_quantity
(with 'Update the product quantity instead of replacing it' turns on),
product quantity become unlimited instead of deduct 1 from current product quantity.

Is this a bug or we have another solution to have this problem solve?

Thank you ![:)](/media/kunena/emoticons/3.png ":)")

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14293
-
-

9 years 10 months ago [\#258446](#258446) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Update product\_quantity with -1 turns out unlimited](/forum/37-import-export-csv-xls/888083-update-product-quantity-with-1-turns-out-unlimited#258446 "-- HikaShop version -- : 2.6.4  Dear support,  We encounter that when we import csv file to update product&#95;quantity (with 'Update the product quantity instead of replacing it' turns on), product quantity become unlimited instead of deduct 1 from current product quantity.  Is this a bug or we have another solution to have this problem solve?  Thank you :)")*

Hi,

Mmm well it's not really a bug. This allows to you update the quantity to unlimited as -1 means unlimited in HikaShop.
The problem is that you can't decrease the quantity with the 'Update the product quantity instead of replacing it' option turned on.
If you want to change that, you can replace the line:
if(JRequest::getInt('update_product_quantity','0') &amp;&amp; $field=='product_quantity' &amp;&amp; $product-&gt;product_quantity != -1){
to:
if(JRequest::getInt('update_product_quantity','0') &amp;&amp; $field=='product_quantity'){
in the file administrator/components/com_hikashop/helpers/import.php

The following user(s) said Thank You: [haur0214](/forum/user/39931-haur0214 "View haur0214's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ltcG9ydC1leHBvcnQtY3N2LXhscy84ODgwODMtdXBkYXRlLXByb2R1Y3QtcXVhbnRpdHktd2l0aC0xLXR1cm5zLW91dC11bmxpbWl0ZWQ/dG1wbD1tYXJrZG93bg==) 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.048 seconds

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