How to add a banner in the product page?

  • Posts: 107
  • Thank you received: 1
11 years 4 months ago #79170

Dear all ,

I wonder how can I add a banner in the product page besides the introduction text ? Please refer to the picture.



Thank you so much. :)

Attachments:
Last edit: 11 years 4 months ago by tinachou.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #79180

Hi,
I think that you'll have to do it through your "show_default" file of the "product" view of your front-end template ("Hikashop->Display->Views"). And insert the HTML code in the right placeto display your banner.

Hope this will help you.

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 1
11 years 4 months ago #80426

Hi,

thanks for the hint.

My problem is that how to match each product page with a corresponding banner. Each product has its own banner.

Which file should I edit?

And how can I point the banner picture to a certain product page...?

Thank you so much. :)

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #80473

Hi,

Mohamed is right when he say that the file to edit is "show_default".
To match each product page with a banner, you just have to set a dynamic link in this view.

For example, <img src="yourFolderPath/image_<?php echo hikashop_getCID('product_id');?>" alt="banner_<?php echo hikashop_getCID('product_id');?>"/>
and name you banner image_+product id.

Last edit: 11 years 4 months ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 1
11 years 4 months ago #80618

HI there,

I inserted the line into show_default.php.

<img src="images/product/banner/PRODUCT_<?php echo  hikashop_getCID('product_id');?>.jpg" alt="banner_<?php echo  hikashop_getCID('product_id');?>"/> 

However, I wonder the product_id is the same as which I defined? Such as A1, A2, A3..in the following picture.





But after I tested, I found the product_id is something generated by system? Because when I name the banner as "PRODUCT_A1.jpg", the picture will not appear.

How can I define the product_id?

Thank you very much. :)

Attachments:
Last edit: 11 years 4 months ago by tinachou.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #80656

Hi,

Yes the product_id is defined by system, but if you prefer you can use the product code.
instead of "<?php echo hikashop_getCID('product_id');?>" you can use "<?php echo $this->element->product_code; ?>"

Please Log in or Create an account to join the conversation.

Time to create page: 0.097 seconds
Powered by Kunena Forum