Jump to content
espacious

push in cart wrong image url

Recommended Posts

Hi to all,

recently we bought Push On Cart module for our website. But i have a small problem with displaying images.

The image in fact does not show:

https://screenshots.firefox.com/PMHwZxokMa1jGr8S/dev.smartus.hr

I found out that the img url is wrong (it includes the domain name 2x) eg.:

dev.domain.com/162/xiaomi-yi-smart-car-dash-camera.jpg - the link already contains the "domain part" 

http://dev.domain.com/dev.domain.com/162/xiaomi-yi-smart-car-dash-camera.jpg - when inspecting the link the domain is duplicated

 

I have access to all files and database, i know a bit of php but i couldnt find how to correct this error.

The error is present on 1.6.x and 1.7.x versions.

What i want is remove the domain part from the link and let PS add the domain part.

I think is somwhere here the error:

$link = $context->link;

        $image_type = ImageType::getImagesTypes();

        if (!empty($images[0]['id_image']))

        {

            if (Configuration::get('PS_LEGACY_IMAGES'))

                $image_link = Tools::getShopDomain(true).'/img/p/'.(int)$p_id.'-'.$images[0]['id_image'].'-large.jpg';

            else

                $image_link = $link->getImageLink($link_rewrite[0]['link_rewrite'], $images[0]['id_image'], $image_type[0]['name']);

 

Share this post


Link to post
Share on other sites

Ok i found a solution, or a way to solve my problem please advice me if i'm wrong.

I modifyed /classes/Link.php directly, as in the override folder there was already some Link.php (override).

So what i modifyed: in Links.php i added another function, practicaly i copied the "public function getImageLink"

and make this change in the last line of that function.

from this:

return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path;

to this:

return $uri_path;

For any further asisstance dont hesitate to contact me. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More