Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Shipping extensions all seem completely broken  (Read 709 times)

Offline Sam128

  • Newbie
  • *
  • Posts: 7
  • Karma: +3/-0
    • View Profile
Shipping extensions all seem completely broken
« on: May 14, 2024, 07:43:23 PM »
Okay, so I'm new to AbanteCart and probably missing something obvious, but I've been struggling with setting up shipping for about a week now, and all the options seem broken.

My shop is based in the UK, and I'm selling books globally. Customers can order multiple books. Books are heavy and shipping costs money. I want to add the shipping cost on to the order.

I've set up the books as products, and they each have a weight. When I add them to the cart, it shows the correct weight. So far so good. Now all I have to do is calculate the shipping cost.

I'll be sending things via Royal Mail, and there's a Royal Mail shipping extension. Great! Except, this is where the problems begin.

Firstly, the extension uses the term "Airsure" which Royal Mail hasn't used for years now, so that doesn't fill me with confidence. Secondly, the "Airsure" option only has 4 country lists, but Royal Mail has 3 Europe Zones and 3 World Zones, so I need 6 country lists. But it's okay, I can merge some of them together and get 4 international zones in total. Except one of the World Zones is "every other country in the world". Do I really have to enter every single country into the country lists? Isn't there an "all other country option"? Apparently not. In any case, Country List 4 doesn't seem to work at all, so now I only have 3 country lists available.  This could be workable, if Abantecart restricted shipping to those 3 country lists. But instead if the customer selects an unlisted country it doesn't show any shipping at all, and lets them check out!  Free shipping to the most distant countries in the world!  This is the exact opposite of what I want. Come on.

Okay, maybe I'm going about this all wrong. I'm trying to do weight based shipping, and look, there's a shipping extension called "Weight Based Shipping". That looks more promising, right?

Well, straight away there's a setting on the main extension page for maximum weight. Umm... no, the maximum weight depends on which country the parcel is going to.  Like, shipping to Canada is so restrictive that there can basically only be one book per parcel.  So I set the postage/weight combo in the Canada section to "1.5:26.65", and then hope that AbanteCart will only let Canadian customers check out if the total order weight is under 1.5kgs. Except nope! Free shipping for any orders to Canada above 1.5kgs!  Again, this is the OPPOSITE of what I want.

Oh, but AbanteCart helpfully sent me an email with this message:

Quote
No shipping method found for the purchase! Parcel size volume: 3380 cubic "cm", Weight: 2.8 "kg". Please check the shipping extension configurations related to the products size volume and weight limits.

Yes, thanks AbanteCart. Why did you let the order complete if the shipping option wasn't available?  Why isn't there a big red warning message at checkout saying "No shipping option available at this weight to this country", or similar, with the payment buttons greyed out? Don't let customers pay if you KNOW there is no shipping method!

Right, so on to the standard things you're going to suggest:

Did you change any PHP?  Nope.
Did you install any other extensions? No.
Have you set "Requires shipping" on all the products?  Yes.
Have you turned off "Free shipping"? Yes, everywhere I can see.
"Flat rate", "Local delivery", etc?  They're all disabled, or not even installed.

I apologise for the ranty tone of this post, but is what I want actually even possible with AbanteCart? I got so frustrated with all this that I installed ZenCart and osCommerce to see if they were any better.  They weren't - actually they were even worse!  So I guess AbanteCart gets some points there and you can feel good about yourselves. But currently I'm still not able to do weight based shipping the way I want.

I'm definitely missing something obvious, right?  How can I disable checkout for weight based shipping where the country/weight combination isn't available? Seems like such a simple and desirable feature. I would appreciate some help here.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5835
  • Karma: +275/-2
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #1 on: May 15, 2024, 02:45:47 AM »
Hello.
Could you confirm if the "Free Shipping" extension has been deactivated in the Admin > Extensions > Shipping section? Also, could you please inform us of your current AbanteCart version?

Offline Sam128

  • Newbie
  • *
  • Posts: 7
  • Karma: +3/-0
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #2 on: May 15, 2024, 06:53:59 AM »
I'm using AbanteCart Version 1.3.4, installed using Softaculous a couple of months ago. As far as I know it's fresh out of the box, I haven't done anything except delete all the demo products/categories, add my own products, enable Stripe for payments, and then try to configure shipping.

The "Free Shipping" extension is showing as not installed. Also, if AbanteCart was using free shipping, I would expect that it would show "Free shipping!" or some similar promotional message in the shipping section of the order. But as far as I can tell, the issue isn't that the wrong shipping method is being selected, it's that the available shipping method is coming up blank, and then AbanteCart just shrugs and lets the order go through instead of blocking it because of a lack of shipping.

But, I mean, when I say that out loud it sounds ridiculous. The system can't be coded in that way, right? For one thing, if it were coded in that way, the Free Shipping extension wouldn't ever be necessary, because free shipping is what you get by default.

Could anyone confirm that either:

1. This is NOT how AbanteCart is supposed to deal with shipping, and so I must have something configured weirdly on my system, or
2. This IS how AbanteCart deals with shipping - the enabled shipping modules have to return a price for every possible combination of weight/address that a customer might select, and if they don't return a price then that customer gets free shipping.

Just now I tried disabling all shipping options, and on the payment screen I get a red banner saying "No shipments are available".  There is also another red banner saying "No payments are available". Then under that it has the box for me to type my credit card details into Stripe and a "Confirm Order" button. If I click the "Confirm Order" button, then both warning messages go away and I can complete the order.

