Jump to content

Display product list website-hosting.tpl


Dadou76620

Recommended Posts

Hello I have wanted to see the list of products on my website-hosting.tpl as products.tpl file located in (/templates/orderforms/premium_comparison).

 

But the following code shows me nothing

{foreach from=$products key=num item=product}
{/foreach}

 

Thank you for your future responses

Link to comment
Share on other sites

Hello I have wanted to see the list of products on my website-hosting.tpl as products.tpl file located in (/templates/orderforms/premium_comparison).

But the following code shows me nothing

that's because the $products array only exists in the cart - not outside of it... so that code will not work.

 

to do what you want to do, you're going to have to do one of two things - and that's not including styling your website-hosting.tpl template to look like premium comparison (if that's what you want to do)...

 

1. you can either use Data Feeds to obtain product names, prices, descriptions etc

2. or write a hook to recreate the $products array - you probably wouldn't need as complicated an array as the one used in the cart, just one containing ids, names, descriptions, prices etc and then add a link to the product which will allow the ordering process to continue via the cart...

 

i've posted similar hooks recently for getting various details such as bundle names, group descriptions etc - just do a search on my forum name and $products - but before coding the hook, make a note of what information you're actually going to need from it, e.g do you need to show multiple product groups, do you need sidebars for them (as in the cart), do you need to show multiple pricing options... the choices are endless and you can decide whether you want to keep it simple or complicated!

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated