mickah
Forum Replies Created
-
That’s great. Thanks so much for all your help.
Thanks, that worked.
I’m still having a problem with my code though. It only works on form refresh or additional orders.
if($from=="Antrim" || $from=="Armagh" || $from=="Down" || $from=="Fermanagh" || $from=="Derry" || $from=="Tyrone"){ $mycountry ="GB"; } else{ $mycountry ="IE"; } add_action( 'wc_price_based_country_before_frontend_init', 'my_function', 10, 1 ); function my_function($mycountry) { return $mycountry; } if(wcpbc_set_woocommerce_country($mycountry)){ echo"wcpbc_set_woocommerce_country($mycountry) Success;"; } else{ echo "wcpbc_set_woocommerce_country($mycountry) Failed"; } my_function($mycountry);The output of the script is wcpbc_set_woocommerce_country(GB) Failed and the currency is not updated.
However, if I refresh the form data or add another order the output is still wcpbc_set_woocommerce_country(GB) Failed
But the currency has been updated to £.
Any idea what I’m doing wrong?
Thanks Oscar
That link came back as forbidden.
Do you have a link to the documentation?Apologies for the confusion.
I already have the product creation code sorted, I just need to set the currency.
So basically what I need is: if the condition mentioned above in the form submission is met then we can force the currency to £GBP