Jump to content

how to use static method from module in smarty tpl ?


Tone87

Recommended Posts

Hi,

in product.tpl

i wanna use a static method from my module:

public static function getVendite($id_prodotto = '')
{
    if (!empty($id_prodotto)) {
        return 1;
    } else 
        return false;
}

i tried tu use :

{assign var='vendite' value=MyModuleName::getVendite($product.id)}

or 

{$vendite=MyModuleName::getVendite($product.id)}

but not works.

someone can help me how to use a static method of my module in smarty template ?

 

 

Edited by Tone87 (see edit history)
Link to comment
Share on other sites

I don't think its possible to call module static function from product.tpl

You can use displayHook to achieve the same (Call the function in product displayHook & pass the value to tpl) .

If you let us know what you trying to achieve then we can let you know which hooks (Action, Display etc) can be used for the same.

 

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...