Author Topic: [VM 3.2.14] Customizing order e-mail confirmation  (Read 103 times)

YodaStudio

  • Beginner
  • *
  • Posts: 24
  • A beginner
    • YODA Studio
  • VirtueMart Version: 3.0.18
[VM 3.2.14] Customizing order e-mail confirmation
« on: June 04, 2018, 19:58:09 pm »
Hello everybody.

I'm trying to edit the e-mail template in order to hide shipping and payment methods descriptions, I just want to show their name.
It should be the /components/com_virtuemart/views/invoice/view.html.php file and this should be the code that handle shipping and payment methods names and descriptions.

Code: [Select]
if (empty($orderDetails['shipmentName']) ) {
    if (!class_exists('vmPSPlugin')) require(VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php');
    JPluginHelper::importPlugin('vmshipment');
    $dispatcher = JDispatcher::getInstance();
    $returnValues = $dispatcher->trigger('plgVmOnShowOrderFEShipment',array(  $orderDetails['details']['BT']->virtuemart_order_id, $orderDetails['details']['BT']->virtuemart_shipmentmethod_id, &$orderDetails['shipmentName']));
}

if (empty($orderDetails['paymentName']) ) {
    if(!class_exists('vmPSPlugin')) require(VMPATH_PLUGINLIBS.DS.'vmpsplugin.php');
    JPluginHelper::importPlugin('vmpayment');
    $dispatcher = JDispatcher::getInstance();
    $returnValues = $dispatcher->trigger('plgVmOnShowOrderFEPayment',array( $orderDetails['details']['BT']->virtuemart_order_id, $orderDetails['details']['BT']->virtuemart_paymentmethod_id,  &$orderDetails['paymentName']));

}

I did some editing but since I'm not a skilled programmer I got nothing. What should I do to have only shipping and payment names shown in the confirmation e-mails?

Thanks.
-- Do. Or do not. There is no try. --

www.yodastudio.com

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3028
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: [VM 3.2.14] Customizing order e-mail confirmation
« Reply #1 on: June 05, 2018, 01:13:56 am »
&$orderDetails['paymentName'] get info form Table plugin directly, so it's not so easy to change
See function getOrderMethodNamebyOrderId in yousite\administrator\components\com_virtuemart\plugins\vmpsplugin.php
If you need to remove the image, you can search for img Tag and use PHP function str_replace and strpos or strip_tags for eg. to remove it.


YodaStudio

  • Beginner
  • *
  • Posts: 24
  • A beginner
    • YODA Studio
  • VirtueMart Version: 3.0.18
Re: [VM 3.2.14] Customizing order e-mail confirmation
« Reply #2 on: June 05, 2018, 08:41:25 am »
Hi Studio 42, I know what you mean.
I think I'll leave it the way it is.

Thanks.
-- Do. Or do not. There is no try. --

www.yodastudio.com