V2.0 multi flat rate shipping - Allows customers to proceed through checkout without shipping

Hey Guys


So this shipping script works perfectly except when a user doesn't pick one of the options from the form, allowing them to checkout without paying shipping
is there a way to add validation that an option is set before it allows checkout?


Thanks!!!

I'm listing this as a bug as it shouldnt be able to happen when using this script.









{% if context == 'cart' or context == 'checkout' %}

(function (FC, $) {
FC.customFlatRates = {};
FC.customFlatRates.shipping_results = [];

FC.customFlatRates.config = {
'autoSelect': false /* Set to true if you'd like the top shipping option to be automatically selected for the user */
};

FC.customFlatRates.logic = function(address) {
/* BEGIN CUSTOM SHIPPING LOGIC */


if (address.country == "AU") {
FC.customFlatRates.add(1, 5, '', 'Domestic');
FC.customFlatRates.add(2, 10, '', 'Domestic Express');
} else {
FC.customFlatRates.add(3, 15, '', 'International');
}

/* END CUSTOM SHIPPING LOGIC */
};

/* Flat Rate Shipping Modification Logic v2.0.3 */
FC.customFlatRates.add=function(a,b,d,c){FC.customFlatRates.shipping_results.push({method:d,price:b,service_id:a,service_name:c})};FC.customFlatRates.hide=function(a){a=FC.customFlatRates.filterShippingOptions(a);for(var b=0;ba?0:a};
function requireShipping(){if(!FC.json.shipping_address.has_live_rate_shippable_products){if(FC.json.has_multiship)for(i=0;i
{% endif %}
Comments
  • fc_adamfc_adam FoxyCart Team
    @BamSockPow,

    Can you confirm the store you're working with here? The snippet should definitely cause an error to be displayed if a customer tries to checkout without selecting one.
  • Basically if you were to pick a country, and then a different country with different shipping options, say you start with america, and then select australia with my script, it wont auto set a shipping option enabling them to checkout with 0 shipping
  • fc_adamfc_adam FoxyCart Team
    @BamSockPow,

    Could you link us to your store? Without seeing it myself it's hard to say what's going on. If you'd prefer to keep it private, you can whisper it to me by checking the "whisper" box checkbox and entering my forum username.
  • Hey Adam!

    sorry its taken me this long to reply the shop is

    herpony.com

    add what ever product you want
    then go through the checkout to the personal details page, select a country, in this case use australia enter a postcode eg 3000, then change countries to anywhere else, america postcode 10001 then change the country back to australia.

    we get maybe 1 in 100 checkouts without the shipping price added.
  • fc_adamfc_adam FoxyCart Team
    @BamSockPow,

    No worries.

    I followed the steps you detailed there, and it prompted me that I needed to select a shipping rate. Which browser are you able to checkout without selecting a shipping rate on?
  • Chrome, Firefox, Safari
    All browsers have tested are uptodate and so far enable me to checkout without selecting a radio button.
  • fc_adamfc_adam FoxyCart Team
    @BamSockPow,

    The approach you detailed in your previous post - is that exactly how you're replicating this issue? Or is it another way? If it's a different way, could you detail that for us as we're unable to replicate this on our side.
  • It's exactly how I'm replicating it on multiple computers,

    my issue is that it enables the a customer to checkout without having one of the radio buttons selected,
    hence free shipping, Maybe I could record a little screen vid for you?
  • fc_adamfc_adam FoxyCart Team
    @BamSockPow,

    A video would be great - no matter which way I try I'm unable to replicate it. Thanks
  • BamSockPowBamSockPow Member
    edited March 2015
  • Sorry its taken so long, this seems to be getting worse because I didnt even need to do what I was doing before for it to let me checkout.
  • brettbrett FoxyCart Team
    @BamSockPow, thanks for the video. That's super helpful. We'll take a look!
  • I guess what it needs is a validation check before it'll let you check out.

    but I aint that saavy just yet with v2
  • fc_adamfc_adam FoxyCart Team
    @BamSockPow,

    Thanks for sharing the video - that definitely helps.

    Could you try updating to the latest version of the custom flat rates snippet from here please? https://wiki.foxycart.com/v/2.0/snippets/flat_rate_shipping_modification - I think that may correct the issue you're experiencing.
  • Hey Adam,

    Just updated the flat rate snippet and the issue is still occurring!
    Buh bow
  • fc_adamfc_adam FoxyCart Team
    edited March 2015
    @BamSockPow,

    Ah that sucks - I thought it was going to be a nice quick solution for us. I'll keep digging.
  • fc_adamfc_adam FoxyCart Team
    edited March 2015
    @BamSockPow,

    Actually I think it did fix part of the issue, related to allowing the user to checkout without selecting a rate. It's now correctly auto-selecting a rate when you try to checkout without selecting one before pressing the submit button - at least for me.

    There is still a bug relating to changing the country from one where it was autoselected to another with different rates where it doesn't autoselect, but I've got a fix coming for that shortly.

    Could you confirm if you're still seeing it allowing you to checkout without selecting a rate though?
  • Yep still can work my little loophole
  • fc_adamfc_adam FoxyCart Team
    edited March 2015
    @BamSockPow,

    Are you definitely seeing $0 shipping when you are redirected to PayPal still? While I was able to replicate it prior to your latest change, since then while it won't alert you to not having selected a shipping rate - it does select one for me silently right after clicking checkout.

    [edit] Quick follow-up too - I have a fix for the bug you found with changing countries repeatedly losing the autoselect - I should have that ready for you to test early next week.
  • Sorry its taken so long to get back to you adam

    I can still checkout without seeing the shipping added to the cost with my little loophole.
    :(
  • This is actually getting worse, even though the radiobutton is highlighted its letting users checkout without the shipping attached to the orders, My clients got yet another
  • The script is now no longer editing the price of the shipping field at all, Something's completely whack and it's become a serious problem.

    So because this is a busy shop I have had to turn on a flat 5 shipping fee for the time being which is less than ideal
  • 2.0.6 has fixed the serious issue, hopefully its fixed the small issue as well
    You have literally saved my bacon, thanks @fc_adam!!
  • fc_adamfc_adam FoxyCart Team
    @BamSockPow,

    Yeah - we're just rolling this fix out to all existing stores who are using the snippet. There was a change in our javascript related to flat rate shipping that meant we needed to update our custom snippet as well, but unfortunately me failed to make the connection before we rolled the change out this morning.

    Thanks for bringing it to our attention!

    In terms of the issue you found, I have an additional new version which I'll hopefully be adding on tonight, but still have some testing left. I've been sick the past week and unfortunately haven't had the time to finish it off.
  • documentation is key!
    Just gotta be keenly aware of this as my customers crack the whip when bugs start costing money!

    But thank you so much, I'm decent af reading code but I'm not that decent!!
  • brettbrett FoxyCart Team
    edited April 2015
    @BamSockPow,
    Just gotta be keenly aware of this as my customers crack the whip when bugs start costing money!
    We know. Every time we do something like this, we feel terribly. We've been radically (like hugely radically) improving our testing processes over the past year, and we're continuing to do so. We tested the change we rolled out extensively, but not with the flat-rate customization script. And we feel terribly about it.
Sign In or Register to comment.