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

TOPIC: After VM Update 1: Show manufacturer LOGOs

After VM Update 1: Show manufacturer LOGOs 8 years 4 months ago #4542

Hi,

With LightMart, 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.
The administrator has disabled public write access.

After VM Update 1: Show manufacturer LOGOs 8 years 4 months ago #4748

The manufacturer logo is displayed in 20x20px on the product page. Is it possible to make it display in, say 30x30px?

Attachment screenshot-man-20x20px.jpg not found



Cheers
The administrator has disabled public write access.

After VM Update 1: Show manufacturer LOGOs 7 years 7 months ago #8548

Use Firebug to understand which css-file and which part of code u must change.

Attachment before.jpg not found



Attachment after.jpg not found

The administrator has disabled public write access.

After VM Update 1: Show manufacturer LOGOs 7 years 7 months ago #8563

Thanks for the info, Ivan Ivanov.

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