VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: YodaStudio on June 04, 2018, 19:58:09 PM

Title: [VM 3.2.14] Customizing order e-mail confirmation
Post by: YodaStudio 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.

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.
Title: Re: [VM 3.2.14] Customizing order e-mail confirmation
Post by: Studio 42 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.

Title: Re: [VM 3.2.14] Customizing order e-mail confirmation
Post by: YodaStudio 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.