additional custom template for product card (?link

  • Posts: 19
  • Thank you received: 1
12 years 3 months ago #61053

Hello,

I have a custom template for a product view (/templates/MY_Template/html/com_hikashop/product/show_default.php),
and I would like to have a link from it to the same product card, but shown in other order (one more different template).

Is there a way to pass that extra template name through the link query string?
Something like: yoursite.com/category/product/1-product-name?view=show_custom_2.php
?

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

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 3 months ago #61103

Hi,

Well, you will have to edit all the files where there is a link to the product page and add that parameter to the link.
For example, in the listing_img_title item box layout (the default one) of products listings the link is generated at the beginning of the file. Just add your parameter there in the link.
I don't recommend to have the extension in the link as it might not work with the SEF. I also don't recommend that you use view but something else like "myview" because view is already used by joomla and could cause a conflict.
You should rather have ?myview=show_custom_2

Then, on your show_default override, you can use $myview = $_GET in order to retrieve the value of your parameter.

The following user(s) said Thank You: Apple

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

  • Posts: 19
  • Thank you received: 1
12 years 3 months ago #61110

Thanks a lot, nicolas

I see. Meanwhile I thought of another solution, not that valid though. Just edit show_default.php, copying the entire code under the if ($_GET == 'mykey') statement, and changing the layout as needed.

BTW, let me tell you that your component is great! Powerfull and highly flexible.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.057 seconds
Powered by Kunena Forum