X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Increase brand image on product pages (Shop By Brand module) (https://forum.x-cart.com/showthread.php?t=75059)

benlind 03-04-2017 09:27 AM

Increase brand image on product pages (Shop By Brand module)
 
I am using the Shop By Brand module. I would like to increase the size brand logo on individual product pages without losing quality. I uploaded a very large version of the logo for the brand, but it is being resized to 100px wide before being displayed on the page. I want it to be at least 160px.

How can I get a larger, high-quality version of the brand image on product pages?

benlind 03-04-2017 09:39 AM

Re: Increase brand image on product pages (Shop By Brand module)
 
I solved this problem by overriding the module's View/Product/Details/Brand.php file's getLogoWidth() and getLogoHeight() methods.

This is the file I created at classes/XLite/Module/<dev_id>/<module_id>/Module/QSL/ShopByBrand/View/Product/Details/Brand.php:

PHP Code:

<?php
// vim: set ts=4 sw=4 sts=4 et:

namespace XLite\Module\<dev_id>\<module_id>\Module\QSL\ShopByBrand\View\Product\Details;

class 
Brand extends XLite\Module\QSL\ShopByBrand\View\Product\Details\Brand implements \XLite\Base\IDecorator
{
    
/**
     * Get the width of the product's brand logo.
     *
     * @return integer
     */
    
public function getLogoWidth()
    {
        return 
200;
    }

    
/**
     * Get the width of the product's brand logo.
     *
     * @return integer
     */
    
public function getLogoHeight()
    {
        return 
150;
    }
}


I then redeployed the store, and the brand images were now bigger on individual product pages.


All times are GMT -8. The time now is 05:59 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.