Jump to content

Smarty in tpl modules not working


Recommended Posts

Hi,

I'm new in prestashop developer
I want to modify ps_wirepayment modules, I copy from /modules/ps_wirepayment folder to /themes/mytheme/modules

Then I modify the ps_wirepayment in themes folder

1. payment_return.tpl file
I call $xyz

{l s='New text %s ' sprintf=[$xyz] d='Modules.Wirepayment.Shop'}

2. ps_wirepayment.php , I add xyz to smarty

public function hookPaymentReturn($params)
    {
        

            $this->smarty->assign(array(
                'shop_name' => $this->context->shop->name,
                'total' => Tools::displayPrice(
                    $params['order']->getOrdersTotalPaid(),
                    new Currency($params['order']->id_currency),
                    false
                ),
                'bankwireDetails' => $bankwireDetails,
                'bankwireAddress' => $bankwireAddress,
                'bankwireOwner' => $bankwireOwner,
                'status' => 'ok',
                'reference' => $params['order']->reference,
                'contact_url' => $this->context->link->getPageLink('contact', true),
				'xyz' => 'ok'  # New Smarty Here
            ));
        } else {
            $this->smarty->assign(
                array(
                    'status' => 'failed',
                    'contact_url' => $this->context->link->getPageLink('contact', true),
                )
            );
        }

        return $this->fetch('module:ps_wirepayment/views/templates/hook/payment_return.tpl');
    }

The edited tpl show in www.mysite.com/order-confirmation but not showing $xyz variables

What I missed?

I already disabled smarty cache in BO > performance and delete cache folder in public_html/var



Thank you, sorry my english not good

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

  • razaro changed the title to Smarty in tpl modules not working

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