Hi everyone, I just wanted to know if anyone knows of a way to offer different pricing for the same subscription tiers depending on the country the user visits from? Thanks!
Pricing depending on IP?
What countries and what tiers/prices?
It depends… There is several ways to get user’s location, and not all are applicable in all the cases. I am curious to create such feature, so I am ready to do it for you for some fee.
if you have the maxmind geoip extension installed then this code snipped might work
Just put the following shortcode in your join page.
function charge_americans_more_fcn(){
$join_shortcode = <<<HTML
[s2Member-Pro-Stripe-Form rp="1" rr="1" accept_coupons="0"]
[s2Member-Pro-Stripe-Form register="1" level="0" ccaps="" desc="⚡ Free HyperMail Newsletter Subscriber" custom="www.sciencefictionbookclub.org" tp="0" tt="D" captcha="1" success="/thanks-for-signing-up-for-our-newsletter/" /]
[s2Member-Pro-Stripe-Form level="1" ccaps="" desc="🤖 Replicant (£3 per month)" cc="GBP" custom="www.sciencefictionbookclub.org" ta="0" tp="0" tt="D" ra="3.00" rp="1" rt="M" rr="1" coupon="" accept_coupons="0" default_country_code="GB" captcha="0" success="/congratulations-and-megathanks-for-supporting-the-science-fiction-book-club/" /]
[/s2Member-Pro-Stripe-Form]
HTML;
$country_code = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
if($country_code == 'US')
{
$join_shortcode = str_replace('£3', '$5', $join_shortcode);
$join_shortcode = str_replace('GBP', 'USD', $join_shortcode);
$join_shortcode = str_replace('3.00', '5.00', $join_shortcode);
$join_shortcode = str_replace('GB', 'US', $join_shortcode);
}
return do_shortcode($join_shortcode);
}
add_shortcode('charge_americans_more', 'charge_americans_more_fcn');
Wow thank you for the replies and actionable info. LOL Gerard that shortcode killed me xD
I’m currently setting up the staging site to test it, but I already know it will be a headache to build. After careful reevaluation this weekend I’ve decided to improve my checkout process instead so I’ll put this on hold for now.
Thanks again. I’ll write back in this thread once I have the energy to undertake this again.