Jump to content

Edit History

Maxence de Flotte

Maxence de Flotte

Hi,

Sorry for the late response. But for other members with the same problem, using a relative path is not a good idea.

$base_dir is not the full path but the path on your URL. You need to use _PS_IMG_DIR_.

Assign the variable on your module / controller

 514         $this->smarty->smarty->assign(
 515             'rm_img_dir',
 516             _PS_IMG_DIR_
 517         ); 

On your template, create the var with the fullpath

{assign var="icon_full_path" value="{$rm_img_dir}rm/c{$subcategory->id}.png"}

And use it on your template :

{if file_exists($icon_full_path)}...{/if}

 

Best regards,

Maxence de Flotte

Maxence de Flotte

Hi,

Sorry for the late response. But for other member with the same problem, using a relative path is not a good idea.

$base_dir is not the full path but the path on your URL. You need to use _PS_IMG_DIR_.

Assign the variable on your module / controller

 514         $this->smarty->smarty->assign(
 515             'rm_img_dir',
 516             _PS_IMG_DIR_
 517         ); 

On your template, create the var with the fullpath

{assign var="icon_full_path" value="{$rm_img_dir}rm/c{$subcategory->id}.png"}

And use it after :

{if file_exists($icon_full_path)}...{/if}

 

Best regards,

×
×
  • Create New...