How to integrate third party tracking system

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #11877

Concerning the authorize.net error, could you try to activate the debug mode ? Then, do an order and look at the payment log file in FTP ?
That should provide more info on the problem.

For the notice: that a problem in the performance_based plugin. The question is, what do you have on the line 15 of that file ?

For the JUser error: Could you do screenshot ?

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12059

nicolas wrote:

Concerning the authorize.net error, could you try to activate the debug mode ? Then, do an order and look at the payment log file in FTP ?
That should provide more info on the problem.


I'll get back to this one if it happens again. I did have the shopping cart in debug mode but I can't see any payment logs?.

For the notice: that a problem in the performance_based plugin. The question is, what do you have on the line 15 of that file ?

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
 
// Import library dependencies
jimport('joomla.plugin.plugin');
 
class plgHikashopNotify_performance_based extends JPlugin{
	function plgHikashopNotify_performance_based(){
		parent::__construct();
		// load plugin parameters
		$this->_plugin = JPluginHelper::getPlugin( 'hikashop', 'notify_perfomance_based' );
		$this->_params = new JParameter( $this->_plugin->params );
	}



	function onAfterOrderUpdate(&$order,&$send_email){
		$config=&hikashop::config();
		$confirmed = $config->get('order_confirmed_status');
		//if order status is not updated skip
		if(!isset($order->order_status)) return true;
		$class = hikashop::get('class.order');
		$dbOrder = $class->get($order->order_id);

For the JUser error: Could you do screenshot ?

Last edit: 14 years 1 month ago by bthayer.

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12069

These problems were caused by your performance based plugin which didn't had a correct constructor. The modification I made to it solved both problems.

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12153

Where is th3e modifications again? I don't see them or my original code above anymore.

Is it OK to use https:// in the curl_init() code?

Last edit: 14 years 1 month ago by bthayer.

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12169

The ones in that post: www.hikashop.com/support/forum/4-how-to/...m.html?lang=en#11818

curl_init should accept https.

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12196

Found out that another cookie called roia_cookie was needed. I added this code to the attached plugin:

File Attachment:

File Name: notify_per...ased.zip
File Size:1 KB

		$roia="";
		if(isset($_COOKIE['roia_cookie']))
			$roia = $_COOKIE['roia_cookie']; 
		else
			return true;


Part of the message is hidden for the guests. Please log in or register to see it.

and added this to my thank-you page (after making my thank-you page my new return page):
<script type="text/javascript">document.write('<input type="hidden" name="roia" value="' + roia_cookie + '">')</script>
(I also learned that my editor strips off script tags :( )
This script is in one of my modules to create the cookie:
<!--ROIA #1205-->
<script type="text/javascript">/*<![CDATA[*/
(function(D,u,q,i,p,c){if(D.cookie){q=D.cookie.split(';');for(i=0;i<q.length;++i)
{p=q[i].split('=',2);if(/^\s*roia1205$/.test(p[0])){c=p[1];break;}}}
if(c){u+=(u.indexOf('?')==-1?'?':';')+'_roia_js_cookie='+c;}
D.write('<'+'script type="text/javascript" src="http'+(/^https:/.test(D.URL)?'s':'')+'://'+u+'"></'+'script>');
})(document,'net.performance-based.com/j/1205');
/*]]>*/</script>
<!--/ROIA #1205-->

My logic must be flawed. i don't think the cookies are persisting through the authorize transaction to the thank you page.

I am trying to figure this out but my skills are nada. :unsure:

P.S.
This error is on all my pages at the top. Will it go away when this is all done?

Notice: Undefined index: QUERY_STRING in /hermes/bosweb25b/b706/ipg.heatmisersavescom/libraries/joomla/environment/uri.php on line 161

Attachments:
Last edit: 14 years 1 month ago by bthayer.

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12209

The way you're doing it, that will add the cookie to the browser of the user but not in the curl request. You need to do something like this:

coderscult.com/php/php-curl/2008/05/20/p...url-cookies-example/

For the query string error, the error is a joomla error so I don't know from where it's coming. What you could do is add a @ in front of the $_SERVER so that notice doesn't display.

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12327

1) For the error above - Under Global configuration I had the error reporting level set to maximum. I switched it to none and that stopped the error mentioned above.

2) I am giving up on the notify_performance_based.php plugin.

3a) I am testing my shopping cart in IE and noticed these errors after the Authorize.net transaction completes:
Warning:
Cannot modify header information - headers already sent by (output started at /hermes/bosweb25b/b706/ipg.heatmisersavescom/components/com_hikashop/controllers/checkout.php:901) in /hermes/bosweb25b/b706/ipg.heatmisersavescom/templates/cloudbase/libs/ja.template.helper.php on line 130

3b) Also the page does not redirect back to my site.

4) IE and Firefox - Shopping cart requires 2 clicks to check out.

5) I noticed that the my-orders page requires a login. I'm sure this is expected behavior but really, why? There is already a cookie set and email on file. I know this because when I click on the register link the email field is already filled in.

6) One thing I find annoying while debugging is the next button disappears when i return and want to run another transaction.

7) Your cool!

8) Wouldn't it also be cool to have a debug plugin that creates test transactions & a reset plugin?

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12348

3. Is the order confirmed ? Do you get a "success" email ?
What do you see on the page ?

4. Please turn on the option "Auto submit shipping and payment methods selection"

5. The email is prefilled by your browser automatically as it recognize the field. There is no cookie set by hikashop and no means to know who is accessing the order so hikashop is not able to know which orders should be displayed for who.

6. The next button is removed because you have to reregister first since hikashop considers you as a new customer again in "no registration" mode.

8. How do you see that ?

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12453

nicolas wrote:

