Jump to content

/img/p issue


Recommended Posts

Hello,

 

 

I am running Prestashop 1.5.3.1

 

 

My problem it's with images.

 

All the images (generated) are in img/p/ [a folder ex 1,2,3] insteed of /p/11-31-large_default.jpg for example

 

I tried to regenerate all the thumbs.

 

The problem it's that no data feed loads the images.

Datafeed Image Code:

 

   'image' => $okazii_DbPrefix.'image',

'.$db_tables['product_lang'].'.description,
       '.$db_tables['image'].'.id_image
   FROM
       '.$db_tables['product'].'
   LEFT JOIN
       '.$db_tables['product_lang'].' ON '.$db_tables['product'].'.id_product = '.$db_tables['product_lang'].'.id_product AND '.$db_tables['product_lang'].'.id_lang = '.$okazii_language.'    
   LEFT JOIN
       '.$db_tables['image'].' ON '.$db_tables['product'].'.id_product = '.$db_tables['image'].'.id_product AND '.$db_tables['image'].'.cover =1


$okazii_Product['image_url'] = $okazii_Product['id_image'] > 0 ? "http://" . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, "UTF-8") . _THEME_PROD_DIR_ . $okazii_Product['id_product'] . "-" . $okazii_Product['id_image'] . "-large_default.jpg" : '';


$Photos = explode("||",$okazii_Product['image_url']);
           if(count($Photos)>0){
               $productPhotos .= "<PHOTOS>"."\r\n";
               foreach($Photos as $Photo){
                   $productPhotos .= "<URL>".$Photo."</URL>"."\r\n";
               }
               $productPhotos .= "</PHOTOS>"."\r\n";
           }
           $altele = "";

Link to comment
Share on other sites

it's not an issue, this is how prestashop works. your images are stored in the separate directories in the img/p

"11-31-large_default.jpg " - this is an method of "mod rewriting" images

 

Thanks but why the data-feed doesn't find the images?

Link to comment
Share on other sites

it's because the htaccess (i suppose)

 

i think that the best way to get working urls to pictures is a $link object and getImageLink function

 

Thanks for your reply.

 

Can I get an example of that code? or a documentation link, i searched Google but I found nothing

Link to comment
Share on other sites

×
×
  • Create New...