Post by fredJ » Fri Jan 18, 2019 11:19 pm

I have OC 3.0.2.0

Have been trying now for a while to get product IDs from the order email page (catalog/controller/mail/order.php) into order.add.twig
I had this in my old OC so that I could make a href links to products in the order email.

However , no matter what I try, it doesn't seem that my edits to order.php has any effect on the twig file ?! I've tried creating different variables and changing things in the order.php file but nothing changes in order.ord.twig. Is there something I'm missing?

New member

Posts

Joined
Fri Jan 18, 2019 11:10 pm

Post by xxvirusxx » Sat Jan 19, 2019 2:34 am

You have refreshed ocmod, clear SASS cache, theme cache?

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by fredJ » Sat Jan 19, 2019 2:49 am

I have cleared the cache in the dashboard (SASS and themes) But they are not cached anyways. I can edit the twig file and get it to show.

Is there something else?

Am I editing the wrong place?
My order.php contains

class ControllerMailOrder extends Controller {
...
then I change in
line 220 to include "id".

$data['products'][] = array(
'id' => $order_product['order_product_id'],
'name' => $order_product['name'],
'model' => $order_product['model'],
'option' => $option_data,
'quantity' => $order_product['quantity'],
'price' => $this->currency->format($order_product['price'] + ($this->config->get('config_tax') ? $order_product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']),
'total' => $this->currency->format($order_product['total'] + ($this->config->get('config_tax') ? ($order_product['tax'] * $order_product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value'])
);

there is also another section on line 415 where an alert email is sent to the admin but I don't think that is relevant.

then in the twig file I have:
{{ product.id }}

(doesn't seem like it works to click on "code" in the editor. )

---

update.
I just tried renaming order.php in /catalog/controller/mail/order.php to something else... and it still runs !? Is order.php not used?!

Is there some other Cache I need to clear?

---
edit again.
Maybe it is related to an extension I have, "xtensions - Same order email for admin as customer".
Okay I 'll check this first.
:-)
---
OKAY PROBLEM SOLVED.
Sorry I didn't understand how modification works.

New member

Posts

Joined
Fri Jan 18, 2019 11:10 pm
Who is online

Users browsing this forum: lockbox and 97 guests