News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Mail setting according product status not working

Started by psm, July 29, 2018, 20:24:33 PM

Previous topic - Next topic

psm

Hello,
I am trying to set up messages which will be sent to customer after status of order will be changed (for example pending status).
And I use these two conditions in mail_html_shopper.php:

if (($this->product->product_in_stock) < 1) {
if (($this->product->product_in_stock) >= 1) {

But it is not working. When I use echo to show value of product stock, it shows nothing.

Please could you help me with this problem?

Thanks

Studio 42

Are you sure that $this->product exist ?
The lood to get product in items list is :
foreach($this->orderDetails['items'] as $item) {

}
$item->product_in_stock can give you the result. But you should use a plugin and not check here the result.
You can use a shipment plugin and trigger function plgVmOnUpdateOrderShipment'(&$data,$old_order_status);

psm

Thank you, I do not have so many skills with virtuemart and php programming. Could you please explain me how to get product stock info from this function plgVmOnUpdateOrderShipment'?

Thanks

Jörgen

plgVmOnUpdateOrderShipment is not a function that gives You any feedback. It is a function that gets triggered in a plugin för virtuemart shipment. Writing a plugin is not very hard, but needs some programming skills.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

psm

And can be there any troubles when I will use $item->product_in_stock?

Jörgen

It should work for your email. I do not why it shouldn't.
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

psm