How to link out-of-stock or low-stock items to admin end?
Hi,
When we have items that are low in stock or out-of-stock, we can emails to let us know that that item is low or out of stock. In XC5.3, the email contains a link that took us to the Admin Back-end so we can update the quantity, delete, or disable the product. However, we just upgraded to XC5.4, and the link now takes us (unhelpfully) to the customer front-end. What can we do to change it so that it can take us to Admin Back-end, just like how it was with XC5.3? Thank you in advance. John |
Re: How to link out-of-stock or low-stock items to admin end?
You can decorate classes/XLite/View/Product/MailBox.php class and modify
Code:
protected function getDefaultProductURLProcessor() or Code:
protected function getProductURL() to return admin side url for the product. The way this is now it will almost always return the storefront url because the warning is usually called from the storefront due to product getting low stock after order placement. You can decorate the getProductURL like this Code:
/** This is untested |
Re: How to link out-of-stock or low-stock items to admin end?
Hi Steve,
Thank you for that. It is a pity that we don't know what the code is and where it resides in the XC5.3. That code could then be replicated in XC5.4. We will keep looking. Thanks again. Cheers, John |
Re: How to link out-of-stock or low-stock items to admin end?
Hi,
I'm told that the code that needs to be changed is in /admin.php?target=theme_tweaker_template&template=m ail%2Fcommon%2Flow_limit_warning%2Fbody.twig&inter face=mail&innerInterface=admin (i.e. mail/common/low_limit_warning/body.twig). Below is the current XC5.4 code that takes me to the customer front-end: {{ widget('\\XLite\\View\\Product\\MailBox', product=this.product, productUrlProcessor=this.product_url_processor, amount=this.amount) }} Does anyone know how to change this code to take me to the Admin Back-End? (I'm totally ignorant of code-writing, sorry.) Thank you in advance. Cheers, John |
Re: How to link out-of-stock or low-stock items to admin end?
Don't know if this helps, but in 5.3, that same file looked like this:
Code:
{## |
Re: How to link out-of-stock or low-stock items to admin end?
Hi Paul,
Thank you for that. It almost works as shown in the attached screenshot, but the link does not. But really appreciate your help anyhow. Cheers, John |
All times are GMT -8. The time now is 12:55 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.