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

TOPIC: Add to Cart disappers if price is lower than $0.50

Add to Cart disappers if price is lower than $0.50 11 years 3 months ago #2141

The add to cart button disappears from product if the price of the product is less than $0.50. We sell piece parts with a minimum order quantity, and many of our parts are only a few pennies each. If the price of each piece does not equal at least $0.50, the add to cart button vanishes making the part unable to be ordered.

I created some copies of a part to show this:

Price less than $0.50:
ww2.wiringproducts.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=3463&virtuemart_category_id=1254

Price equal to or greater than $0.50:
ww2.wiringproducts.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=3753&virtuemart_category_id=1254
Last Edit: 11 years 2 months ago by Support.
The administrator has disabled public write access.

Add to Cart button disappearing 11 years 3 months ago #2147

Hi,

I am sure it is because of the rounding number.
You can manually disable this price rounding.

Open this PHP file:
ww2.wiringproducts.com/templates/wiringproducts_responsive_g_1/html/com_virtuemart/productdetails/default.php

find this PHP line: (around: 487th)
if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices) and (number_format($this->product->prices['salesPrice'], 0, ',', '.'))) {

and change it to this:
if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices)) {

Or even to this:
	if (!VmConfig::get('use_as_catalog', 0)) {

Let me know if it won't work.

Regards.
Forum Support.
The administrator has disabled public write access.

Add to Cart button disappearing 11 years 3 months ago #2188

I am also having this same problem. Most of our products are low price. If the price is under 0.50 the cart button does not show.
I did try both the changes you suggested above but unfortunately for me they did not work.

Joomla 2.5.8
Virtuemart 2.0.18a
The administrator has disabled public write access.

Add to Cart button disappearing 11 years 2 months ago #2195

Hi,

I am now proving the correct patch now. (disregards the previous patch)

If you are using "default" layout for product details page, then the file you need to make is this:
ROOt/templates/<yourjoomlatemplate>/html/com_virtuemart/productdetails/default.php

If you are using "flexv2" layout for product details page, then the file you need to make edit is this:
ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/productdetails/flexv2.php

Find this expression:
number_format($this->product->prices['salesPrice'], 0, ',', '.');

And change it to;
number_format($this->product->prices['salesPrice'], 2, ',', '.');

Then you should start seeing the "add to cart" button even though the product price is lower than 0.5

But this time you will lose the ability to show the "call for price" feature when the product price is 0.00 though. I hope you don't have any product with the price of 0.00

Regards.
Forum Support.
Last Edit: 11 years 2 months ago by Support.
The administrator has disabled public write access.

Add to Cart button disappearing 11 years 2 months ago #2248

I applied the above patch and I now have an add to cart button on the product details page.
Thank you

I also applied the patch to /html/com_virtuemart/category/flexv2list.php to enable the the add to cart button to appear on the the category list view.
Last Edit: 11 years 2 months ago by Deborah Jones.
The administrator has disabled public write access.

Add to Cart button disappearing 11 years 2 months ago #2260

Oh yes, i forgot to mention about the browse page, because browse page also includes the "add to cart" button.

Regards.

Case solved. Topic is closed.
The administrator has disabled public write access.
Time to create page: 0.217 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