So now I'm even more confused. Why does it show "No payments available" above the Stripe payment section? See attached screenshot for what I mean.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5835
  • Karma: +275/-2
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #3 on: May 15, 2024, 08:19:24 AM »
You can disable the Fast checkout in the Extensions > All Extension to switch to the legacy checkout process.

To fix the bug in the Fast checkout please find the file https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/fast_checkout/storefront/controller/responses/checkout/pay.php#L363
At Lines 363-369 replace

Code: [Select]
if ($this->cart->hasShipping() && count($this->fc_session['shipping_methods'])
        ) {
            if (!$this->fc_session['shipping_method']) {
                //no shipping selected yet, not ready for payment
                $this->data['show_payment'] = false;
            }
        }

with the following code
Code: [Select]
if ($this->cart->hasShipping()
            && (!$this->fc_session['shipping_method'] || !count($this->fc_session['shipping_methods']))
        ) {
                //no shipping selected yet, not ready for payment
                $this->data['show_payment'] = false;
        }

Offline Sam128

  • Newbie
  • *
  • Posts: 7
  • Karma: +3/-0
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #4 on: May 15, 2024, 04:28:09 PM »
Wow, thanks. You were absolutely correct, the problem was in the Fast Checkout extension - I didn't even know that was a thing, but I tried disabling it, and the regular checkout process worked more sensibly.

Then I tried your fix, and Fast Checkout is now behaving sensibly too - payment options are not shown at all if shipping cannot be calculated.

I believe I still have an issue with the country lists though. On either the Royal Mail extension, or the Weight Based Shipping extension, is there any way to do the equivalent of "all other countries" as a category?  I see that the Weight Based Shipping uses "locations" as specified in the System -> Localization -> Locations menu, so at least I can create as many international zones as I want. And presumably I can edit the Countries list to disable any countries that I don't want to appear in the selection dropdown that the customer sees. So I guess I could work around the absence of any kind of "all countries not specified so far" type of option in the shipping calculation, but it would be more convenient if there was one.

Also, just in case you're not aware, the regular checkout process seems to have some bad CSS formatting - see screenshot attached. I checked with Edge and Firefox and it looks the same on both. I guess this isn't a big issue if everyone uses Fast Checkout instead, but on the other hand if there's a bug in Fast Checkout then I'm not sure how anyone is using AbanteCart to do shipping?

Apart from these issues, I'm actually pretty happy with AbanteCart though. As I said before, it's better than the others that I tried ;D

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5835
  • Karma: +275/-2
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #5 on: May 16, 2024, 03:13:48 AM »
Hello.
It is anticipated that the Royal Mail extension will receive an update with the forthcoming release of AbanteCart version 1.4.0.

Regarding delivery options, you may explore various third-party shipping extensions available in the marketplace, such as "Custom Shipping."
https://marketplace.abantecart.com/shipping-delivery



Offline Sam128

  • Newbie
  • *
  • Posts: 7
  • Karma: +3/-0
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #6 on: May 16, 2024, 06:21:28 PM »
I spoke too soon.  :(

Everything appeared to be working. I decided to use the Weight Based Shipping, and it was behaving as I expected with the two predefined locations (USA and Canada) plus another one I added for testing. So I added 6 more locations - one for each of the zones I needed, and added a bunch of countries to each. The locations show up in the "Additional Settings" section of the Weight Based Shipping plugin, and I can add the shipping weights and prices there. All good so far.

But now when I add some weight/price text in Weight Based Shipping, and click "Save", I get a 403 Forbidden error. The message says it's accessing this:

/index.php?rt=extension/default_weight&s=admin123&token=egotT9qRoiWKpXZMXnW0bp1k9sv2XXhV (port 443)

I've checked the permissions on that file - it's 644, which I believe is correct because all other files have the same permissions. In any case I certainly didn't edit any files or permissions or anything - I was using the admin web interface to add locations and shipping weights. It seems it randomly stopped working.

Some things do still work - like any time there's a little tick box to save individual changes - that seems to work still. But the weight/price text boxes don't have that tickbox. I have to click on the "Save" button at the bottom, and that's when it shows the error.

I tried deleting all the extra locations that I added, leaving just USA defined. So I only see the USA region on the Weight Based Shipping page now, but the 403 error still occurs.

Most of the admin website still works. I can save changes on the Fast Checkout extension page. The only thing I've found that doesn't work is the Royal Mail shipping extension, which now has the same problem. Individual save tickboxes work, but the "Save" button shows that error.  I'm positive I was never seeing any 403 errors before I added more locations.

I've looked in System -> Logs -> Error Logs, but there is nothing in there.

Any ideas?

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5835
  • Karma: +275/-2
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #7 on: May 17, 2024, 03:09:58 AM »
Hello.
It appears that the issue may be linked to the ModSecurity module on your hosting server, which is sometimes known for triggering false alarms. I recommend consulting your hosting provider's documentation to learn how to disable or adjust its rules. The scenario where "everything works and then suddenly stops" is often indicative of a ModSecurity-related problem.
https://abantecart.atlassian.net/wiki/spaces/AD/pages/3604484/Mod+security+403+406+error

Offline Sam128

  • Newbie
  • *
  • Posts: 7
  • Karma: +3/-0
    • View Profile
Re: Shipping extensions all seem completely broken
« Reply #8 on: May 17, 2024, 06:41:35 AM »
You were right. Probably. I tried saving again this morning and it worked first time. And now I've been able to add all the locations back in, and save the shipping costs, and it's all still working.  So it probably was some kind of server security issue and nothing to do with AbanteCart itself.

Thanks for all your help, Basara!  ;D

 

Powered by SMFPacks Social Login Mod