MyFavorites collision with Products - TIP

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
otsakir
Forum Members
Forum Members
Posts: 17
Joined: Wed Mar 07, 2012 4:26 pm

MyFavorites collision with Products - TIP

Post by otsakir »

In case anyone tries to use My Favorites module to mark Products, the following issue may come up:
If

Code: Select all

{MyFavorites srcmodule="Products" srcrecord=$entry->id}
is used inside a product details template a 'smarty namespace' variable collision seems to occur. The variable '$category' is produced by both the Products and MyFavorites modules preventing correct rendering of the page.

A quick workaround would be to to "unset" the Products' $category after it is used in the detail template and before invoking {My Favorites ...} tag so that its own version of $category can be freely set.

Here is an example 'clear_assign' UDT to be used for that purpose:

Code: Select all

$smarty = cmsms()->GetSmarty();
$smarty->clear_assign($params['var']);
Before invoking MyFavorites include this UDT like this:
{clear_assign var='category'}
Post Reply

Return to “Modules/Add-Ons”