3. Is the order confirmed ? Do you get a "success" email ?
What do you see on the page ?

yes
4. Please turn on the option "Auto submit shipping and payment methods selection"
Done. Just need to test it again

6. The next button is removed because you have to reregister first since hikashop considers you as a new customer again in "no registration" mode.

8. How do you see that ?

Configure it with a test user name, address, phone, uname and test password and test products. The when you call the plugin it pre-fills the registration form and fills in and opens the shopping cart. The reset plugin changes all orders from that test person to canceled then deletes the orders and the user. It would save a lot of typing.

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12455

I just got word from my affiliate manager. He is making progress of the tracking pixel but needs the variables from this code.
<img src=" net.performance-based.com/l/259?id= <?php print $order_number;?>;amount=<?php print $dbOrder->order_full_price-($vat+$dbOrder->order_shipping_price+$dbOrder->order_discount_price);" alt="" width="1" height="1" border="0" style="width:1px;height:1px;border:0"
to be kept alive on the Thank you page.

The above code can be viewed in full in the topic history. It is not displaying here in full for some reason.

Last edit: 14 years 1 month ago by nicolas.

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12497

Could you change the line:
if(!is_bool($data) && !empty($data)){
to:
if(is_string($data) && !empty($data)){

in the file components/com_hikashop/controllers/checkout.php
That should help for 3 a and b.


Thanks for the suggestion for the testing plugins/modules we'll see if and when we cam come up with something.

If you're adding the performance-based image in the thank you page of the authorize.net plugin, then you should be able to use the information in the $_GET variable to get the price and the order number:
$order_number = hikashop::encode($dbOrder);

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12512

nicolas wrote:

If you're adding the performance-based image in the thank you page of the authorize.net plugin,


Do you mean the page entered in the Return URL field of the Authorize plugin?

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12530

I mean the file plugins/hikashoppayment/authorize_thankyou.php

Last edit: 14 years 1 month ago by nicolas.

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12650

nicolas wrote:

I mean the file plugins/hikashoppayment/authorize_thankyou.php


Here's the file edited with the image tag.
<?php
/**
 * @package		HikaShop for Joomla!
 * @version		1.4.8
 * @author		hikashop.com
 * @copyright	(C) 2010 HIKARI SOFTWARE. All rights reserved.
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');

//added for performance-based tracking image
$plgOrder=$_GET['dbOrder']
$dbOrder = hikashop::encode($plgOrder);


//closing tag
<div class="hikashop_authorize_thankyou" id="hikashop_authorize_thankyou">

	<img src="https://net.performance-based.com/l/259?id=<?php print $dbOrder->order_number;?>;amount=<?php 

		print $dbOrder->order_full_price-($vat+$dbOrder->order_shipping_price+$dbOrder->order_discount_price);?>"  alt="" width="1"  height="1"  border="0" style="width:1px;height:1px;border:0"  />


	<span id="hikashop_authorize_thankyou_message" class="hikashop_authorize_thankyou_message">
		<?php echo JText::_('THANK_YOU_FOR_PURCHASE');
		if(!empty($return_url)){
			echo '<br/><a href="'.$return_url.'">'.JText::_('GO_BACK_TO_SHOP').'</a>';
		}?>
	</span>
</div>
<?php 
if(!empty($return_url)){
	$doc =& JFactory::getDocument();
	$doc->addScriptDeclaration("do_nothing( function() {window.location='".

$return_url."'});");
}
For some reason the code does not view but you can see it in the thread history.

The error says:

Parse error: syntax error, unexpected T_VARIABLE in /hermes/bosweb25b/b706/ipg.heatmisersavescom/plugins/hikashoppayment/authorize_thankyou.php on line 13


Are we getting closer?

Last edit: 14 years 1 month ago by bthayer.

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12663

Instead of:
$plgOrder=$_GET
$dbOrder = hikashop::encode($plgOrder);

you should have:
$orderClass = hikashop::get('class.order');
$dbOrder = $orderClass->get((int)@$vars);
$products = $orderClass->loadProducts($dbOrder);
$vat = 0 ;
foreach($products as $product){
$vat+=$product->order_product_quantity*$product->order_product_tax;
} ?>

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12810

Thank you,

I think we're almost there. My test run returned a conversion message from performance-based

This is a conversion notification from [HeatMiserSaves.com].

A conversion has been made by a visitor referred by publisher 104515.

Conversion information:

ID#: 629145938
Type: sale
Amount: $297.00


I just need to clean up some strange errors & we'll be there! (fingers crossed :side: )

This page appears for a second after the credit card goes through but before the thank you page is displayed. I had to be quick to get the Alt-PrtScr.

Attachments:
Last edit: 14 years 1 month ago by bthayer.

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12828

You need to change the line:
foreach($products as $product){

to:
foreach($dbOrder->products as $product){

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

  • Posts: 73
  • Thank you received: 0
14 years 1 month ago #12875

message from Warren at performance-based; "yeah nicolas"

He also said, "just noticed that the OrderID that hikapshop assigns is not coming through"

Mechanically things look like they are working but now I need to fix this error:

Warning
: Cannot modify header information - headers already sent by (out started at <path>/ipg.heatmisersaves.com/components/com_hikashop/controllers/checkout.php:901) in <path>/ipg.heatmisersaves.com/templates/cloudbase/libs/ja.template.helper.php on line 130.

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

  • Posts: 83778
  • Thank you received: 13566
  • MODERATOR
14 years 1 month ago #12887

In your code you have:
print $dbOrder->order_number;

but you don't have any code to generate it... You should replace it by:
print hikashop::encode($dbOrder);

For the warning, you can just edit the file templates/cloudbase/libs/ja.template.helper.php and add a @ at the beginning to hide the message.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum