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

TOPIC: Add to cart button on category page

Add to cart button on category page 10 years 10 months ago #4473

Hi,

i have problem in category view, the add to cart button does not shows up and even if i have price for the product after the price the "Call for price" text appear.
You can check on the address:
shoe.cupe-medalii.ro/index.php?option=com_virtuemart&view=category&virtuemart_category_id=962&Itemid=475&limitstart=9

Best regards
Attachments:
Last Edit: 10 years 10 months ago by Molnar Zoltan Csaba.
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4482

hmmmm..
there is a check for the price in templates/flexible_darkmart/html/com_virtuemart/category/default.php line 410

number_format($product->prices, 0, ',', '.')

maybe because all your prices are under 1 € this is failing?

Can you test with a product > 1€ please

Thanks
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4486

No, as you see in atached image in other category works well with price under 1 €.

Regards.
Attachments:
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4487

Ah, you didn't tell me it works fine on another category!!!!!

So therefore you have to carefully analyse what is the difference between this cat and the other - obviously our code doesn't change so your in the best position to see what the difference is!

It must be a config or price configuration issue... or the way you write the price - 0.55 or just .55 etc etc..
troubleshooting....

one of those in this screenshot has call for price - why?
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4490

It is possible to works only with >0.50 €?
I think thats the problem, i have no difference between products or categories, all of the products and categories are imported from other webpage(not joomla) and hve no differencies between them.

Regards.

P.S.
i have checked a product with 0,55 € and there is ok as you see in attachment, others with price under 0,50 € beside them have the Call for price error.
Attachments:
Last Edit: 10 years 10 months ago by Molnar Zoltan Csaba.
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4499

Ah - very interesting -

and if you comment out line templates/flexible_darkmart/html/com_virtuemart/category/default.php line 410
 
//if (!(number_format($product->prices['salesPrice'], 0, ',', '.')) and VmConfig::get('askprice', 1))  { //price is or not check-START

and the closing brace line 414
 
<?php // } //price is or not check-END ?>
 

maybe our check doesn't work under 50 cents (can't think why though...)

Cheers
Last Edit: 10 years 10 months ago by John.
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4505

Nothing happens :(
I have checked trough almost all of my 1200 products and the same on all categories, also checked on my localhost with unmodified quickstrat version of template and the same error showed up after changing one of the sample products price under 0,50 eur. As in attached image.
Attachments:
Last Edit: 10 years 10 months ago by Molnar Zoltan Csaba.
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4514

OK, found the problem, our check is rounding anything less than 50 cents to 0 and then it fails the test
so - there are 6 places to change on

templates/flexible_darkmart/html/com_virtuemart/category/default.php

where ever you see

number_format($product->prices, 0, ',', '.'))

change to

number_format($product->prices, 2, ',', '.'))

they will be arround lines 410, 427, 596, 603, 789, 1140

this check is also used for quick buy etc so basically if you see this problem just change all the string above from 0 to 2

Cheers
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4530

That was the problem :)

Thank for your help!!!

Regards.
The topic has been locked.

Add to cart button on category page 10 years 10 months ago #4531

Excellent - thanks for your patience..

Case closed
The topic has been locked.
Time to create page: 0.113 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