Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - PureMart (SKU# FLEX-00010)

TOPIC: QTY box should show the Min. Purchase QTY

QTY box should show the Min. Purchase QTY 11 years 2 months ago #2331

I just bought your Virtuemart 2 Template - PureMart. I'm using VM 2.0.16, Joomla 2.5 and PureMart3.4.
The value of quantity box shown in the product detail page always 1. But the minimum purchase quantity are set to 50 for many our products in VM. Could you please set the value of the quantity box to minimum purchase quantity?
By the way, quantity box is missing at the product detail page when the flaxv2 is set to category layout at shop front setting configuration (see attachment). The product with 50 minimum purchase quantity cannot be added to the cart if the flaxv2 is used.
Attachments:
Last Edit: 11 years 2 months ago by Fred Dawber.
The topic has been locked.

QTY box should show the Min. Purchase QTY 11 years 2 months ago #2372

Hi,

We have hided the "quantity" selection box from "flexv2" product details page, it is because there wasn't enough space there.
You can do this little modification in the PHP file to apply the "minimum purchase quantity" to that product.

Open this PHP file:
ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/productdetails/flexv2.php

Find this Line:
<input type="hidden" class="quantity-input js-recalculate" name="quantity[]" value="1">

Replace it with this:
 <input type="hidden" class="quantity-input js-recalculate" name="quantity[]" value="<?php if (isset($this->product->min_order_level) && (int)$this->product->min_order_level > 0) {
			echo $this->product->min_order_level;
		} else {
			echo '1';
		} ?>">

Then the "default" quantity will be set to "minimum required quantity" which will be 50 in your case. But still the quantity box will be hidden though.
If you want to show it as well, replace the 1st line with this instead:
<span class="quantity-box">
		<input type="text" class="quantity-input js-recalculate" name="quantity[]" value="<?php if (isset($this->product->min_order_level) && (int)$this->product->min_order_level > 0) {
			echo $this->product->min_order_level;
		} else {
			echo '1';
		} ?>"/>
	    </span>
				<span class="quantity-controls js-recalculate">
		<input type="button" class="quantity-controls quantity-plus"/>
		<input type="button" class="quantity-controls quantity-minus"/>
	    </span>

But the layout won't look good, because there is no enough space to put the quantity selection box and the plus,minus buttons. So, it would require some CSS touches to make it looks more natural and nicely fit.

Regards.
Forum Support.
The topic has been locked.

QTY box should show the Min. Purchase QTY 11 years 2 months ago #2411

Thanks for your reply.
The "Default" template is setup for product layout at VM configuration. The file (default.php) is modified by using your code. There is enough space to show the quantity box. It looks amazing. The PureMart templates are fantastic.
The topic has been locked.

QTY box should show the Min. Purchase QTY 11 years 2 months ago #2433

If you are saying, there is enough space to put quantity box and it looks good, then you got it ;)
I am glad things get worked well.

Case solved. Topic is closed.

Regards.
Forum Support.
The topic has been locked.
Time to create page: 0.104 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo