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

TOPIC: After VM Update 1: Show manufacturer LOGOs

After VM Update 1: Show manufacturer LOGOs 5 years 9 months ago #7909

Hi,

With CoolMart, it is possible to show Manufacturer LOGOs in the category browse page and product details page.

You might know, this feature doesn't included to Virtuemart by default, and it comes with our VM Template. Therefore some lines need to be inserted to a Core Virtuemart PHP file in order to load the manufacturer logo in the category browse page and product details page.

The PHP file you need to make edits is located here:
/administrator/components/com_virtuemart/models/product.php

Look at the lines around 812th, and find these lines:
if (!empty($product->virtuemart_manufacturer_id)) {
	$mfTable = $this->getTable ('manufacturers');
	$mfTable->load ((int)$product->virtuemart_manufacturer_id);
	$product = (object)array_merge ((array)$mfTable, (array)$product);
}

replace them with these:
if (!empty($product->virtuemart_manufacturer_id)) {
	$mfTable = $this->getTable ('manufacturers');
	$mfTable->load ((int)$product->virtuemart_manufacturer_id);
	$xrefTable = $this->getTable('manufacturer_medias');
	$mfImages = $xrefTable->load($product->virtuemart_manufacturer_id);
	if(!empty($mfImages)) {$mfTable->mf_image_id = $mfImages[0];
		$mediaModel = VmModel::getModel('Media');
		$product->mf_images = $mediaModel->createMediaByIds($mfImages[0],'','image');		
	}
	$product = (object)array_merge ((array)$mfTable, (array)$product);
}


And that's it. You will be good to go.
If Official VM Developers decide to include this feature to Virtuemart by default in one of next releases, than Wohooo, you won't need any coding modifications, Otherwise you will have to repeat this Coding modifications every time you update your Virtuemart. Since with a Virtuemart update; every PHP file in /administrator/components/com_virtuemart/ refreshes itself and all modifications are gone.


Regards.
Flexible Support Team.
Last Edit: 5 years 9 months ago by Support.
The administrator has disabled public write access.
Time to create page: 0.115 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