Not sure where to post this, but if anyone needs to see the product reference (aka Stock Code) of products for product notifications (MailAlerts) in the back office, this is what I did to add the column to the display:
Find in /modules/mailalerts/mailalerts.php beginning around line 479 within the renderList() function:
I would think this could be created in an override, because updated the module will likely overwrite this file, but I'm still kinda green at extending module classes.
Question
Obi
Not sure where to post this, but if anyone needs to see the product reference (aka Stock Code) of products for product notifications (MailAlerts) in the back office, this is what I did to add the column to the display:
Find in /modules/mailalerts/mailalerts.php beginning around line 479 within the renderList() function:
} else { $listFields = [ 'id_product' => [ 'title' => $this->l('Product ID'), 'type' => 'text', ],
and right after that insert the following code:
'reference' => [ 'title' => $this->l('Stock Code'), 'type' => 'text', 'callback_object' => $this, 'callback' => 'renderProduct' ],
Then within the function getProductsSubscribers() - around line 588 find the following code:
->leftJoin('product_lang', 'pl', 'pl.id_lang = '.$langId.' AND pl.id_product = oos.id_product AND pl.id_shop = oos.id_shop')
and right after that insert the following code:
->leftJoin('product', 'p', 'p.id_product = oos.id_product')
Save, Upload, Clear Cache, Voila!
I would think this could be created in an override, because updated the module will likely overwrite this file, but I'm still kinda green at extending module classes.
Hope someone finds this useful.
3 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now