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

TOPIC: logos manufacturers without hacked product.php

logos manufacturers without hacked product.php 10 years 3 months ago #7890

hello,

To avoid losing each update virtuemart , the solution to bring up the logos of manufacturers via the link

www.flexiblewebdesign.com/forum-virtuemart-2-template-puremart-support/250-tutorial-how-to-show-manufacturer-logos#1001

I found on the forum virtuemart a solution put in the files lightmart :

in /templates/flexible_lightmart/html/com_virtuemart/category/default:

search lign 306:
<?php if ($params->get('category_list_manufac',1)) { ?>
            <?php
if (empty($product->mf_images[0]->file_url_thumb)) {
  echo "";   // leave here empty so nothing will be visible
} else { ?>
            <?php
$ManufacturerLink = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $product->virtuemart_manufacturer_id . '&tmpl=component');
$ManufacturerName = $product->mf_name;
?>
            <div class="FlexibleProductDetailsManufacturerLogoList"> <a title="<?php echo $ManufacturerName; ?>"  rev="iframe|550|650"  rel="facebox" href="<?php echo $ManufacturerLink ?>"><img src="<?php echo $product->mf_images[0]->file_url_thumb; ?>" alt="<?php echo $ManufacturerName; ?>" /></a> </div>
            <?php } ?>
            <?php } ?>

replace by:
<?php if ($params->get('category_list_manufac',1)) { ?>
            <?php
			// get manufacturer models
		$model = VmModel::getModel('manufacturer');
		if ($product->virtuemart_manufacturer_id !=0 ) {
			$manufacturer = $model->getManufacturer();
			$model->addImages($manufacturer,1);
			$manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"',false);
		}
//if (empty($product->mf_images[0]->file_url_thumb)) {
if ($product->virtuemart_manufacturer_id ==0 ) {
  echo "";   // leave here empty so nothing will be visible
} else { ?>
            <?php
$ManufacturerLink = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $product->virtuemart_manufacturer_id . '&tmpl=component');
$ManufacturerName = $product->mf_name;
?>
            <div class="FlexibleProductDetailsManufacturerLogoList"> <a title="<?php echo $ManufacturerName; ?>"  rev="iframe|550|650"  rel="facebox" href="<?php echo $ManufacturerLink ?>"><?php echo $manufacturerImage;//$product->mf_images[0]->file_url_thumb; ?></a> </div>
            <?php } ?>
            <?php } ?>

I do the same for

if ($ params-> get ('category_grid_manufac', 1))

if ($ params-> get ('category_multi_manufac', 1))

And in /templates/flexible_lightmart/html/com_virtuemart/productdetails/default.php

ligne 404
<?php if ($params->get('productdetails_manufacturer',1)) { ?>   
                <?php
if (empty($this->product->mf_images[0]->file_url_thumb)) {
 
  echo "";   // leave here empty so nothing will be visible
} else { ?><?php
 
$ManufacturerLink = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $this->product->virtuemart_manufacturer_id . '&tmpl=component');
$ManufacturerName = $this->product->mf_name;
?>   
	 <div class="FlexibleProductDetailsManufacturerLogoList">  
    	<a title="<?php echo $ManufacturerName; ?>"  rev="iframe|550|650"  rel="facebox" href="<?php echo $ManufacturerLink ?>"><img src="<?php echo $this->product->mf_images[0]->file_url_thumb; ?>" alt="<?php echo $ManufacturerName; ?>" /></a>
    </div>
                    <?php } ?>              
               	<?php } ?>

replace by:
<?php if ($params->get('productdetails_manufacturer',1)) { ?>   
                <?php
			// get manufacturer models
		JRequest::setVar('virtuemart_manufacturer_id',$this->product->virtuemart_manufacturer_id,'GET');
		$model = VmModel::getModel('manufacturer');
		if ($this->product->virtuemart_manufacturer_id !=0 ) {
			$manufacturer = $model->getManufacturer();
			$model->addImages($manufacturer,1);
			$manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"',false);
		}
//if (empty($this->product->mf_images[0]->file_url_thumb)) {
if ($this->product->virtuemart_manufacturer_id ==0 ) {
  echo "";   // leave here empty so nothing will be visible
} else { ?>
            <?php
$ManufacturerLink = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $this->product->virtuemart_manufacturer_id . '&tmpl=component');
$ManufacturerName = $this->product->mf_name;
?>
            <div class="FlexibleProductDetailsManufacturerLogoList"> <a title="<?php echo $ManufacturerName; ?>"  rev="iframe|550|650"  rel="facebox" href="<?php echo $ManufacturerLink ?>"><?php echo $manufacturerImage;//$product->mf_images[0]->file_url_thumb; ?></a> </div>
 
            <?php } ?>
            <?php } ?>

Is this is correct, for the developer of lightmart?

Regards,
philippet
The administrator has disabled public write access.

logos manufacturers without hacked product.php 10 years 3 months ago #7898

hello,

for categories pages, the code does not work because only the first product logo is displayed on all other products. This code only works for the detail page of the product.

I have corrected with the following codes with classics queries:

in /templates/flexible_lightmart/html/com_virtuemart/category/default

