Product Quantity = 1 by default

  • Posts: 30
  • Thank you received: 0
4 years 6 days ago #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 = "1" to be default quantity when the vendor adds a new product?
Now is "Unlimited"
see, the screenshot attached, please.

Regards,
Radek

Attachments:

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
4 years 5 days ago #317698

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

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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: radek

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

  • Posts: 30
  • Thank you received: 0
4 years 5 days ago #317775

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 or Create an account to join the conversation.

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
4 years 4 days ago #317778

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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 30
  • Thank you received: 0
3 years 11 months ago #318364

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 or Create an account to join the conversation.

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
3 years 11 months ago #318371

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
if(empty($this->product->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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Moderators: Obsidev
Time to create page: 0.068 seconds
Powered by Kunena Forum