Jump to content

Prestashop 1.6 adding class nd controller overrides to a themes folder structure


Recommended Posts

Hi,

 

I have a prestashop 1.6.x solution, i use a customized theme (based on the default-bootstrap theme) for all my customizations.

I've been customizing emails, and ran into issues with the shipping emails not containing the substituion values i need.

in order to add the additional substitutions, i've made an override to the /classes/order/OrderHistory.php file similar to the code below;

<?phpclass OrderHistory extends OrderHistoryCore{    public function addWithemail($autodate = true, $template_vars = false, Context $context = null)    {        if (!$context)            $context = Context::getContext();        $order = new Order($this->id_order);        $data = array(            '{payment}' => Tools::substr($order->payment, 0, 32),        );        if ($template_vars)            $data = array_merge($data, $template_vars);        return parent::addWithemail($autodate, $data, $context);    }}
	

 

ive placed this file (OrderHistory.php) in

/themes/my-theme-folder/override/classes/order/

 

but it seems to not work

I've cleared cache, and this makes no difference.

Is there something wrong with the folder structure i've used ?

 

Best Regards

 

OhmegaStar

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