[Skip to main content](#vessel-content)

#   get order total and id in after\_end

##

- **[wildfire](/forum/user/4403-wildfire "View wildfire's Profile")**
- [![wildfire's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4403.jpg)](/forum/user/4403-wildfire "View wildfire's Profile") Topic Author
- [ Offline](/forum/user/4403-wildfire)
- eCommerce Maven

Less More

- Posts: 60
- Thank you received: 9
-
-
-
- [](http://www.davekarlsven.com)
-

14 years 1 month ago [\#68733](#68733) by [wildfire](/forum/user/4403-wildfire "View wildfire's Profile")  *[get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#68733 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")* was created by *[wildfire](/forum/user/4403-wildfire "View wildfire's Profile")*

I am trying to use a third party affiliate tracking script on hikashop.

I need to get the order id and order total in the script I am putting in the after_end.php override file.

Right now I have the following cod but it is not working:

$order_id = $this-&gt;order-&gt;order_number;
$order_total = $this-&gt;order-&gt;order_full_price;

echo "&lt;script type='text/javascrip' src='//tags.mediaforge.com/js/954/?orderNumber=${order_id}&amp;price=${order_total}'&gt;&lt;/script&gt;"

Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.

---

Ecommerce expert for hire. [ DaveKarlsven.com](http://www.davekarlsven.com)

I love helping businesses make lots of money online.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 1 month ago [\#68886](#68886) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#68886 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")*

That's the correct way of doing it.
Are you sure that you're editing the view file for the correct template ?
Do you have an error ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildfire](/forum/user/4403-wildfire "View wildfire's Profile")**
- [![wildfire's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4403.jpg)](/forum/user/4403-wildfire "View wildfire's Profile") Topic Author
- [ Offline](/forum/user/4403-wildfire)
- eCommerce Maven

Less More

- Posts: 60
- Thank you received: 9
-
-
-
- [](http://www.davekarlsven.com)
-

14 years 1 month ago [\#69724](#69724) by [wildfire](/forum/user/4403-wildfire "View wildfire's Profile")  Replied by *[wildfire](/forum/user/4403-wildfire "View wildfire's Profile")* on topic *[Re: get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#69724 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")*

I just can't get the Order number and order total into the variables for my script. When I run the script I just get the following as a result:

[ tags.mediaforge.com/js/954/?orderNumber=&amp;price=](https://tags.mediaforge.com/js/954/?orderNumber=&price=)

Order Number and Price are blank.

For some reason this is not putting anything in the $order_id field.

By the way, I am using the Authorize.net payment plugin. Would that effect getting the order id and order total in any way?

Do I need to change the way I get the values at the end of the order when using the Authorize.net plugin?

$order_id = $this-&gt;order-&gt;order_number;
$order_total = $this-&gt;order-&gt;order_full_price;

---

Ecommerce expert for hire. [ DaveKarlsven.com](http://www.davekarlsven.com)

I love helping businesses make lots of money online.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 1 month ago [\#69896](#69896) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#69896 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")*

It means that there is no order_id parameter in your after_end URL as it should.
Not usre what you're doing to reach that page.

Anyway, you can try to load the order manually like that:
$app = JFactory::getApplication();
$order_id = $app-&gt;getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$this-&gt;order = $orderClass-&gt;loadFullOrder($order_id);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildfire](/forum/user/4403-wildfire "View wildfire's Profile")**
- [![wildfire's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4403.jpg)](/forum/user/4403-wildfire "View wildfire's Profile") Topic Author
- [ Offline](/forum/user/4403-wildfire)
- eCommerce Maven

Less More

- Posts: 60
- Thank you received: 9
-
-
-
- [](http://www.davekarlsven.com)
-

14 years 2 weeks ago [\#71932](#71932) by [wildfire](/forum/user/4403-wildfire "View wildfire's Profile")  Replied by *[wildfire](/forum/user/4403-wildfire "View wildfire's Profile")* on topic *[Re: get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#71932 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")*

How do we get the Order Subtotal into the url?

This is the code I have thus far but there are Two problems I am still facing. 1. The order full price is still not showing up in my URL, and I don't know how to also get the Order Subtotal (Total Before shipping and taxes) into a variable that I can put into the tracking URL:

Any Help you can give me on the below code to get the Order full price to show up and the order subtotal also into the url, would be really appreciated. (By the way, we are using the Authorize.net payment plugin.)

$app =&amp; JFactory::getApplication();
$app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

$order_id = $app-&gt;getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$this-&gt;order = $orderClass-&gt;loadFullOrder($order_id);

$order_total = $this-&gt;order-&gt;order_full_price;

echo "&lt;script type='text/javascript' src='//tags.mediaforge.com/js/954/?orderNumber=${order_id}&amp;price=${order_total}'&gt;&lt;/script&gt;";

---

Ecommerce expert for hire. [ DaveKarlsven.com](http://www.davekarlsven.com)

I love helping businesses make lots of money online.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 2 weeks ago [\#72142](#72142) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#72142 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")*

1. Try like that:
$this-&gt;order = $orderClass-&gt;loadFullOrder($order_id,true,false);
instead of:
$this-&gt;order = $orderClass-&gt;loadFullOrder($order_id);

2. The subtotal would be:
$this-&gt;order-&gt;order_full_price + $this-&gt;orderorder-&gt;order_discount_price - $this-&gt;orderorder-&gt;order_shipping_price - $this-&gt;orderorder-&gt;order_payment_price

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[happiexy](/forum/user/33007-happiexy "View happiexy's Profile")**
- [![happiexy's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/quiet.jpg)](/forum/user/33007-happiexy "View happiexy's Profile")
- [ Offline](/forum/user/33007-happiexy "I'm a full-stack developer developer from Nairobi Kenya, who just takes longer to get to solutions.  Visit https://patric.xyz for more.  ")
- ^\_^

Less More

- Posts: 15
- Thank you received: 0
-
-
-
- [](http://patric.xyz)
-

9 years 19 hours ago [\#282373](#282373) by [happiexy](/forum/user/33007-happiexy "View happiexy's Profile")  Replied by *[happiexy](/forum/user/33007-happiexy "View happiexy's Profile")* on topic *[Re: get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#282373 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")*

The return is an array or object?

---

![:)](/media/kunena/emoticons/3.png ":)")

fFull-stack

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 10 hours ago [\#282376](#282376) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: get order total and id in after\_end](/forum/4-how-to/68733-get-order-total-and-id-in-after-end#282376 "I am trying to use a third party affiliate tracking script on hikashop.  I need to get the order id and order total in the script I am putting in the after&#95;end.php override file.  Right now I have the following cod but it is not working:  $order&#95;id = $this-&gt;order-&gt;order&#95;number; $order&#95;total = $this-&gt;order-&gt;order&#95;full&#95;price;  echo &quot;&quot;  Any thoughts on what I need to change on my code to get the order id and order total into my script would be great. Thanks.")*

Hi,

$this-&gt;order is an object. You can see a rough example here:
[ www.hikashop.com/support/documentation/156](https://www.hikashop.com/support/documentation/156)
But the best is to do a var_dump/print_r of the variable.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY4NzMzLWdldC1vcmRlci10b3RhbC1hbmQtaWQtaW4tYWZ0ZXItZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.059 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