replace with:
<?php if ($params->get('category_list_manufac',1)) { ?>
            <?php
 
		if ($product->virtuemart_manufacturer_id !=0 ) {
$db = JFactory::getDbo();
$select = 'SELECT me.file_url ';
$joinedTables = 'FROM `#__virtuemart_manufacturers` as m  ';
$joinedTables .= 'LEFT JOIN `#__virtuemart_manufacturers_'.VMLANG.'` AS ml on  ml.`virtuemart_manufacturer_id`= m.`virtuemart_manufacturer_id` ';
$joinedTables .= 'LEFT JOIN `#__virtuemart_manufacturer_medias` as mmex ON m.`virtuemart_manufacturer_id`= mmex.`virtuemart_manufacturer_id` ';
$joinedTables .= 'LEFT JOIN `#__virtuemart_medias` as me ON `me`.`virtuemart_media_id`= mmex.`virtuemart_manufacturer_id` ';
$where = ' WHERE';
$where .= ' `m`.`virtuemart_manufacturer_id` = '. $product->virtuemart_manufacturer_id;
$where .= ' AND `m`.`published` = 1';
$groupBy=' GROUP BY `m`.`virtuemart_manufacturer_id` ';
 
$q =$select. $joinedTables.$where.$groupBy;
$db->setQuery($q);
$mf_image = $db->loadObject();
		}
//if (empty($product->mf_images[0]->file_url_thumb)) {
if ($product->virtuemart_manufacturer_id ==0 ) {
  echo "";   // leave here empty so nothing will be visible
} else { ?>
            <?php
$ManufacturerLink = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $product->virtuemart_manufacturer_id . '&tmpl=component');
$ManufacturerName = $product->mf_name;
?>
            <div class="FlexibleProductDetailsManufacturerLogoList"> <a title="<?php echo $ManufacturerName; ?>"  rev="iframe|550|650"  rel="facebox" href="<?php echo $ManufacturerLink ?>"><img src="<?php echo $mf_image->file_url; ?>" alt="<?php echo $ManufacturerName; ?>" /></a> </div>
            <?php } ?>
            <?php } ?>

do the same for:
if ($ params-> get ('category_grid_manufac', 1))

if ($ params-> get ('category_multi_manufac', 1))

Is this correct?

Regards,
philippet
The administrator has disabled public write access.

logos manufacturers without hacked product.php 10 years 3 months ago #7914

Good Job!!

I will deeply investigate every single line you suggested and if they are feasible; i will include them to our template permanently. Asking people to do some core change each time they update their Virtuemart also kills me.

Greatly appreciated.

My first thought: doing a DB query inside the template-override files is not the best way. Those are Core Files' job. Beside, it might cause a performance issue because the query will be repeated (because of the foreach{} loop) for every single product inside the category page. If you list 50 products in the category page, it means; this query will be run 50 times. Considering we have 3 different views (listView, GridView, MultiGridView) the number will increase 50x3=150, this is an unnecessary load. Maybe carrying this query outside the foreach{}, run it only once to grab all the necessary information before foreach{} begins would give better performance. But anyway, I will investigate it.

Regards,
Support & Development
Last Edit: 10 years 3 months ago by Support.
The administrator has disabled public write access.

logos manufacturers without hacked product.php 10 years 5 days ago #9459

Hello Support Desk,

Did you find a solution to improve the query that display the logos without changing the script virtuemart?

I would be interested to have your solution.

Right now I spend a lot of time to adjust your template. Because my site is very slow. Similarly, apart from a non virtuemart page.
Indeed, a page loads after 5 to 10 seconds.
In after performance audits site as YSlow, PageSpeed​​, I have bad result and among the important results, there are: Optimize the order of styles and scripts.

How to improve it?

Your help is always welcome.

Regards,
Philippet
Last Edit: 10 years 5 days ago by Philippet.
The administrator has disabled public write access.

logos manufacturers without hacked product.php 10 years 4 days ago #9468

Hi,

Philippet, please create me;

- joomla (super) administrator account,
- FTP account (host/username/password)


and send them to This email address is being protected from spambots. You need JavaScript enabled to view it. .Let me take a look at your website to investigate the extreme waiting time. It would be normal if it was 1 second (or maximum 2 seconds if you are using Shared Hosting) but 4-5 seconds is a lot. I assume you are talking about LightMart template, is that correct?

If i change anything, i will provide you the detailed information about my touches.

While emailing to This email address is being protected from spambots. You need JavaScript enabled to view it. Don't forget to include this forum topic's URL at the of your message (or in the Subject field) as reference to avoid possible confusion in our end.

Regards,
Support
The administrator has disabled public write access.

logos manufacturers without hacked product.php 10 years 3 days ago #9481

Hello Support Desk,

I send you an email

regards
philippet
The administrator has disabled public write access.

logos manufacturers without hacked product.php 10 years 3 days ago #9492

Hi,

I replied you, after enabling the server-side cache, the waiting time drops to 500-600 ms, but the complete page loading is still too much. Basically there is not much thing to do on your website in terms of tweaks. You need to make your website little light-weight.

Currently there are too many contents being loaded in your website.
Read my email and you will understand what i am saying.

regards,
support
The administrator has disabled public write access.
Time to create page: 0.402 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