Jump to content

multishop multistore image cart error


Recommended Posts

Hi,
I have the following error. I'm running PrestaShop 1.6.1.4 with multishop with customers and carts shared.

 

Case 1:
When I iniatiate the cart in shop 1 and then go to shop 2, cart confirmation image and cart thumbnails of shop 2 are not available.

 

To "reset" the cart to make the next test I log in and then log off.

 

Case 2:
When I iniatiate the cart in shop 2 and then go to shop 1, cart confirmation image and cart thumbnails shop 1 are not available.

I have tried regenerating images but it doesn't work.

 

You can look at the pictures to better understand what I'm trying to explain.

Example:
Shop 1: http://www.ccyv.cl/ngorros
Shop 2: http://www.ccyv.cl/extragangas

Image of case 1: http://www.ccyv.cl/error/shop1shop2.png
Image of case 2: http://www.ccyv.cl/error/shop2shop1.png

 

post-316780-0-47404900-1460518881_thumb.png

post-316780-0-25621300-1460518626_thumb.png

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I hope this answer can still be useful for you or another else.

 

The solution for this bug is to edit the file /classes/Cart.php

 

In line 579 you must to change the next code:

 

$sql->leftJoin('image_shop', 'image_shop', 'image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$this->id_shop);

 

Into:

 

$sql->leftJoin('image_shop', 'image_shop', 'image_shop.`id_product` = p.`id_product` AND image_shop.cover=1');

 

This will fix the issue.

 

Greetings.

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Thanks Dossijeo, At first sight it looks like your solution works flawlesly.. Sadly we found out that this fix causes a new problem:

 

In our multistore-setup, we have several products that are being sold in both shops. (The articles have the same id-numbers, only different product-texts etc). After installing your fix, it becomes impossible for these items, to buy only one.  Even when you try to put only one of these items in the cart, there will be 2 separate lines with the same product in the shopping cart. The price is also calculated for two. Removing one of these products will remove both.

 

Perhaps there is someone with a solution for this issue? Thanks!

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

  • 11 months later...

This solution doesn't work on PrestaShop v. 1.7.x.

 

Images cross stores still not showing in cart, links to product cross shops does't works in cart. The problem is that url's links to current visited shop, not shop where produc't came from.

 

Anyone know how to repair this bug ?

 

(sorry for my English)

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

This solution doesn't work on PrestaShop v. 1.7.x.

 

Images cross stores still not showing in cart, links to product cross shops does't works in cart. The problem is that url's links to current visited shop, not shop where produc't came from.

 

Anyone know how to repair this bug ?

 

(sorry for my English)

 

Link to product work in this way:

 

<a href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html'}"> ... <a/>

 

Images still not showing.

Link to comment
Share on other sites

Link to product work in this way:

 

<a href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html'}"> ... <a/>

 

Images still not showing.

 

Link to image works: 

 

<img src="{$link->getImageLink($product.name, $product.id_image, 'cart_default')}" alt="{$product.name|escape:'quotes'}">

Link to comment
Share on other sites

  • 4 months later...

Hi here, I have same problem in Prestashop 1.7.2.0 with multistore and all share options in YES.

I change in minicart the line for this:

<img src="{$link->getImageLink($product.name, $product.id_image, 'cart_default')}" alt="{$product.name|escape:'quotes'}">

but dont work for me, any idea?

Thanks so much

Link to comment
Share on other sites

  • 1 year later...
On 6/7/2016 at 7:19 AM, dossijeo said:

Hi,

 

I hope this answer can still be useful for you or another else.

 

The solution for this bug is to edit the file /classes/Cart.php

 

In line 579 you must to change the next code:

 

$sql->leftJoin('image_shop', 'image_shop', 'image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$this->id_shop);

 

Into:

 

$sql->leftJoin('image_shop', 'image_shop', 'image_shop.`id_product` = p.`id_product` AND image_shop.cover=1');

 

This will fix the issue.

 

Greetings.

you are genius!!! PS 1.7.5.2 works... thanks!

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