VirtueMart Forum

VirtueMart 2 + 3 => Administration & Configuration => Topic started by: LyuHr on August 23, 2019, 22:33:41 pm

Title: Please help with the email order
Post by: LyuHr on August 23, 2019, 22:33:41 pm
Hi, i`m new in joomla virtuemart. I use joomla 3.4.1 and VM 3.0.6.2
Please help me with the mail order confirm. I want to add in stock field in the order template mail. I try to add  <div class="is-in-stock" >  In Stock :  <?php echo $this->product->product_in_stock - $this->product->product_ordered ?></div> but nothing :(
Title: Re: Please help with the email order
Post by: GJC Web Design on August 24, 2019, 10:10:21 am
Quote
Hi, i`m new in joomla virtuemart. I use joomla 3.4.1 and VM 3.0.6.2

why then use wildly out of date versions?

if u mean in an over ride to components\com_virtuemart\views\invoice\tmpl\mail_html_pricelist.php
there is no $this->product

you would probably need to do it in the loop and get the product details with

$model = VmModel::getModel('product');
$product = $model->getProductSingle($item->virtuemart_product_id,false);

and get the stock details there
Title: Re: Please help with the email order
Post by: jenkinhill on August 24, 2019, 12:00:20 pm
No Joomla version before 3.9.10 is secure for use on a live website.
VirtueMart 3 versions before 3.2.14 are insecure and cannot be recommended for use on live sites.
Title: Re: Please help with the email order
Post by: LyuHr on August 25, 2019, 02:02:19 am
Quote
Hi, i`m new in joomla virtuemart. I use joomla 3.4.1 and VM 3.0.6.2

why then use wildly out of date versions?

if u mean in an over ride to components\com_virtuemart\views\invoice\tmpl\mail_html_pricelist.php
there is no $this->product

you would probably need to do it in the loop and get the product details with

$model = VmModel::getModel('product');
$product = $model->getProductSingle($item->virtuemart_product_id,false);

and get the stock details there
Okay, can i use this in mail_html_vendor.php ?
I want to show in my email InStock quantity
Title: Re: Please help with the email order
Post by: GJC Web Design on August 25, 2019, 10:31:44 am
mail_html_pricelist.php

in the loop
Title: Re: Please help with the email order
Post by: LyuHr on August 25, 2019, 20:06:59 pm
okay, if i understand right, first i need to do loop and get the product details  in mail_html_pricelist.php with

$model = VmModel::getModel('product');
$product = $model->getProductSingle($item->virtuemart_product_id,false);

and than how to show it in email order confirm in this file mail_html_vendor.php
Title: Re: Please help with the email order
Post by: GJC Web Design on August 26, 2019, 10:16:01 am
there is already the loop in mail_html_pricelist.php getting $item

you then find the stock there