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

TOPIC: Pb when manufacturer logo is visible & view categ

Pb when manufacturer logo is visible & view categ 8 years 11 months ago #12394

Hi

I'm view website with flexible overrides.
index.php?option=com_virtuemart&view=category&virtuemart_category_id=XX

I have an error sql when searching logos of manufacturers.

If I disable manufacturers logo, it's ok but when the query have to join manufacturers table, then it crashes.
			$query
				->select($db->quoteName('a.file_url'))
				->from($db->quoteName('#__virtuemart_medias', 'a'))
				->join('INNER', $db->quoteName('#__virtuemart_manufacturer_medias', 'b') . ' ON (' . $db->quoteName('b.virtuemart_manufacturer_id') . ' = '. $product->virtuemart_manufacturer_id[0].')')
				->where($db->quoteName('a.virtuemart_media_id') . ' = '.$db->quoteName('b.virtuemart_media_id')); 
			$db->setQuery($query);

Because $product->virtuemart_manufacturer_id[0] is not always set !
The administrator has disabled public write access.

Pb when manufacturer logo is visible & view categ 8 years 11 months ago #12437

Looks like, you almost find a solution by yourself.

What happens if we check $product->virtuemart_manufacturer_id[0] with simple if..else statement before running the query?

Like this:
<?php if (isset($product->virtuemart_manufacturer_id[0])) { 
			  $db = JFactory::getDbo();
			  $query = $db->getQuery(true);
			  $query
				  ->select($db->quoteName('a.file_url'))
				  ->from($db->quoteName('#__virtuemart_medias', 'a'))
				  ->join('INNER', $db->quoteName('#__virtuemart_manufacturer_medias', 'b') . ' ON (' . $db->quoteName('b.virtuemart_manufacturer_id') . ' = '. $product->virtuemart_manufacturer_id[0].')')
				  ->where($db->quoteName('a.virtuemart_media_id') . ' = '.$db->quoteName('b.virtuemart_media_id')); 
			  $db->setQuery($query);
			  $results = $db->loadRow();
			  $is_manufacturer_exist = true; // dummy variable
			} else {
				$is_manufacturer_exist = false; // dummy variable		
			}
?>
            <?php if ($is_manufacturer_exist) {  // display manufacturer if dummy variable is set to TRUE ?>
            <div class="FlexibleCategoryManufacturerLogoList"> <a title="<?php echo $product->mf_name; ?>" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' . $product->virtuemart_manufacturer_id[0]); ?>"><?php echo ($results [0]) ? '<img src="'.JURI::root () . $results [0].'" alt="'.$this->product->mf_name.'" />':$product->mf_name; ?></a> </div>
	    <?php } ?>

so this query won't be run if the $product->virtuemart_manufacturer_id[0] is not defined.


regards.
Last Edit: 8 years 11 months ago by Support.
The administrator has disabled public write access.

Pb when manufacturer logo is visible & view categ 8 years 11 months ago #12467

Hi
Thanks for your response.
Did you update the package ? or should I make the changes myself ?
The administrator has disabled public write access.

Pb when manufacturer logo is visible & view categ 7 years 3 weeks ago #14913

Hi. I have problem with manufacturer logos in cleanmart. is any idea to solve it, if i need show manufacturer logos, but havent logos in all products?
The administrator has disabled public write access.

Pb when manufacturer logo is visible & view categ 7 years 2 weeks ago #14927

Hi,

This problem has been fixed permanently. Please make sure to update to the latest CleanMart version. Latest CleanMart is v3.9.7
www.flexiblewebdesign.com/forum-virtuemart-2-template-support/1379-cleanmart-updates-check-and-request



Regards.
The administrator has disabled public write access.
Time to create page: 0.142 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