Jump to content

Problem with blockviewed after update...


Recommended Posts

It is only the Angry birds image that does not seem to show, Try regenerating your product images if that does not work try deleting the images for that product and re-upload and see if that helps.

The url link to the image is definitely wrong, have you tried to see if it works with friendly URL's off, I had an issue very similar with 1.5.4.0 and friendly urls causing images not to show.

 

This is a little different then a problem I see with my 1.5.4.1 test site but may also fix this issue.

 

http://forge.prestashop.com/browse/PSCFV-8973

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

Now i deleted the module, where can i get it again, to reinstall it ? :)

 

if you deleted the module, you need to upload it, download prestashop installation library, unpack it, go to the modules dir and pack directory with this module. After that go to modules section in your BO and upload it -> install.

 

unfortunately if you DELETED (not uninstall) the module - other way doesnt exist

Link to comment
Share on other sites

Got it again, but dont work.. Guess i just have to uninstall it and leave it..

 

Did you try the fix I posted in the forge report, even though your issue is a little different the fix for viewed product images may work for your site to.

Edit the blockviewed.php file and change as below:

 

Changing line 108 from this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product)'.

To this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

Fixes the image issue.

Link to comment
Share on other sites

Did you try the fix I posted in the forge report, even though your issue is a little different the fix for viewed product images may work for your site to.

Edit the blockviewed.php file and change as below:

 

Changing line 108 from this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product)'.

To this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

Fixes the image issue.

 

Thx.. but the module is not even showing now so i dont know! :)

Link to comment
Share on other sites

Thx.. but the module is not even showing now so i dont know! :)

 

 

What does that mean, you uninstalled, re-install and try the fix posted if it does not work you can uninstall again.

Nothing ventured nothing gained. lol

Link to comment
Share on other sites

Okey... to make it clear. non of it works... i have the modul agian and it is on my store too, but still the same problem :)

 

and when i change it to:

 

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

 

The modul doesnt even show on my site :)

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

Okey... to make it clear. non of it works... i have the modul agian and it is on my store too, but still the same problem :)

 

and when i change it to:

 

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

 

The modul doesnt even show on my site :)

 

 

Very odd, well at least you tried.

Link to comment
Share on other sites

Okay, you installed the module again, and also made the changes that tdr170 mentioned? Cleared cache etc... still does not work?

Yes

 

Very odd, well at least you tried.

 

Yeah and thx a lot for the help! :) or the time you took :)

Link to comment
Share on other sites

Hello guys ,

 

i have the same problem like balutten.

 

I upgraded from 1.5.3.1 to the newest version .

 

I tried the fix from tdr170 but now the modul isnt showing anymore.

 

I really need a solution for this because i want to use the next version.

post-311609-0-83340700-1367414405_thumb.jpg

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

I tried multiple ways of changing the file and could not reproduce the module not showing at all.

I know a lot of files have changed form 1.5.3.1 to 1.5.4.1 and not sure what is up here.

I am wondering if your upgrade deleted all files from 1.5.3, in the past I had some issues with left over files from upgrades causing issues like this one.

The site I am testing on is a fresh install of 1.5.4.1. I did some testing and there may be another line that needs to be added.

Please try this and let me know what happens.

 

replace this entire section in your blockviewed.php

 

 

$productIds = implode(',', $productsViewed);

$productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('

SELECT image_shop.id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite

FROM '._DB_PREFIX_.'product p

'.Shop::addSqlAssociation('product', 'p').'

LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')

LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'

LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image)

LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')

WHERE p.id_product IN ('.$productIds.')

AND pl.id_lang = '.(int)($params['cookie']->id_lang).'

AND cl.id_lang = '.(int)($params['cookie']->id_lang).'

GROUP BY product_shop.id_product'

);

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

Nope i didnt do anything. The text isnt visible when i look at it. I cleaned the cache and used chrome, firefox and the i-net explorer

 

I see that the shop is in english when you visited it.

 

What is strange because only german is activated.

 

Did you tip at the header? Because it links to my original shop at topsportsfood.eu

 

Prestashop 1.5.4.1 is at test.topsportsfood.eu

Link to comment
Share on other sites

Nope i didnt do anything. The text isnt visible when i look at it. I cleaned the cache and used chrome, firefox and the i-net explorer

 

I see that the shop is in english when you visited it.

 

What is strange because only german is activated.

 

Did you tip at the header? Because it links to my original shop at topsportsfood.eu

 

Prestashop 1.5.4.1 is at test.topsportsfood.eu

 

 

Yes now that you mention it I did just checked and you correct the Short desc does not show.

If you change the file back do you get the short desc. but not the image.

Link to comment
Share on other sites

Did you try the fix I posted in the forge report, even though your issue is a little different the fix for viewed product images may work for your site to.

Edit the blockviewed.php file and change as below:

 

Changing line 108 from this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product)'.

To this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

Fixes the image issue.

 

This fix instantly work for me :) THANKS !

 

Prestashop 1.5.4.1 fresh install on localhost with UniformServer

No cache, all optimization deactivated

Simply create 2 product with 2 (or more) pictures and go to the shop, after clicking on a product with 2 (or more) pictures the blockviewed push a blank image

If only 1 img for the product : no bug

Hope this help ^_^

Link to comment
Share on other sites

Hi

 

In Prestashop 1.5.4.1 this fix work for me.

 

Changing line 108 from this:

 

LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'.

 

To this:

 

LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

 

Please, Try it.

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

  • 2 months later...

thanks for your suggestion

i'm convinced that it will be helpfull for other forum members

 

anyway, just want to say that on github you can usually find latest and fixed version of the prestashop, but also files in "progress"

Link to comment
Share on other sites

Here is an update to this issue, I just did another upgrade test and this issue appeared again.

When just replacing the single line the block would not even show just as with fabsh.

So I took another look at the code and changed all lines to be as in the 1.5.4.0 working version and the images and text all show.

line 108 is still changed but also Group was removed and an addition AND statement was added.

As you can see below alot of the code is also re-arranged for order.

 

Here is the complete code that worked for me should be lines 100 through around line 117.

 

 

$productIds = implode(',', $productsViewed);

$productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('

SELECT image_shop.id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite

FROM '._DB_PREFIX_.'product p

LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')

LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'

LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image)

'.Shop::addSqlAssociation('product', 'p').'

LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')

WHERE p.id_product IN ('.$productIds.')

AND (i.id_image IS NULL OR image_shop.id_shop='.(int)$this->context->shop->id.')

AND pl.id_lang = '.(int)($params['cookie']->id_lang).'

AND cl.id_lang = '.(int)($params['cookie']->id_lang)

);

Link to comment
Share on other sites

×
×
  • Create New...