- Posts: 6
- Thank you received: 0
Need to put code on the Thank-you page
12 years 9 months ago #141776
by Jojo
Need to put code on the Thank-you page was created by Jojo
-- HikaShop version -- : latest (Starter)
-- Joomla version -- : 3.2.1
-- PHP version -- : 5.3.28
Hi there,
I need help again. I need to put a tracking-code on the last checkout-page, after a sale is complete. This thread didn't work.
What I have done already:
- I have put my code in the checkout/end.php --> no success
- I've put it in /administrator/components/com_hikashop/extensions/plg_hikashoppayment_banktransferbanktransfer_end.php --> no success
This is the code in the end.php, which I've modified:
Tracking-code doesn't work. Even "Hello World..." isn't printed...
Any suggestions what's wrong here or which file I have to modifiy??
Thanks a lot in advance!!
-- Joomla version -- : 3.2.1
-- PHP version -- : 5.3.28
Hi there,
I need help again. I need to put a tracking-code on the last checkout-page, after a sale is complete. This thread didn't work.
What I have done already:
- I have put my code in the checkout/end.php --> no success
- I've put it in /administrator/components/com_hikashop/extensions/plg_hikashoppayment_banktransferbanktransfer_end.php --> no success
This is the code in the end.php, which I've modified:
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.2.3
* @author hikashop.com
* @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->html)){
echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
echo $this->html;
}
<?php
$ad_ordernumber = $this->order_number;
$ad_net_amount_step = $this->amount;
$ad_net_amount = round($ad_net_amount/1.19);
echo 'Hello Test-World. Say something!!</br>';
echo $ad_net_amount;
?>
<!-- Trackingcode -->
<script type="text/javascript" src="//www.xxxxxxx.com/js/jsadlib.js"></script>
<script type="text/javascript">
Aff.user.track({
'eventid' : 12345,
'referenz' : '<?php echo $ad_ordernumber; ?>',
'betrag' : <?php echo $ad_net_amount; ?>,
'pid' : 12345
});
</script>
<noscript>
<img src="//www.xxxxxxx.com/event.php?pid=12345&eventid=4454&referenz=<?php echo $ad_ordernumber; ?>&betrag=<?php echo $ad_net_amount; ?>" border="0" width="1" height="1">
</noscript>
$this->nextButton = false;
Tracking-code doesn't work. Even "Hello World..." isn't printed...
Any suggestions what's wrong here or which file I have to modifiy??
Thanks a lot in advance!!
Please Log in or Create an account to join the conversation.
12 years 9 months ago #141787
by Jojo
Replied by Jojo on topic Need to put code on the Thank-you page
It's me again...
Okay I got it. It's the checkout/end.php file and modifications are only visible when editing via views -> display -> end.php
But my code causes errors. I need the order-number and the net-amount as a variable. As I wrote, I tried to fetch the values like this:
$ad_ordernumber = $this->order_number;
$ad_net_amount_step = $this->amount;
This does not work. Anybody knows, how to catch the order-number and the net-amount?
Okay I got it. It's the checkout/end.php file and modifications are only visible when editing via views -> display -> end.php
But my code causes errors. I need the order-number and the net-amount as a variable. As I wrote, I tried to fetch the values like this:
$ad_ordernumber = $this->order_number;
$ad_net_amount_step = $this->amount;
This does not work. Anybody knows, how to catch the order-number and the net-amount?
Please Log in or Create an account to join the conversation.
12 years 9 months ago #141788
by Jojo
Replied by Jojo on topic Need to put code on the Thank-you page
Now I tried this (end.php):
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);
echo 'Total:</br>';
echo $order->full_total->prices[0]->price_value_with_tax;
echo 'Order number:</br>';
echo $order->order_number;
What's wrong here?
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);
echo 'Total:</br>';
echo $order->full_total->prices[0]->price_value_with_tax;
echo 'Order number:</br>';
echo $order->order_number;
What's wrong here?
Please Log in or Create an account to join the conversation.
12 years 9 months ago - 12 years 9 months ago #141838
by nicolas
Replied by nicolas on topic Need to put code on the Thank-you page
Hi,
You should use such code in the end file:
You should use such code in the end file:
Code:
$order_id = JRequest::getInt('order_id');
if(empty($order_id)){
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
}
$order =null;
if(!empty($order_id)){
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
echo 'Total:</br>';
echo $order->order_full_price;
echo 'Order number:</br>';
echo $order->order_number;
}
Last edit: 12 years 9 months ago by nicolas.
The following user(s) said Thank You: Jojo
Please Log in or Create an account to join the conversation.
12 years 9 months ago #141889
by Jojo
Replied by Jojo on topic Need to put code on the Thank-you page
Nicolas, thanks a lot! That's it.
Just to understand, I need to initiate the classes via the function JRequest::getInt() and JFactory::getApplication()?!
Well, however, everything works fine now, an I'll switch over from "play mode" to serious business. After setting up the shop and creating all the products, I'll upgrade to business version. Your support is great, so I feel comfortable here, just for the event something's crashing!!
Thanks and have a nice weekend
Just to understand, I need to initiate the classes via the function JRequest::getInt() and JFactory::getApplication()?!
Well, however, everything works fine now, an I'll switch over from "play mode" to serious business. After setting up the shop and creating all the products, I'll upgrade to business version. Your support is great, so I feel comfortable here, just for the event something's crashing!!
Thanks and have a nice weekend
Please Log in or Create an account to join the conversation.
12 years 9 months ago #141976
by nicolas
Replied by nicolas on topic Need to put code on the Thank-you page
Yes, the variables need to be initialized before you use them.
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds