Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Link To Product Image (Php) Rate Topic   - - - - -

 
  • HareRama
  • Advanced Member
  • Trial users
  • Join Date: 10-Mar 19
  • 84 posts

Posted 20 September 2019 - 05:11 AM #1

Hey guys,

I try to get location of thumbnail image by PHP file. Suddenly old methods don't work so I'd ask you how to find thumb image location?

 

I tried this:

{$product.main_pair.detailed.image_path}

Not working. It' not show image location in TPL file neither PHP.

I tried also:

$product['main_pair']['detailed']['https_image_path']

but I get an error: Undefined index: detailed



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19832 posts

Posted 20 September 2019 - 05:19 AM #2

Print out the array and check if the path exists there

{$product.main_pair|fn_print_r}

or

fn_print_r($product['main_pair']);

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • HareRama
  • Advanced Member
  • Trial users
  • Join Date: 10-Mar 19
  • 84 posts

Posted 20 September 2019 - 11:44 AM #3

Hi,

Image exist, but I don't know why I can't get this data from array:

Array
(
    [pair_id] => 535
    [image_id] => 2252
    [detailed_id] => 0
    [position] => 0
    [icon] => Array
        (
            [image_path] => /images/product/2/header_2284.jpg
            [alt] => 
            [image_x] => 173
            [image_y] => 120
            [http_image_path] => /images/product/2/header_2284.jpg
            [https_image_path] => /images/product/2/header_2284.jpg
            [absolute_path] => /images/product/2/header_2284.jpg
            [relative_path] => product/2/header_2284.jpg
            [is_high_res] => 
        )

)


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19832 posts

Posted 20 September 2019 - 01:38 PM #4

So correct code is

 

{$product.main_pair.icon.image_path}
 
or
 
$product['main_pair']['icon']['https_image_path']

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • HareRama
  • Advanced Member
  • Trial users
  • Join Date: 10-Mar 19
  • 84 posts

Posted 21 September 2019 - 04:16 AM #5

Thank you so much, it WORKS!