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

#   Set quantity default value to 0

##

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

Less More

- Posts: 71
- Thank you received: 3
-
-

11 years 5 months ago [\#203151](#203151) by [marremp2](/forum/user/35420-marremp2 "View marremp2's Profile")  *[Set quantity default value to 0](/forum/32-content-creation/877222-set-quantity-default-value-to-0#203151 "-- HikaShop version -- : 2.4.0  Hello,  I try to set the default quantity value to 0. I found this thread :   www.hikashop.com/forum/content-creation/...product-display.html  I changed the default value in the database, but the value which appears in the product add form (front-end and back-end) is still unlimited.  Should I also modify a view or something ?  Thank you")* was created by *[marremp2](/forum/user/35420-marremp2 "View marremp2's Profile")*

-- HikaShop version -- : 2.4.0

Hello,

I try to set the default quantity value to 0.
I found this thread :
[ www.hikashop.com/forum/content-creation/...product-display.html](http://www.hikashop.com/forum/content-creation/872244-variants-set-default-value-and-product-display.html)

I changed the default value in the database, but the value which appears in the product add form (front-end and back-end) is still unlimited.

Should I also modify a view or something ?

Thank you

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 5 months ago [\#203161](#203161) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Set quantity default value to 0](/forum/32-content-creation/877222-set-quantity-default-value-to-0#203161 "-- HikaShop version -- : 2.4.0  Hello,  I try to set the default quantity value to 0. I found this thread :   www.hikashop.com/forum/content-creation/...product-display.html  I changed the default value in the database, but the value which appears in the product add form (front-end and back-end) is still unlimited.  Should I also modify a view or something ?  Thank you")*

Hi,

Can you please provide more details about what you want to achieve (and where ; because I see that you have HikaMarket) ?
The modification of the "product quantity" in the database is one thing but it won't change the default quantity value for new products... And depending what you want to do, the process will be slightly different.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 71
- Thank you received: 3
-
-

11 years 5 months ago [\#203205](#203205) by [marremp2](/forum/user/35420-marremp2 "View marremp2's Profile")  Replied by *[marremp2](/forum/user/35420-marremp2 "View marremp2's Profile")* on topic *[Set quantity default value to 0](/forum/32-content-creation/877222-set-quantity-default-value-to-0#203205 "-- HikaShop version -- : 2.4.0  Hello,  I try to set the default quantity value to 0. I found this thread :   www.hikashop.com/forum/content-creation/...product-display.html  I changed the default value in the database, but the value which appears in the product add form (front-end and back-end) is still unlimited.  Should I also modify a view or something ?  Thank you")*

Hello Jerome,

Yes you're right, maybe you will have a better option for my problem ![;)](/media/kunena/emoticons/24.png ";)")

We are putting in place a second-hand selling system through Hikamarket.

I would like to propose to vendors two possibilities :
1. They sell through the marketplace, customer can buy their product through Hikamarket payment and delivery system (like priceminister)
2. They only publish classifieds, customer contact them directly to set the final price and produc pick-up or delivery (like le bon coin)

My idea was to use the quantity field to differentiate the two processes, at product creation.
1. Vendor defines a quantity &gt; 0 (most of the time 1), the product is then purchasable, the button "add to cart" appears
2. Vendor lets the quantity to 0, the product is not purchasable, the button "add to cart" does not appear. A message "classifieds" appear (thanks to css) on products list next to these products.

In order to avoid too much errors, I wanted thus to put 0 quantity by default in the product add form in front-end.

The ideal solution would be I guess to propose a custom field "Type of sale" at product creation with the two values Classifieds / Secured sale and to make the product not purchasable (no add to card button) if Classified is selected, whatever the quantity is. But I don't konw how to do this.

Many thanks for your help.

Marina

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 5 months ago [\#203207](#203207) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Set quantity default value to 0](/forum/32-content-creation/877222-set-quantity-default-value-to-0#203207 "-- HikaShop version -- : 2.4.0  Hello,  I try to set the default quantity value to 0. I found this thread :   www.hikashop.com/forum/content-creation/...product-display.html  I changed the default value in the database, but the value which appears in the product add form (front-end and back-end) is still unlimited.  Should I also modify a view or something ?  Thank you")*

Hi,

What can potentially be done is to create a custom product field as a single dropdown with the to desired values.
Then set up a mass action with a trigger set on "onBeforeProductCreate", a filter based on the created custom field, and depending on the custom field value, set the quantity to "0".

Here is the documentation related on the custom fields:
[ www.hikashop.com/support/documentation/4...shop-field-form.html](http://www.hikashop.com/support/documentation/42-hikashop-field-form.html)

And there about the mass actions:
[ www.hikashop.com/support/documentation/167-massaction-form.html](http://www.hikashop.com/support/documentation/167-massaction-form.html)

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

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

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

Less More

- Posts: 71
- Thank you received: 3
-
-

11 years 5 months ago [\#203304](#203304) by [marremp2](/forum/user/35420-marremp2 "View marremp2's Profile")  Replied by *[marremp2](/forum/user/35420-marremp2 "View marremp2's Profile")* on topic *[Set quantity default value to 0](/forum/32-content-creation/877222-set-quantity-default-value-to-0#203304 "-- HikaShop version -- : 2.4.0  Hello,  I try to set the default quantity value to 0. I found this thread :   www.hikashop.com/forum/content-creation/...product-display.html  I changed the default value in the database, but the value which appears in the product add form (front-end and back-end) is still unlimited.  Should I also modify a view or something ?  Thank you")*

That's brilliant !

Thank you Xavier it works perfectly !!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc3MjIyLXNldC1xdWFudGl0eS1kZWZhdWx0LXZhbHVlLXRvLTA/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.062 seconds

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