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

TOPIC: Product Category warning default.php on line 418

Product Category warning default.php on line 418 10 years 10 months ago #5097

Hi,

Congratulation about great work!

I need your help about virtuemart product category. I get this warning:

Warning: Invalid argument supplied for foreach() in /public_html/templates/flexible_darkmart/html/com_virtuemart/category/default.php on line 418

I read the solution published in the forum . When I am changing the code at default.php, "add to cart" button on virtuemart category disappears...only for ListView. Virtuemart category appears add to cart on GridView. If I keep the code I ve also add to cart and warning.
How could get rid of this warning and keep the "add to cart"button?

I am using Joomla! 2.5.9 and virtuemart 2.0.20b .
The topic has been locked.

Product Category warning default.php on line 418 10 years 10 months ago #5113

Hi Dimitris,

I really don't see how that code can make the add to cart disappear?

Have you put the closing curly brace in the right line?

Or don't use that code and add right at the top of that file

error_reporting(E_ERROR);

so it only shows errors and not warnings - which is how it should be on a production site..

Cheers
The topic has been locked.

Product Category warning default.php on line 418 10 years 10 months ago #5115

Ah! found the problem now - small mistake my side sorry

add the if statement after $customFieldCheck = 1;

then the add to is still there
 
if ($params->get('category_addtocart_list',1)) {
 
		$customFieldCheck = 1;
                    if($product->customfieldsCart){//added for if check
			foreach ($product->customfieldsCart as $field) {
				if (($field->field_type == "E") || ($field->field_type == "A")) {
				      $customFieldCheck = 0;
				}
			}
		}//added for if
 

Cheers
The topic has been locked.

Product Category warning default.php on line 418 10 years 10 months ago #5118

Solved!

Thank you very much! Great job John!
The topic has been locked.

Product Category warning default.php on line 418 10 years 10 months ago #5128

I'm embarresed - was my typo...

regards
The topic has been locked.
Time to create page: 0.567 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