News:

Looking for documentation? Take a look on our wiki

Main Menu

Please help with the email order

Started by LyuHr, August 23, 2019, 22:33:41 PM

Previous topic - Next topic

LyuHr

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 :(

GJC Web Design

QuoteHi, 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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

LyuHr

Quote from: GJC Web Design on August 24, 2019, 10:10:21 AM
QuoteHi, 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

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

LyuHr

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

GJC Web Design

there is already the loop in mail_html_pricelist.php getting $item

you then find the stock there
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation