News:

Support the VirtueMart project and become a member

Main Menu

[VM 3.2.14] Customizing order e-mail confirmation

Started by YodaStudio, June 04, 2018, 19:58:09 PM

Previous topic - Next topic

YodaStudio

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.
-- Do. Or do not. There is no try. --

www.yodastudio.com

Studio 42

&$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

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