VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: roman5527 on January 12, 2020, 15:23:44 PM

Title: Two standard payment method with different text
Post by: roman5527 on January 12, 2020, 15:23:44 PM
Hi, i need two standard payment methods but with different text after send order.

ho i can do it ? thanks.
Title: Re: Two standard payment method with different text
Post by: jjk on January 12, 2020, 17:14:56 PM
Not sure if that is what you want, but you can add any text (including html code) into the payment description text field. The payment description is included in the order emails.
Title: Re: Two standard payment method with different text
Post by: pinochico on January 12, 2020, 18:30:15 PM
We use Virtuemart Mailing Manager for this:

- setup rules and create different templates
or
- use conditional content in one template for customer email
Title: Re: Two standard payment method with different text
Post by: GJC Web Design on January 12, 2020, 19:22:31 PM
or just detect the payment id in orderdone.php and switch what ever message applies by php
Title: Re: Two standard payment method with different text
Post by: roman5527 on January 13, 2020, 18:17:59 PM
Hi, GJC Web Design .

i cant edit it in plugins/vmpayment/standard/standard/tmpl/post_payment.php ???? because in this file is text for order done for this payment method.

and how i detect payment id please ?

thanks
Title: Re: Two standard payment method with different text
Post by: GJC Web Design on January 13, 2020, 19:41:11 PM
there or in orderdone

see what is in  $viewData -- if your lucky the payment method ID -- if not you have to find some other method to find the ID
Title: Re: Two standard payment method with different text
Post by: roman5527 on January 15, 2020, 16:33:42 PM
Hi, thanks.

$viewData contains payment_name .
if someone needed, my code in plugins/vmpayment/standard/standard/tmpl/post_payment.php is :

<?php 

$dobierka 
'Dobierka';
$meno_platby $viewData["payment_name"];
$meno_platby2 strpos($meno_platby$dobierka);

?>




<?php 
if ($meno_platby2 === false) {
?>

<div style="width:100%;">
<?php echo '<div style="color:#32a840;width:100%;font-size:16px;">'vmText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU_TEXT1_PREVOD_NA_UCET').'</div>'?>
<?php echo '<div style="color:#32a840;margin-bottom:20px;width:100%;font-size:16px;">'vmText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU_TEXT2_PREVOD_NA_UCET').'</div>'?>
</div>

<?php } else { ?>

<div style="width:100%;">
<?php echo '<div style="color:#32a840;width:100%;font-size:16px;">'vmText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU_TEXT1').'</div>'?>
<?php echo '<div style="color:#32a840;margin-bottom:20px;width:100%;font-size:16px;">'vmText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU_TEXT2').'</div>'?>
</div>
<?php ?>