Jump to content

Las urls de las imagenes cambian cuando se inicia sesión


ortoespana

Recommended Posts

Buenas,

 

tengo un problema y no identifico donde solucionarlo.

 

en mi tienda online se ven perfectamente todas las imagenes de los productos, tanto en categorías como en la propia ficha de producto.

 

Pero cuando se inicia sesión, la url de las imagenes cambia y se muestra un signo de interrogación.

 

Un ejemplo de url que está bien: miurl.es/2093-product_category/asiento-de-ducha-abatible-profilo-con-patas.jpg

 

Ejemplo cuando inicio sesión: miurl.es/2093-product_category-2I8FJsrmhU/asiento-de-ducha-abatible-profilo-con-patas.jpg

 

Si os fijáis, se añade una serie de numeros y letras al final de product_category-2I8FJsrmhU

 

¿Alguna idea de como solucionarlo?

 

Un saludo

Link to comment
Share on other sites

Solucion temporal editar  /classes/Link.php

buscar funcion getImageLink

 

 

public function getImageLink($name, $ids, $type = null)

    {
        $not_default = false;
 
        // Check if module is installed, enabled, customer is logged in and watermark logged option is on
        if (($type != '') && Configuration::get('WATERMARK_LOGGED') && (Module::isInstalled('watermark') && Module::isEnabled('watermark')) && isset(Context::getContext()->customer->id)) {
            $type .= '-'.Configuration::get('WATERMARK_HASH');
        }
 
 
        // legacy mode or default image
        $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
        if ((Configuration::get('PS_LEGACY_IMAGES')
            && (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-3'.$type : '').$theme.'.jpg')))
            || ($not_default = strpos($ids, 'default') !== false)) {
            if ($this->allow == 1 && !$not_default) {
                $uri_path = __PS_BASE_URI__.$ids.($type ? '-4'.$type : '').$theme.'/'.$name.'.jpg';
            } else {
                $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-5'.$type : '').$theme.'.jpg';
            }
        } else {
            // if ids if of the form id_product-id_image, we want to extract the id_image part
            $split_ids = explode('-', $ids);
            $id_image = (isset($split_ids[1]) ? $split_ids[1] : $split_ids[0]);
            $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
            if ($this->allow == 1) {
 
$type = str_replace("CODIGO QUE SE DESEA BORRAR", "", $type);
 
                $uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';
            } else {
                $uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-8'.$type : '').$theme.'.jpg';
            }
        }
 

 

$type = str_replace("-zJXnfcWjI8", "", $type);

Link to comment
Share on other sites

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...