Having had no end of trouble trying to get Canada Post shipping working on a store I'm trying to set up, I'm now trying the Simple Shipping approach using Flexicharge and the Regions module.

Everything seemed to be going well at first -- I set it all up following the directions in the handbook (http://drupal.org/node/122769) and it all seemed pretty straightforward. I set the location of the store (Canada), created three shipping regions -- Canada, US and International -- and assigned the countries appropriately, and then set up shipping charges for each region. But when I tried to put in a test order, it didn't assign any shipping cost. There was a simple shipping line on the checkout page, but the charge was $0.

I tried assigning a charge to "Unallocated locations" to see if that was it, and that charge showed up -- despite the fact that the address for my test order was in Canada. So I went back to the page where you assign the countries to the regions (admin/ecsettings/regions/fl_shipping) -- and to my surprise, none of my country selections had been saved. All the countries were still assigned to "N/A" and there were none assigned to my three shipping regions. So I assigned them again, and clicked "Update regions", and then checked to see if they had been saved -- and they hadn't. Tried again, and again. Same result.

And the setup of that page is weird -- there's an expandable title that says "N/A", and then two under that for Countries and US States, and then within the Countries section, a list of countries with radio buttons for N/A and my three shipping regions. But every time I try to save the page, it reverts all the countries back to N/A. And I'm wondering why the country and state lists appear under a title that says N/A in the first place. Should there be titles for the regions I created?

It says "Go to the Add region page if the only region you have is N/A or you need more regions," but while the main heading on the page is N/A, within the list of countries under that it does show all my regions -- it just won't save any changes I make.

Am I doing something wrong, or is this some kind of bug?

The site in question is running Drupal 5.18, and I'm using version 5.x-3.6 of the e-commerce module. The URL of the test site is http://d5.womenshealthyenvironments.ca/ if that helps any.

I've set the priority to critical because this store really, really, really needs to get up and running this week, and it can't without a workable shipping method.

Comments

spidersilk’s picture

Category: support » bug
Priority: Critical » Normal

OK, having done some poking around with devel and my own lower-tech troubleshooting techniques (mainly sticking print_r statements into the theme file to print out the contents of various arrays, I've determined that the ec_regions module appears to be horribly broken. The configuration form is being submitted through $_POST, but nothing on the page it submits to is picking up the data or doing anything with it at all.

This is pretty much beyond my ability to fix, but I offer the following as a workaround for anyone else running into the same problem:

After poking through the code in the module file itself, I went into phpMyAdmin, found the ec_region_configuration table, and for each country I wanted to assign to a region, added a row to the table.

For regid, put the id n umber of the region you want to assign the country to (you can find those in the ec_region table), for geo_type put "country", and for geo_code put the two-letter code for the country you want (in my case, "ca" for Canada in one row and "us" for the US in the other). Save the new rows you added, and voila, you have working regions with the proper countries assigned to them, and everything works.

If you want to assign US states, I think the geo_type is "us.state", but I haven't tried that, so you're on your own with that one.

Sorry, I know this isn't the most elegant solution, but at least it got my store working, and hopefully might help others having the same problem. If I knew how to write a patch file, or how to modify the module file correctly to make it do this, I would, but while I'm not bad with PHP in general, Drupal module coding is a bit of a world unto itself, and not one I know my way around very well yet. The module file appears to be mainly a list of functions, and while I could figure out what each of the functions individually did, I have no clue how to make it call a particular function at a particular point in the process (i.e. tell it to call ec_region_configure_form_submit() when the form is submitted, which is what it is not doing). Maybe someone else can figure out how to do that based on what I've posted here?

Leaving the issue open, and changing the type to bug report, in case anyone wants to undertake writing a patch and post it here, but I've downgraded the priority to normal, since for me at least, the panic's over.

stuhannaford’s picture

hi,

same problem as above, help would be appreciated. gonna try out the above workaround if all else fails, thanks.