Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter brodde

    (@brodde)

    Hi again!
    First this is a great plugin!
    My question is, is the “rest of the world” contry code allways AX???

    Thread Starter brodde

    (@brodde)

    Hi again! Or it there a function that can check if it is test of the world?
    Contry in list or else

    Plugin Author Oscar Gare

    (@oscargare)

    Hi,
    In the country selector, the country code for “Other countries” is the first country that is not in a “price zone”, it’s general that this country be “AX”.

    Plugin Author Oscar Gare

    (@oscargare)

    You can get the current country by wcpbc_get_woocommerce_country();

    Thread Starter brodde

    (@brodde)

    Thx, but is there a return call if the customer is from rest of the world?

    Plugin Author Oscar Gare

    (@oscargare)

    Hi,
    you can use:

    if ( ! WCPBC()->customer->zone_id ) {
    //other countries
    }
    • This reply was modified 8 years, 8 months ago by Oscar Gare.
    Thread Starter brodde

    (@brodde)

    THX!
    This will work perfectly!

    I wanted to detect if the customer was in zone “other countries”.
    Than i could use

    if ( WCPBC()->customer->zone_id ) {
    //Is in a Zone
    }else{
    //other countries
    }

    Right?

    Plugin Author Oscar Gare

    (@oscargare)

    Yes!

    Plugin Author Oscar Gare

    (@oscargare)

    Hi @brodde,
    If you like the plugin, please leave a 5 stars review πŸ˜‰
    Thank you in advance.

    Thread Starter brodde

    (@brodde)

    Hi again Oscar!
    This is a superb plugin. We will zoon upgrade to the pro version, as sson we are live with the site.

    Question?

    With this function as you have toold i can check if a customer is in a zone or “rest of the World.

    if ( WCPBC()->customer->zone_id ) {
    //Is in a Zone
    }else{
    //other countries
    }

    Can i also get the zone (id or name)?

    Thread Starter brodde

    (@brodde)

    Hi again Oscar!
    This is a superb plugin. We will zoon upgrade to the pro version, as sson we are live with the site.

    Question?

    With this function as you have toold i can check if a customer is in a zone or β€œrest of the World.

    if ( WCPBC()->customer->zone_id ) {
    //Is in a Zone
    }else{
    //other countries
    }

    Can i also get the zone (id or name)?

    Plugin Author Oscar Gare

    (@oscargare)

    Hi,
    yes you can get zone_id, name, etc.. from customer variable
    WCPBC()->customer->name;// zone name
    WCPBC()->customer->countries;// zone countries

    Regards,

    • This reply was modified 8 years, 8 months ago by Oscar Gare.
    Thread Starter brodde

    (@brodde)

    Thx like:
    echo WCPBC()->customer->zone_id;

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Default contrycode’ is closed to new replies.