Author Topic: Payment method in order confirmation e-mail  (Read 2872 times)

gba

  • Jr. Member
  • **
  • Posts: 330
Payment method in order confirmation e-mail
« on: April 13, 2015, 17:22:40 pm »
Hi all!

Does anyone have an idea, how to achieve that:
I want to display the payment method name, description and info in the order confirmation e-mail.
But: The only data I have in the order details object is the virtuemart_paymentmethod_id.

Thank you very much for any useful hint!

Kind regards,
Gerald

gba

  • Jr. Member
  • **
  • Posts: 330
Re: Payment method in order confirmation e-mail
« Reply #1 on: April 15, 2015, 11:24:20 am »
Hello all!

Seems as this would be a bit difficult...
I found out, there is also a field paymentName in the order details object, containing HTML code for payment method name and description (@VM team: a bit dirty hugh? ;) ).
Out of this HTML code I extracted the payment method name.
Also dirty - but it works for me :)

Any cleaner suggestions are very welcome!

Best regards,
Gerald

antonino78

  • Jr. Member
  • **
  • Posts: 130
Re: Payment method in order confirmation e-mail
« Reply #2 on: April 15, 2015, 11:27:46 am »
Hello,
Also I have the same problem.
Do you mind indicate how you solved?

gba

  • Jr. Member
  • **
  • Posts: 330
Re: Payment method in order confirmation e-mail
« Reply #3 on: April 15, 2015, 11:36:42 am »
Hi!

Code: [Select]
$tmp = $this->orderDetails['paymentName']; //contains string '<span class="vmpayment_name">Name</span><span class="vmpayment_description">Description</span>
$startpos = strpos($tmp,">") + 1;
$stoppos = strpos($tmp,"<",$startpos);
echo substr($tmp,$startpos,$stoppos - $startpos);
Very dirty though...  ;)

Kind regards,
Gerald

gba

  • Jr. Member
  • **
  • Posts: 330
Re: Payment method in order confirmation e-mail
« Reply #4 on: September 29, 2016, 15:26:47 pm »
Any cleaner suggestions are very welcome!

Kind regards,
Gerald

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10303
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Payment method in order confirmation e-mail
« Reply #5 on: September 30, 2016, 17:27:56 pm »
In VM3.0.18 ( IMHO many vers before) the full info is in the email

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

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3733
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Payment method in order confirmation e-mail
« Reply #6 on: September 30, 2016, 19:05:28 pm »
Hello GJC

You are right, the full info is in the e-mail. But breaking it apart and getting the string vmCartPaymentLogo, payment_name, payment_description and payment_info You have to add something like that gba suggests.
Just printing out $this->orderDetails['paymentName'] gives the whole shebang. Omitting or rearranging is impossible without breaking the tagged html string apart.

If You have a better idea extracting the data, please suggest :)

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10303
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Payment method in order confirmation e-mail
« Reply #7 on: September 30, 2016, 20:56:36 pm »
yes.. true .. the whole thing is simply stored in the DB order

perhaps to make it easier just over ride the protected function renderPluginName ($plugin) in what ever payment you use then u can control how the name etc is made up and stored

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