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
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);
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
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
And can be there any troubles when I will use $item->product_in_stock?
It should work for your email. I do not why it shouldn't.
Jörgen @ Kreativ Fotografi
Thanks all, it works prefectly.