Skip to main content

Default quantity

More
11 years 1 week ago #213955 by pbleiman
Default quantity was created by pbleiman
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5.27
-- Browser(s) name and version -- : Safari 8.0.7 (OS X)

Is it possible to set a default quantity in the "add to cart" field on the product page ? We have products which we like to sell per 6 by default. It must be possible to order less than 6 units, but we'd like to stimulate the customers to order by 6 (or another multiple). Therefore, in the add to cart box by default the quantity should be set to 6 instead of 1.

I found a thread to set the minimum value to 0 and also manage to set this to 6 (either through minimum order quantity or by modifying the PHP directly), but in that case I cannot input a lower value anymore.

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

More
11 years 1 week ago #213990 by nicolas
Replied by nicolas on topic Default quantity
Hi,

There is no option to change that.
You can edit the file "show_quantity" of the view "product" via the menu Display>Views and change the occurrences of :
Code:
value="<?php echo JRequest::getInt('quantity',$min_quantity); ?>"
to:
Code:
value="6"
so that the default value would be 6, but that you would still be able to set a lower value in the field.

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

More
11 years 1 week ago #214003 by pbleiman
Replied by pbleiman on topic Default quantity
Works like a charm ! Thanks.

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

More
5 years 7 months ago #329000 by ImageVillage
Replied by ImageVillage on topic Default quantity
Hey Nicolas is there a way to do this in latest Hikashop? I have a client who needs to do the same thing as this but can't work it out at all.

thanks

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

More
5 years 7 months ago #329008 by nicolas
Replied by nicolas on topic Default quantity
Hi,

It's still possible but the code to change has evolved.
Now, in that same view file show_quantity.php, you need to change the line:
$current_quantity = hikaInput::get()->getInt('quantity', $min_quantity);
to:
$current_quantity = 6;

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

Time to create page: 0.228 seconds
Powered by Kunena Forum