• Resolved chenghsuango

    (@chenghsuango)


    Hello Will,

    I face a problem with my business. I want to make my website to join a marketing website. They mailed me and asked me to add some php code into my site. But I’m a new of wordpress and php. Please help me for this , I think it have to change some code about my wordpress theme or Woocommerce. Please give me some advise about it. I really appreciate about that.

    this is the following mail:
    ———————————
    This is the cookie code that would need to be put on the home page:

    < —-—-—-—-—- Put this in the Header, must load first —-—-—-—-——->
    <? php setcookie(“ID”, $ _ GET[‘RID’]); ? >
    < —-—-—-—-—- End Code for Home Page —-—-—-—-——->

    < —-—-—-—-—- Put this in the header of the checkout page or wherever you choose to call this cookie and where it can be submitted with the order —-—-—-——>
    <? php if(isset($ _ COOKIE[‘RID’])) { ??$RID = $ _ COOKIE[‘RID’]; } ? >

    < —-—-—-—-——Put this code in the input code area of your form —-—-—-—-—-—-—->

    ????? <input name =”ID” type =”” value =”<? echo $RID ? >”?readonly =”true” size =”9” >

    < —-—-—-—-—-—-—-—– End of Code –—-—-—-—-—-—-—-—-—-—–>

    The only thing else would be to set this in your submit pages so that it carries with the order. You can modify this code any way that you see fit to set in your web page. If you are able to get this code to work, your URL would be http://Your WEB Site Address /index.php?RID= and we will send the RID when a customer or distributor clicks on it. This code will capture the RID on the home page in a cookie. Next, this code will call the cookie on the checkout screen where ever the customer will enter their shipping information and include it in the checkout form that you have already created. When they click continue, your pages must contain that value on the page so that it gets submitted with the order and so that you or your system will contain the RID on the order when it comes in for processing. This way you know it came from Market Taiwan. This is rather urgent that you make this happen because we have to be able to track the site id for all orders placed by our Market Taiwan distributors and their customers. You can develop a query tool in your orders file to list all orders with a RID in it and those are all the orders that will represent all Market Taiwan orders and that is what you will report on each month along with commissions.

    Thank you, Will

    Best wishes,
    Lucas

    https://ww.wp.xz.cn/plugins/insert-php/

Viewing 1 replies (of 1 total)
  • Unfortunately, the Insert PHP plugin can not set a cookie or specify any other headers, including redirects. By the time the PHP code is run in the post or page, the header lines will all have been sent already. Trying to set a cookie or other header lines here will result in an error message.

    If the cookie must be set with PHP, then it must be set before any content is sent to the browser.

    Probably, the code will need to be inserted somewhere in your WordPress templates. If it’s beyond your current skill level to accomplish that, it may be prudent to find someone who can help you. Or perhaps Market Taiwan can assist.

    Will

Viewing 1 replies (of 1 total)

The topic ‘add some php code about cookie’ is closed to new replies.