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

#   Product Quantity = 1 by default

##

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

Less More

- Posts: 30
- Thank you received: 0
-
-

6 years 7 months ago [\#317697](#317697) by [radek](/forum/user/59272-radek "View radek's Profile")  *[Product Quantity = 1 by default](/forum/23-market-how-to/899599-product-quantity-1-by-default#317697 "-- HikaShop version -- : 4.2.3 -- HikaMarket version -- : 3.0.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.3.1 -- Browser(s) name and version -- : Firefox  Hi,  How to set product quantity = &quot;1&quot; to be default quantity when the vendor adds a new product? Now is &quot;Unlimited&quot; see, the screenshot attached, please.  Regards, Radek")* was created by *[radek](/forum/user/59272-radek "View radek's Profile")*

-- HikaShop version -- : 4.2.3
-- HikaMarket version -- : 3.0.3
-- Joomla version -- : 3.9.16
-- PHP version -- : 7.3.1
-- Browser(s) name and version -- : Firefox

Hi,

How to set product quantity = "1" to be default quantity when the vendor adds a new product?
Now is "Unlimited"
see, the screenshot attached, please.

Regards,
Radek

- [ ![Screenshot&#95;2020-04-19MyMarketplace.jpg](/forum/attachment/49121) ](/forum/attachment/49121 "...arketplace.jpg") [ ](/forum/attachment/49121?download=1 "...arketplace.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk5NTk5LXByb2R1Y3QtcXVhbnRpdHktMS1ieS1kZWZhdWx0P3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

6 years 7 months ago [\#317698](#317698) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Product Quantity = 1 by default](/forum/23-market-how-to/899599-product-quantity-1-by-default#317698 "-- HikaShop version -- : 4.2.3 -- HikaMarket version -- : 3.0.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.3.1 -- Browser(s) name and version -- : Firefox  Hi,  How to set product quantity = &quot;1&quot; to be default quantity when the vendor adds a new product? Now is &quot;Unlimited&quot; see, the screenshot attached, please.  Regards, Radek")*

Hello,

You need to create a "product template" and configure it as the default product template for your vendors.
[ www.hikashop.com/support/documentation/1...tml#config\_main\_main](https://www.hikashop.com/support/documentation/143-hikamarket-configuration.html#config_main_main)

Each time a vendor will create a new product, that default template will be load and will define the default values for the product.
The product template can also set the values for fields that the vendor do not have access to.

Regards,

---

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

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

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

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

Less More

- Posts: 30
- Thank you received: 0
-
-

6 years 7 months ago [\#317775](#317775) by [radek](/forum/user/59272-radek "View radek's Profile")  Replied by *[radek](/forum/user/59272-radek "View radek's Profile")* on topic *[Product Quantity = 1 by default](/forum/23-market-how-to/899599-product-quantity-1-by-default#317775 "-- HikaShop version -- : 4.2.3 -- HikaMarket version -- : 3.0.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.3.1 -- Browser(s) name and version -- : Firefox  Hi,  How to set product quantity = &quot;1&quot; to be default quantity when the vendor adds a new product? Now is &quot;Unlimited&quot; see, the screenshot attached, please.  Regards, Radek")*

Hi Jerome,

Is it possible to have 2 product templates depending on the category where the product is to be published?
For example:
1st url link for vendor: "sell TV" - redirects the vendor to the 1st template (to create new product: tv)
2nd url link for vendor: "sell Tomatos" - redirects the vendor to the 2st template (to create new product: tomatos)

Regards,
Radek

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk5NTk5LXByb2R1Y3QtcXVhbnRpdHktMS1ieS1kZWZhdWx0P3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

6 years 7 months ago [\#317778](#317778) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Product Quantity = 1 by default](/forum/23-market-how-to/899599-product-quantity-1-by-default#317778 "-- HikaShop version -- : 4.2.3 -- HikaMarket version -- : 3.0.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.3.1 -- Browser(s) name and version -- : Firefox  Hi,  How to set product quantity = &quot;1&quot; to be default quantity when the vendor adds a new product? Now is &quot;Unlimited&quot; see, the screenshot attached, please.  Regards, Radek")*

Hello,

You can have only one product template for a vendor.
One possible solution is to propose several template to a vendor when he want to create a new product ; that selection of the template should be manual.

It is not possible to know in advance what will be the category (or categories) of a product before it is saved. So when a vendor (or even you) click on the "new" button, we could presume of a possible category but it is not sure.

You can still add some override or develop a custom plugin in order to change that behavior and modify dynamically the default value for the product quantity.
There is a trigger to interact with the product template but that trigger is only when a new product is submitted. So in your case it won't feet to your needs.

Regards,

---

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

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

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

Less More

- Posts: 30
- Thank you received: 0
-
-

6 years 6 months ago [\#318364](#318364) by [radek](/forum/user/59272-radek "View radek's Profile")  Replied by *[radek](/forum/user/59272-radek "View radek's Profile")* on topic *[Product Quantity = 1 by default](/forum/23-market-how-to/899599-product-quantity-1-by-default#318364 "-- HikaShop version -- : 4.2.3 -- HikaMarket version -- : 3.0.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.3.1 -- Browser(s) name and version -- : Firefox  Hi,  How to set product quantity = &quot;1&quot; to be default quantity when the vendor adds a new product? Now is &quot;Unlimited&quot; see, the screenshot attached, please.  Regards, Radek")*

Hi Jerome,
You wrote: "One possible solution is to propose several template to a vendor when he want to create a new product ; that selection of the template should be manual." - what does it mean? How (manually) can he/she select the template?

or in another way:

How can I open "add new product 1 " with 1st template using specified url? And open "add new product 2" with 2nd template with another url? Is it possible?
(you mentioned some trigger)

Regards,
Radek

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk5NTk5LXByb2R1Y3QtcXVhbnRpdHktMS1ieS1kZWZhdWx0P3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

6 years 6 months ago [\#318371](#318371) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Product Quantity = 1 by default](/forum/23-market-how-to/899599-product-quantity-1-by-default#318371 "-- HikaShop version -- : 4.2.3 -- HikaMarket version -- : 3.0.3 -- Joomla version -- : 3.9.16 -- PHP version -- : 7.3.1 -- Browser(s) name and version -- : Firefox  Hi,  How to set product quantity = &quot;1&quot; to be default quantity when the vendor adds a new product? Now is &quot;Unlimited&quot; see, the screenshot attached, please.  Regards, Radek")*

Hello,

I was talking about a possible evolution in the future.
Something which is not possible for the moment since I wrote :

> You can have only one product template for a vendor.

Which is the current state of the product templates.

I mentioned a trigger yes but I also added :

> There is a trigger to interact with the product template but that trigger is only when a new product is submitted. So in your case **it won't feet to your needs**.

If you just want to change the default product quantity, the best is to use a view override of the "productmarket / form" view.
Thanks to Code:

if(empty($this-&gt;product-&gt;product_id)) { }

You can know that you're editing a new product and you can change the value of the product_quantity depending your own condition and algorithm.

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk5NTk5LXByb2R1Y3QtcXVhbnRpdHktMS1ieS1kZWZhdWx0P3RtcGw9bWFya2Rvd24=) 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?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.087 seconds

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