JQueryTools and Products (and Language)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
bertornot
Forum Members
Forum Members
Posts: 19
Joined: Wed Oct 27, 2010 5:54 am

JQueryTools and Products (and Language)

Post by bertornot »

Hopefully I'm not posting someting that is already described, but I'm really stuck here...

In my Product Details template, I added to the top of the file:

Code: Select all

{JQueryTools action=incjs}
{JQueryTools action=ready}
{literal}
<__script__ type="text/javascript">
jQuery(document).ready(function() {
 jQuery('a.fancybox').fancybox({ 
'zoomSpeedIn': 300, 
'zoomSpeedOut': 300, 
'overlayShow': false 
} );
});
</__script>
{/literal}
One of my Product fields, is displaying an image, using class="subpage fancybox".

Everything OK, however, at the bottom of the page, I use:

Code: Select all

{anchor anchor='product_name' text=$products->Lang('return_to_top') title=$products->Lang('return_to_top')}
For some reason this is displayed as:

Code: Select all

--Add Me - module:JQueryTools string:return_to_top-- 
So it seems that the code is trying to retrieve the 'return_to_top' text from a language file in the JQueryTools module.

Can I override this some way? Or this some bug I have to work around?

Regards,
Bert
Peciura

Re: JQueryTools and Products (and Language)

Post by Peciura »

Use $Products instead of $products in your templates,
or move this line to the very top of your template.

Code: Select all

{assign var='products' value=$mod}
Or this some bug ...
No, it is rather the way templates work.
After you called {JQueryTools} in Products module, variable {$mod} is overwritten and is not an object of Products module, as a result object of JQueryTools is saved to variable {$products}.
bertornot
Forum Members
Forum Members
Posts: 19
Joined: Wed Oct 27, 2010 5:54 am

Re: JQueryTools and Products (and Language)

Post by bertornot »

Thanks Peciura, you're great! Good to have some insight in HOW it actually works... and it is working now!

Regards,
Bert
Post Reply

Return to “Modules/Add-Ons”