Jump to content

(Solucionado) Problema con módulo slider de marcas


RicRey

Recommended Posts

Hola, tengo un modulo de carrusel de logos de las marcas que es gratuito y me es muy util, pero me gustaria que tomara las imagenes de un tamano especifico y no del tamaño puro como lo hace actualmente... por ejemplo quiero que tome las imagenes de "manufacturer_default" pero lo hace directamente y eso las hace muy pesadas. ¿Hay alguna manera de que me pueda ayudar?, pego parte del código en caso de que alguien pueda.

 

     protected function _prepareHook()
     {        
        if(!explode(',',Configuration::get('YBC_MF_MANUFACTURERS')))
            return;
        switch(Configuration::get('YBC_MF_MANUFACTURER_ORDER'))
        {
            case 'name_desc':
                $order = 'name desc';
                break;
            case 'manu_asc':
                $order = 'id_manufacturer asc';
                break;
            case 'manu_desc':
                $order = 'id_manufacturer desc';
                break;
            default:
                $order = 'name asc';
                break;
        }
        $manufacturers = $this->getManufactures($order, (int)Configuration::get('YBC_MF_MANUFACTURER_NUMBER') > 0 ? (int)Configuration::get('YBC_MF_MANUFACTURER_NUMBER') : false);
        foreach ($manufacturers as &$manufacturer)
		{		
            if(file_exists(_PS_MANU_IMG_DIR_.$manufacturer['id_manufacturer'].'.jpg'))
                $manufacturer['image'] = _THEME_MANU_DIR_.$manufacturer['id_manufacturer'].'.jpg';
            else
                $manufacturer['image'] = $this->_path.'images/default_logo.jpg';
		}
		$this->smarty->assign(array(
			'manufacturers' => $manufacturers,
			'YBC_MF_TITLE' => Configuration::get('YBC_MF_TITLE', (int)$this->context->language->id),
			'YBC_MF_SHOW_NAME' => (int)Configuration::get('YBC_MF_SHOW_NAME'),
            'YBC_MF_PER_ROW_DESKTOP' => (int)Configuration::get('YBC_MF_PER_ROW_DESKTOP'),
            'YBC_MF_PER_ROW_MOBILE' => (int)Configuration::get('YBC_MF_PER_ROW_MOBILE'),
            'YBC_MF_PER_ROW_TABLET' => (int)Configuration::get('YBC_MF_PER_ROW_TABLET'),
            'YBC_MF_SHOW_NAV' => (int)Configuration::get('YBC_MF_SHOW_NAV'),
            'YBC_MF_AUTO_PLAY' => (int)Configuration::get('YBC_MF_AUTO_PLAY'),
            'YBC_MF_PAUSE' => (int)Configuration::get('YBC_MF_PAUSE'),
            'YBC_MF_SPEED' => (int)Configuration::get('YBC_MF_SPEED') > 0 ? (int)Configuration::get('YBC_MF_SPEED') : 5000,
            'link' => $this->context->link,
            'view_all_mnf' => $this->context->link->getPageLink('manufacturer')
		));
        return $this->display(__FILE__, 'manufacturers.tpl');

 

Edited by RicRey
solucionado (see edit history)
Link to comment
Share on other sites

Resuelto...

lo coloqué así...

 

        $manufacturers = $this->getManufactures($order, (int)Configuration::get('YBC_MF_MANUFACTURER_NUMBER') > 0 ? (int)Configuration::get('YBC_MF_MANUFACTURER_NUMBER') : false);
        foreach ($manufacturers as &$manufacturer)
		{		
            if(file_exists(_PS_MANU_IMG_DIR_.$manufacturer['id_manufacturer'].'-manufacturer_default.jpg'))
                $manufacturer['image'] = _THEME_MANU_DIR_.$manufacturer['id_manufacturer'].'-manufacturer_default.jpg';
            else
                $manufacturer['image'] = $this->_path.'images/default_logo.jpg';

 

Link to comment
Share on other sites

  • RicRey changed the title to (Solucionado) Problema con módulo slider de marcas

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...