Thanks,
]]>I created a custom sign-up form using the RegistrationMagic
free version plugin. Then I tried to map the fields to Woo-Commerce fields, so they will be shown on user profile and checkout page.
But the country seems not added to database, because it is not showing up anywhere. (I found the country values in the dropdown options are of the format <COUNTRY_NAME>[COUNTRY_CODE]
. Should it be just <COUNTRY_CODE>
?)
Here is the page for your reference, Sole House sign-up form
Could you please help me with this?
Also please add cc to [email protected]
on the email communication thread if possible?
Note: I also have added another payment gateway + delivery plugin that checks on the address fields registered during registration.
]]>Recently I added this code to my functions.php:
/**
* Change the default country on the checkout for non-existing users only
*/
add_filter( 'default_checkout_billing_country', 'change_default_checkout_country', 10, 1 );
function change_default_checkout_country( $country ) {
// If the user already exists, don't override country
if ( WC()->customer->get_is_paying_customer() ) {
return $country;
}
return 'NL'; // Override default to Netherlands
}
But now my logs get spammed with this:
2021-08-17T00:07:07+00:00 DEBUG Billing Country is not valid.
NL is a valid country code, so I don’t get what is going wrong here.
Kind regards,
Palactig
I try using a plugin “Checkout field Editor for Woocommerce” and it’s suppose to be visible and active both, billing ans shipping country.
]]>What can i do about it ?
regards,
Nathalie
Thank you
]]>Usage Example:
User fills billing state manually while setting the billing country field to “Select…”
I need to update price and currency after user select billing country
add_action(‘wp_footer’, ‘billing_country_update_checkout’, 50);
function billing_country_update_checkout() {
if ( ! is_checkout() ) return;
?>
<script type=”text/javascript”>
jQuery(function($){
$(‘select#billing_country, select#shipping_country’).on( ‘change’, function (){
document.getElementById(‘totalSum’).innerHTML = ‘<?php echo WC()->cart->get_cart_contents_total(); ?>’;
});
});
</script>
<?php
}
So far I did this ^, but price is all the time the same.. Price isn’t adequate to selected country (I’ve set prices manually for each pricing zone). Any ideas?
]]>