The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Shipping/Billing whitelist/blacklist bug?

I have a store that has both shipped and not-shipped items (differentiated by category). We want to restrict any shipping to only US addresses, but allow orders with only not-shipped items to be purchased from anywhere.

Using the shipping/billing whitelist/blacklist feature seems like it should work for this. Using this feature blocks the shipping addresses we want blocked from being entered. But for orders of only not-shipped items, while there is no shipping address entry, we get the error message "We do not currently allow orders from this region."

Even if I use a separate shipping and billing lists, the shipping list is always applied when the order has no shipping address. Is this a bug? Are we doing something wrong in the configuration? Is there a way to accomplish what we want?

  • brettbrett FoxyCart Team
    Hi @ken21
    Good question. We'll take a look, but my hunch is that we're sort of "smooshing" the addresses together for non-shippable products, and we're doing that in a way that's causing a problem with the blacklisting/whitelisting functionality.
  • fc_marijafc_marija FoxyCart Team
    Hello @ken21-

    We do have this ticketed as a bug on our side, but you can use the following script on your custom footer on the TEMPLATES->configuration settings in the meantime. Let us know if you need additional direction on doing that.
    {% if context == 'cart' or context == 'checkout' %}
    <script type="text/javascript" charset="utf-8">

    FC.locations.logic = function() {
    FC.locations.limitCountriesTo('US', 'shipping');


    /* Country/State Helper Functions v2.0 */
    FC.locations.removeCountries=function(a,b){if("undefined"==typeof a)return!1;"string"==typeof a&&(a=[a]);b=FC.locations.validateLocationArrayNames(b);for(l in b){0===FC.json.config["locations_"+b[l]].length&&(FC.json.config["locations_"+b[l]]={});for(var c in a)FC.json.config["locations_"+b[l]][a[c]]="*"}return!0};
    FC.locations.limitCountriesTo=function(a,b){if("undefined"==typeof a)return!1;"string"==typeof a&&(a=[a]);b=FC.locations.validateLocationArrayNames(b);for(l in b){var c=FC.json.config.locations;FC.json.config["locations_"+b[l]]={};for(var d in c)-1==a.indexOf(d)&&(FC.json.config["locations_"+b[l]][d]="*")}return!0};
    FC.locations.removeStates=function(a,b,c){if("undefined"==typeof a||"undefined"==typeof b)return!1;"string"==typeof b&&(b=[b]);c=FC.locations.validateLocationArrayNames(c);for(l in c){if("undefined"==typeof FC.json.config.locations[a])return!1;FC.json.config["locations_"+c[l]].hasOwnProperty(a)||(FC.json.config["locations_"+c[l]][a]=[]);for(var d in b)FC.json.config["locations_"+c[l]][a].push(b[d])}return!0};
    FC.locations.limitStatesTo=function(a,b,c){if("undefined"==typeof a||"undefined"==typeof b)return!1;"string"==typeof b&&(b=[b]);c=FC.locations.validateLocationArrayNames(c);for(l in c){var d=FC.json.config.locations;if("undefined"==typeof d[a])return!1;FC.json.config["locations_"+c[l]][a]=[];for(var e in d[a].r.options)-1==jQuery.inArray(e,b)&&FC.json.config["locations_"+c[l]][a].push(e)}return!0};
    FC.locations.validateLocationArrayNames=function(a){if("undefined"==typeof a||""==a||"both"==a)a=["billing","shipping"];"string"==typeof a&&(a=[a]);for(var b=0;b<a.length;b++)"customer"==a[b]&&(a[b]="billing");return a};function customLocationsHandler(){FC.locations.logic();FC.Template(FC.json.context).clearOutput();"cart"==FC.json.context?FC.cart.renderAddressEntry():(FC.checkout.renderCustomerBilling(),FC.checkout.renderCustomerShipping())};
    {% if cart_is_fullpage or context == 'checkout' %}FC.client.on('ready', customLocationsHandler);{% else %}customLocationsHandler();{% endif %}
    {% endif %}
  • Thanks fc_marija,
    I did put in this scripting as a workaround (found from another post here). Just wanted to make you aware that the whitelist/blacklist doesn't seem to be working as expected. This javascript workaround seems to work fine.
  • fc_marijafc_marija FoxyCart Team
    @ken21 -

    Glad to hear you found the script and that it's working for you. Appreciate you letting us know that the native option wasn't working on the non-ship items.
Sign In or Register to comment.