I am trying to store the baseurl to options table in wordpress for non logged in users. Basically if the user was referred to url mysite.com/go/affilatename I want to store affilatename (baseurl) to the options table... I tried storing it as an option with their ip as the key and then the baseurl as the value
Basically its an affiliate/referral site where signed up affiliates refer their customers to our site that sells mobile data subscriptions... but when they sign up as an affiliate they want their own logo as site logo and stylesheet... rather than create pages for each of them in Divi they all use one global page as their product page e.g. mysite.com/go/affilatename... but i load their branding on that page and change all links to pages as in terms conditions to load their branding... works well so far if signed in
The idea is that it then serves a site logo and css based on the affilatename value, also then it rewrites all WordPress slugs by adding /go/affilatename to the end of every link or post on the site
This is working for logged in users BUT I cant get it to to work for non logged in users
I tried setting transients and also set option but the value somehow always gets set to ?wc-ajax=get_refreshed_fragments and not the value I am passing to the set transient or set option
if( !$user_ID) { $affiliate = basename($_SERVER['REQUEST_URI']); $user_ip = $_SERVER['REMOTE_ADDR']; set_transient ('affiliate',$affiliate, 60*60*1) ; $client = $_SERVER['REMOTE_ADDR']; update_option( $user_ip, $affiliate ); } The idea is that I can that a[[end my url rewrite strings with the value stored and server the css and logo based on that value for that IP address