Author Topic: Please help with the email order  (Read 314 times)

LyuHr

  • Beginner
  • *
  • Posts: 3
  • A beginner
Please help with the email order
« 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 :(

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9042
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Please help with the email order
« Reply #1 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27502
  • Always on vacation
    • Jenkin Hill Internet
Re: Please help with the email order
« Reply #2 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.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.6.1.10121 on Joomla 3.9.11 PHP 7.0.33
Testing 3.6.1.10129 on Joomla 3.9.11

LyuHr

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: Please help with the email order
« Reply #3 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9042
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Please help with the email order
« Reply #4 on: August 25, 2019, 10:31:44 am »
mail_html_pricelist.php

in the loop
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

LyuHr

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: Please help with the email order
« Reply #5 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9042
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Please help with the email order
« Reply #6 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation