Jump to content

hooks doesn't work


Recommended Posts

Hi guys, are there any one who can suggest me a sample hooks code for this particular need:

We would like to output a custom html block in to the cart page where before id="order-standard_cart" for this kind of specific link: /cart.php?a=add&pid=17

 

It would be a huge help if you can help me.

 

Best Regards,

Link to comment
Share on other sites

Hi Brian, thank you for your explanation.

How would you do it if you were just wanted to output a simple html block in to the cart page for a specific product? I am asking this why we need to display this html block for only one particular/specific product what it is in the cart.

Link to comment
Share on other sites

Hi,

 

How would you do it if you were just wanted to output a simple html block in to the cart page for a specific product? I am asking this why we need to display this html block for only one particular/specific product what it is in the cart.

I can think of two quick ways, and which to choose will depend on what you want to display and where, would be to either...

 

1. add your html code to the product description itself (via the product setup in the admin area) - you can add HTML to your description, so depending on what you want to add for this one product, you may be able to do it this way.

2. edit the products.tpl template and somewhere appropriate for the layout in the {foreach $products as $key => $product} loop, add the following Smarty code...

 

{if $product.pid eq "17"}
*your html code*
{/if}

Link to comment
Share on other sites

I tried to add this one:

It doesn't output the html. I removed the if statement (for testing if I am working on the correct file) it worked. Do you have any suggestion? thanks.

it works when I try it in standard_cart...

 

{if $product.pid eq '3'}<h1>test me</h1>{/if}

 

kCzNKit.png

 

are you should the pid value is correct ?

Link to comment
Share on other sites

yes but my product (I'm sure the ID is true) is coming with a one year free domain so the file is configureproductdomain.tpl (I copied it from the standard cart in to our custom order form firectory) that I'm trying to edit. Is that might be related with that?

Link to comment
Share on other sites

yes but my product (I'm sure the ID is true) is coming with a one year free domain so the file is configureproductdomain.tpl (I copied it from the standard cart in to our custom order form firectory) that I'm trying to edit. Is that might be related with that?

oh ok, you should really have included a screenshot so I knew which page you were talking about - I think nearly all of them include <div id="order-standard_cart"> !! :)

 

once you get past the products page, you should be able to use either...

 

{if $pid eq '17'}<h1>test me</h1>{/if}

or

{if $productinfo.pid eq '17'}<h1>test me</h1>{/if}

Link to comment
Share on other sites

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