Jump to content

How add php code for affiliate into template tpl into Header.tpl or Footer.tpl PLEASE


Guest

Recommended Posts

hi all,

i have problem. iam normal user not programer.

 

i must add one php code into header (or footer) - this me write from company.

 

so i opent header.tpl what is in my template folder and copy this php but this isnt for :,(

 

so i look on google and i found that when i write {PHP}{/PHP} and write php code betwen this so work.

so i test but when i write php code into this {PHP}here is my php code{/PHP} so still not work.

 

please anyone help me / give me tip how add normal php code into template header please.

 

this is my php code what i must add into header:

?php
if(isset($_SERVER['HTTP_REFERER']) &&
!empty($_SERVER['HTTP_REFERER']) &&
preg_match('/affiliatecompanywebsiteishere\.com/',$_SERVER['HTTP_REFERER']))
setcookie('referrer','affiliatecompanywebsiteishere',time()+3600*24*60);
?>
Link to comment
Share on other sites

hello

 

 

you said, that you use 1.3.x version so i think that in this case you can try with:

{php}
if(isset($_SERVER['HTTP_REFERER']) &&
!empty($_SERVER['HTTP_REFERER']) &&
preg_match('/affiliatecompanywebsiteishere\.com/',$_SERVER['HTTP_REFERER']))
setcookie('referrer','affiliatecompanywebsiteishere',time()+3600*24*60);
{/php}
Link to comment
Share on other sites

hi vekia, ok today night i test it.

 

so maybe i made mistake when i write:

{php}?php
if(isset($_SERVER['HTTP_REFERER']) &&
!empty($_SERVER['HTTP_REFERER']) &&
preg_match('/affiliatecompanywebsiteishere\.com/',$_SERVER['HTTP_REFERER']))
setcookie('referrer','affiliatecompanywebsiteishere',time()+3600*24*60);
?>{/php}

 

right? ok i test night your version. very thanks vekia :)

Edited by MPart (see edit history)
Link to comment
Share on other sites

ok thanks vekia. yes i have old presta 1.3 so today night i test.
only please I could ask - it does not matter if I will put the code into header or footer? right?
there is no difference when i will put php code into header or footer right? or yes exist difference?

Edited by MPart (see edit history)
Link to comment
Share on other sites

Vekia yes your version works :) very thanks

 

please my last question now is affiliate okay and now i only add into produt page into product description one small javascript

but when i open this product in backend and click on html view and i copy this javascript and save

so on front end ison product page in description tab still only text and javascript not.

 

what ii must do for add one javascript into product description please? (prestashop 1.3.4.0)

 

i find in prestashop forum and i found one thread where is wrote that for this is must mce.

 

please give me tip how add javascript into product description in frontend on tab product detail tahnks

Link to comment
Share on other sites

Hi vekia, i write what i need:

 

this affiliate is in cookie and after buy

 

now i have on my prestashop 1.3,4,0 ok -> cookie, and confirmation  (cookie is in header, and confirmation after buy is in orderconfirmation.php). this is okay

 

and now three step - this affiliate have option add button on product page, and then user click on product so this product show on affiliate website after user login.

 

this button give me affiliate company in javascript BUT now is problem -> when i edit product in my prestashop and click mouse into long description and click on "html" and here i add javascript on top and afteri save, so when i look on frontend on this product so in product description isnt this button :/ so my question is -> in prestashop into product description not work javascript? its strange because example when i add into description code from youtube so this work but when i add this javascript what my give affiliate company so button isnt :(

 

this is javascript what give me affiliate company and they say me add this button on product page.

so i was try add in one product into product description but after save changes when i look on frontend so this isnt in product description :,(

<script type="text/javascript"
src="http://www.affiliatecompanywebsite.com/wishButton.php?ean=123456789&firm_id=hereismyidnumberwhatprovidemyaffiliatecompany">
</script>
Link to comment
Share on other sites

yes, when i edit product description in backend, click on html add javascript, and save. so when i look on frontend so in frontend isnt nothink, and when i back into backend and look again on same product on product description and again click on html so here is javasript but on frontend not appears :(

Link to comment
Share on other sites

×
×
  • Create New...