Author Topic: Get Order Number, Payment Name, order total in orderdone.php  (Read 712 times)

leoalv

  • Beginner
  • *
  • Posts: 10
Get Order Number, Payment Name, order total in orderdone.php
« on: April 10, 2021, 04:36:04 am »
Hi, I am trying to get the order_number, payment_name and order total in orderdone.php, I have tried several ways, for example doing a
Code: [Select]
var_dump($this);
// and
VmModel::getModel('orders');
in both cases return null or empty results.

What am I doing wrong or what is the way to go?

I know that $this->html shows us those values, but it shows it formatted with html, I need to access them individually to use them in if() conditions.

I have tested on Joomla 3.9.19, Joomla 3.9.25, Virtuemart 3.8.8 10472, PHP 7.3.21, database 5.7.23

Thanks in advance.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3450
  • VirtueMart Version: 3.8.9
Re: Get Order Number, Payment Name, order total in orderdone.php
« Reply #1 on: April 10, 2021, 09:55:24 am »
Regards
A

Joomla 3.9.26
php 7.4

leoalv

  • Beginner
  • *
  • Posts: 10
Re: Get Order Number, Payment Name, order total in orderdone.php
« Reply #2 on: April 13, 2021, 05:09:22 am »
I am testing with the core orderdone.php file, the plugins all work differently, so I would like to know if there is any way to obtain the data I request

Thanks.

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 738
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always latest
Re: Get Order Number, Payment Name, order total in orderdone.php
« Reply #3 on: April 13, 2021, 23:39:25 pm »
The contents displayed in the order confirmation page is controlled by payment plugins. orderdone.php is not always the order confirmation page. For example, if you use PayPal Standard then orderdone.php is used for redirection and order confirmation page is displayed by - components/com_virtuemart/views/pluginresponse/tmpl/default.php

For standard VirtueMart payment plugin the order confirmation contents are displayed using - plugins/vmpayment/standard/standard/tmpl/post_payment.php

for PayPal Standard the order confirmation contents are displayed using - plugins/vmpayment/paypal/paypal/tmpl/stdresponse.php

and so on.. It is different for every payment methods.

Take look at VP Conversion Tracking plugin - https://www.virtueplanet.com/extensions/vp-conversion-tracking It allows you to have common thank you page for all payment methods and you can also access the order details in the thank you page. It also have many other features. Please go through the list of features.


Disclaimer: I am the developer of this plugin.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3450
  • VirtueMart Version: 3.8.9
Re: Get Order Number, Payment Name, order total in orderdone.php
« Reply #4 on: April 14, 2021, 10:02:53 am »
As Jumbo says

The payment plugin controls the data that is passed to their specific view handling.  There is nothing in orderdone for you to "grab" unless you provide it

If you had told me your payment plugins as I asked - I could probably have suggested a method/s

Regards
A

Joomla 3.9.26
php 7.4