Jump to content

How to use a variable from one tpl in another without getting an undefined index error


Henri

Recommended Posts

Hey there;

 

I'm looking to take a variable called $quantity_discount that can be found in:

themename/templates/catalog/_partials/Product-discounts.tpl

And put it in:

themename/templates/catalog/product.tpl

 

However when doing it i get the following error:

ContextErrorException in smarty_internal_templatebase.php(157) : eval()'d code line 311:
Notice: Undefined index: quantity_discount

 

As you may have guessed I'm trying  to show special offers in the catalog page. But i'm also just curious how you are supposed to do this in general for other modifications.

 

Finally, where would be a good lace to learn about this properly? I haven't been able to find any good documentation that is not fragmented or assumes a much higher level of understanding of how this works than i currently have. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...