Skip to main content

Putting tracking cookies into the comfirmaion page

More
15 years 4 months ago #15949 by ecomian
I am not a programer (that is why I am using CMS) but I can figure some things out by logicaly examining some things. I have code from Get Price Shopping comparison site as follows:

<!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src=" secure.getprice.com.au/affsale.asp?shopi...3&price=400&sid=1981 ">
<!-- End Getprice.com.au -->

with the following notes

In red is your shop id number in our system (1403)
In green [400] is the price of the product (this should be entered by your system dynamically for each product)
In orange [1981]is the sale id in your system (this should be entered by your system)

I have read the posts on intergrating third party tracking and discovered where to put it, display/views/***_end. I figured out that files in there such as cart.end or creditcard.end are what I am looking for.

My problem is that I don't know how to dynamically enter product price and how to get the system to enter the sale ID. What is the simplest way I can achieve this? Is there a plug in or somthing that wil do it for me that is not specific for a particular afilitate company or shopping comparison site? I use serveral comparision sites. My level of understanding is a bit below the above mentioned post.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16001 by nicolas
You will have to load the order information like that:

$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);

The total will be in : $order->full_total->prices[0]->price_value_with_tax
The order number will be in: $order->order_number

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16052 by ecomian
So would the following be OK:

<!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src=" secure.getprice.com.au/affsale.asp?shopid=1403&$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);price=$order->full_total->prices[0]->price_value_with_tax&sid=$order->order_number">
<!-- End Getprice.com.au -->

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16058 by nicolas
No no, you can't add PHP code in the middle of HTML code...

You need to have something like that:

<?php
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);
?>
<!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src="secure.getprice.com.au/affsale.asp?shopid=1403&price=<?php echo $order->full_total->prices[0]->price_value_with_tax; ?>&sid=<?php echo $order->order_number; ?>">
<!-- End Getprice.com.au -->

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16117 by ecomian
I have put the code you suggested in at the end of my checkout/end.php file as shown in the first screen shot in the attached file. I was using the / banktransfer_end.php but it didn't show up in the source code view of the thank you page so I reread a post pointing me to the end.php file.
However I when I do a purchase using check as a payment I am brought to a page shown in the second screen shot in the attached file.
The source code is shown in the 3rd screen shot in the attached file.

This attachment is hidden for guests.
Please log in or register to see it.



It seems to mess up the check out process.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16126 by nicolas
It's normal that it doesn't work. You shouldn't put the first <?php if you're putting the code just after PHP code. Only if you put it after HTML do you need it.

$order_id has to come from somewhere... You can't just use it within retrieving it...
You can retrieve the $order_id like below BEFORE loading the order information:

$app =& JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16199 by ecomian
Yes my igorance is showing, but I changed my checkout / end.php file to shown at end of post to include the retrieve instruction you gave me. I am getting the following in the thank you page source codes


<br/><br/>Do not forget to include the order number ( Y21 ) in the comments of the bank transfer so that we can match it to your order.<br/>Thank you for your purchase. </span>
</div><!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src="/secure.getprice.com.au/affsale.asp?shopid=1403&price=&sid=Y21">
<!-- End Getprice.com.au --></div>
<div class="clear_both"></div>


Order id is working, now what do I put in to retrieve the price?

Entire code of display/views/checkout / end.php page:-

<?php
/**
* @package HikaShop for Joomla!
* @version 1.4.7
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/

$app =& JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');

defined('_JEXEC') or die('Restricted access');
?>
<?php
if(empty($this->html)){
echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
echo $this->html;
}


$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);
?>
<!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src="secure.getprice.com.au/affsale.asp?shopid=1403&price=<?php echo $order->full_total->prices[0]->price_value_with_tax; ?>&sid=<?php echo $order->order_number; ?>">
<!-- End Getprice.com.au -->

Thank you for your assistance and patience.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16206 by nicolas
You should change the code:
$order->full_total->prices[0]->price_value_with_tax;
by:
$order->order_full_price;

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago - 15 years 4 months ago #16275 by ecomian
Success! I think I am getting the idea. thank you very much. I have applied the same code to my shopping with success.
Im just trying to get the code for shopping.com. They use a java script as follows, I have modified as much as I know how to:

<script language="JavaScript">
var merchant_id = '467918'
var order_id =<?php echo $order->order_number; ?>
var order_amt =<?php echo $order->order_full_price; ?>
var category_id = 'PUT_YOUR_DATA_HERE'
var category_name = 'PUT_YOUR_DATA_HERE'
var product_id = 'PUT_YOUR_DATA_HERE'
var product_name = 'PUT_YOUR_DATA_HERE'
</script>
<script language="JavaScript" src=" stat.DealTime.com/ROI/ROI.js?mid=467918 ">

I don't know what catagory and products etc are called in your system. What do I put in the 'PUT_YOUR_DATA_HERE' spots?

I have put the above code without the lines with 'PUT_YOUR_DATA_HERE' and it is showing up in the final page source code, so far so good.

Thank you for your help.
Last edit: 15 years 4 months ago by ecomian.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16286 by nicolas
What happens when you have several products in the cart ?

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16354 by ecomian
test ordered differant products and a differant number of each using bank dep with the following result show in the source code of the final page:

Once we receive it, we will confirm your order.<br/>Do not forget to include the order number ( B2F8 ) at the back of the check so that we can match it to your order.<br/>Thank you for your purchase. </span>
</div><!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src="/secure.getprice.com.au/affsale.asp?shopid=1403&price=356.40000&sid=B2F8">
<!-- End Getprice.com.au -->


<!--MyShopping.com.au Code for Purchase Conversion Page -->

<img height=0 width=0 src=" www.myshopping.com.au/sale.asp?mid=470&a...356.40000&order=B2F8 ">

<!-- End MyShopping.com.au -->


<script language="JavaScript">
var merchant_id = '467918'
var order_id =B2F8var order_amt =356.40000</script>
<script language="JavaScript" src=" stat.DealTime.com/ROI/ROI.js?mid=467918 ">

<div class="clear_both"></div>
<!-- HikaShop Component powered by www.hikashop.com -->
<!-- version Starter : 1.4.7 -->
<div class="ortason">
<div class="bannergroup">

</div>

It's returning the cart total amount and order No. OK.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16355 by nicolas
No that's no what I mean. You want to fill that:
var category_id = 'PUT_YOUR_DATA_HERE'
var category_name = 'PUT_YOUR_DATA_HERE'
var product_id = 'PUT_YOUR_DATA_HERE'
var product_name = 'PUT_YOUR_DATA_HERE'

But that's not possible once a customer has more than 1 product in his cart. So there is no solution if you allow your users to buy more than 1 product at once since your javascript doesn't allow more than 1 product information to be entered...

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago - 15 years 4 months ago #16356 by ecomian
Thank you for your prompt reply.
OK so it is not possible to use their script beyond what I have done because obviously we would not want to limt the customer to only one product in his cart. I still will be able to track which comparison site campain give me the best results so that should be enough.

I just did a test on the paypal payment and found that the page source I was returned to from paypal did not have the traking code on it. I noticed it returned me to a https:// address. I don't know if this has any bearing on anything.

Thanks for the help.
Last edit: 15 years 4 months ago by ecomian.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16357 by ecomian
I found I needed to put the code in after_end.php making it appear, however it will not return the order no or price as follows:

</div>
<!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src="/secure.getprice.com.au/affsale.asp?shopid=1403&price=&sid=">
<!-- End Getprice.com.au -->


<!--MyShopping.com.au Code for Purchase Conversion Page -->

<img height=0 width=0 src=" www.myshopping.com.au/sale.asp?mid=470&amount=&order= ">

<!-- End MyShopping.com.au -->


<script language="JavaScript">
var merchant_id = '467918'
var order_id =var order_amt =</script>
<script language="JavaScript" src=" stat.DealTime.com/ROI/ROI.js?mid=467918 ">
<!-- version Starter : 1.4.7 -->
<div class="ortason">
<div class="bannergroup">

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16359 by nicolas
When you use an online payment method, you indeed need to put the code in after_end. But you can't use:
$app =& JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');

and need to use instead:
$order_id = JRequest::getInt('order_id');

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #16400 by ecomian
All good. It's all working now.

Thank you again

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #17357 by ecomian
As I continue to test my paypal payment I find that after doing a test purchase I am returned from Paypal to:

alnaturalhealth.com/index.php?tx=9C19864...h&form_charset=UTF-8

Which is showing a blank page.

This is my after_end.php file:

<?php
/**
* @package HikaShop for Joomla!
* @version 1.4.7
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/

$order_id = JRequest::getInt('order_id');

defined('_JEXEC') or die('Restricted access');

?>
<?php
if(empty($this->html)){
echo JText::_('THANK_YOU_FOR_PURCHASE'. Your transaction has been completed, and a receipt for your purchase has been emailed to you. You may log into your account at www.paypal.com/au to view details of this transaction. );
}else{
echo $this->html;
}

$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);
?>

<!-- Getprice.com.au sales tracking system -->
<img height="1" width="1" border="0"src="secure.getprice.com.au/affsale.asp?shopid=1403&price=<?php echo $order->order_full_price; ?>&sid=<?php echo $order->order_number; ?>">
<!-- End Getprice.com.au -->


<!--MyShopping.com.au Code for Purchase Conversion Page -->

<img height=0 width=0 src=" www.myshopping.com.au/sale.asp?mid=470&amount= order_full_price; ?>&order=order_number; ?>">

<!-- End MyShopping.com.au -->

<script language="JavaScript">
var merchant_id = '467918'
var order_id =<?php echo $order->order_number; ?>
var order_amt =<?php echo $order->order_full_price; ?>
</script>
<script language="JavaScript" src=" stat.DealTime.com/ROI/ROI.js?mid=467918 ">


If someone can tell me where I am going astray it would be greatly appreciated.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #17358 by nicolas
It displays a blank page because you have an error in your code.If you activate the display_errors option of your php.ini you will see what is the error.

I see that you don't have quotes for your message:
echo JText::_('THANK_YOU_FOR_PURCHASE'. Your transaction has been completed, and a receipt for your purchase has been emailed to you. You may log into your account at www.paypal.com/au to view details of this transaction. );

It should be:
echo JText::_('THANK_YOU_FOR_PURCHASE'). ' Your transaction has been completed, and a receipt for your purchase has been emailed to you. You may log into your account at www.paypal.com/au to view details of this transaction.';

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #17401 by ecomian
OOPS I knew I must have missed something simple.

Thank you All fixed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.278 seconds
Powered by Kunena Forum