Jump to content
Sign in to follow this  
someone

Affiliate Tracking Code Issue

Recommended Posts

Thank you for helping to resolve that issue. It got me further. Now i am testing the integration. As customer i click on the link and made a purchase. checkout/success page showed error on top of the page:

Warning: file_get_contents (https://website.com/affiliates/sale/amount/56.8177/trans_id/19775/tracking_code/1-1-someone-KJA9FRZRB7S3IPL): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/someplace/public_html/store/system/storage/modification/catalog/controller/checkout/success.php on line 178

And this is what i have on line 178 there:     

$aff_integrate = file_get_contents('https://website.com/affiliates/sale/amount/' . $aff_data['total'] . '/trans_id/' . $this->session->data['order_id'] . '/tracking_code/' . $_COOKIE['jamcom']);

(website.com is edited of course)

 

Share this post


Link to post
Share on other sites

first, try running the URL in your browser directly to make sure it works:

https://website.com/affiliates/sale/amount/56.8177/trans_id/19775/tracking_code/1-1-someone-KJA9FRZRB7S3IPL

 

Share this post


Link to post
Share on other sites

try https://website.com/affiliates/index.php/sale/amount/56.8177/trans_id/19775/tracking_code/1-1-someone-KJA9FRZRB7S3IPL

Share this post


Link to post
Share on other sites

Ithis way it does show the main page.

I have changed the url in the integration code to include index.php , but i am getting the same error on purchase. 

Share this post


Link to post
Share on other sites

looks like there is an issue with the .htaccess rewrite rules, did you have the .htaccess file in your /affiliates folder?

Share this post


Link to post
Share on other sites

thank you for your respond. Sorry got distracted with a different project and  did not respond back right away. That htaccess did not changed anything. 

I wonder if it have anything to do with this part?

the store  is located at domain.com/store/  has its own htaccess with rewrite rules

# SEO URL Settings
RewriteEngine On
RewriteBase /store/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

 

--------

and affiliate is located at domain.com/affiliates/  and has this part in htaccess   

<ifModule mod_rewrite.c>
    RewriteEngine On

	# Some accounts require the RewriteBase to be set
	#RewriteBase /

    # Force URL to be on SSL page at all times
    #RewriteCond %{HTTPS} off
    #RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

	RewriteCond %{REQUEST_URI} ^/system.*
    RewriteRule ^(.*)$ index.php?/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ index.php?/$1 [L]
</ifModule>

 

I think something is off between these two.

 

Share this post


Link to post
Share on other sites

Open up the /application/config/routes.php file and add this line:

$route[SALE_ROUTE.'/amount/(:any)/trans_id/(:any)/tracking_code/(:any)'] = "sale/index/amount/$1/trans_id/$2/tracking_code/$3";

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...