KonaKart Community Forum

Installation / Configuration => Configuration of KonaKart => Topic started by: Anni on November 28, 2007, 12:35:21 pm

Title: configuring zone shipping module
Post by: Anni on November 28, 2007, 12:35:21 pm
hi everyone,

I've added four different shipping zones for this module. three of them have specific countries, the fourth would be every country that isn't included in the other zones.
is there a short way to specifying this or do I have to insert all remaining country codes individually for the last zone?

regards,
anni
Title: Re: configuring zone shipping module
Post by: julie on November 28, 2007, 01:19:50 pm
Hi Anni,

At the moment if the country doesn't exist in one of the defined zones, an exception is thrown to signal to the customer that shipping isn't available to that country.

If you do indeed ship everywhere then your best bet is to edit the source code of Zones.java (com.konakart.bl.modules.shipping.zones) to not throw this exception.

At the moment the code looks like :

Quote
        // Get the zone
        Integer Zone = (Integer) countryToZoneMap.get(shippingCountry.getIsoCode2());
        if (Zone == null)
        {
            quote.setResponseText(rb.getString(MODULE_SHIPPING_ZONES_INVALID_ZONE));
            throw new KKException("The delivery address is not within a valid shipping zone");
        }


What you could do is to default to your fourth zone instead of throwing an exception.

Regards,

Julie
Title: Re: configuring zone shipping module
Post by: Anni on November 28, 2007, 02:56:52 pm
hi julie,

thanks for the answer. I've tried that and replaced the exception with:

Zone = new Integer(4); //formerly: Zone = 4;

but now I constantly get a numberFormatException. do you maybe start with 0 (e.g. 0=zone 1, 1=zone 2 etc.)? or could there be another problem?

regards, anni
Title: Re: configuring zone shipping module
Post by: julie on November 28, 2007, 03:03:28 pm
It should start with one. You by taking a look in the configurations table in the database you should see configurations that look like MODULE_SHIPPING_ZONES_COUNTRIES_1, MODULE_SHIPPING_ZONES_HANDLING_1, MODULE_SHIPPING_ZONES_COST_1 and then _2, _3 etc.

Regards,

Julie
Title: Re: configuring zone shipping module
Post by: Anni on November 28, 2007, 03:11:36 pm
ok,

but then, what could cause the problem?
Title: Re: configuring zone shipping module
Post by: julie on November 28, 2007, 03:15:29 pm
I'm not sure. You should track down where you get the exception and attempt to debug it.

-Julie
Title: Re: configuring zone shipping module
Post by: Anni on November 28, 2007, 03:16:15 pm
...just an idea. I've inserted the weight/costs for each zone with the admin app. but to make it better readable I always entered a space before the next value. may I do that or would the space be regarded as an invalid number?
Title: Re: configuring zone shipping module
Post by: Anni on November 28, 2007, 03:32:18 pm
deleting the spaces solved the issue with the exception but the shipping method still isn't displayed ??? before, I just thought this was due to the exception but now everything should work but nothing really changed ...
Title: Re: configuring zone shipping module
Post by: Anni on November 29, 2007, 10:49:52 am
restarting tomcat today made the shipping method show up ... but only for the primary address. when I select another delivery address, I only get the other available options...

another thing I noticed is, when you refresh the site, the primary address is selected again. can I change that somehow?

furthermore (might be a bug), the product weight isn't calculated correctly. for my testing I had two products in my cart - the weights are 1kg and 0.5kg. the shipping cost was calculated for 4.5kg although it should have taken the one for 1.5kg. and the displayed shipping cost was the one for packets of 5kg??? somehow that's a complete mix up ...

I'd be grateful for any comments or ideas to that problem.

regards,
anni
Title: Re: configuring zone shipping module
Post by: Anni on November 29, 2007, 12:42:46 pm
the weight calculation problem seems to be with the item that's only 0.5kg. if I only have one of those in my cart, the weight displayed at checkout is 3.5kg...
Title: Re: configuring zone shipping module
Post by: Anni on November 29, 2007, 12:53:09 pm
ok, found the problem with the calculation. it generally added 3kg to each package.

for the original topic: just letting the zone default to 4 if no corresponding country is found doesn't work for me  :'(

regards,
anni
Title: Re: configuring zone shipping module
Post by: trevor on November 29, 2007, 01:32:44 pm
Quote
ok, found the problem with the calculation. it generally added 3kg to each package.


That's the weight of the packaging material and can be configured in the admin app ( configuration>>shipping/packaging ).

Quote
for the original topic: just letting the zone default to 4 if no corresponding country is found doesn't work for me 


You need to debug the module to figure out what is happening in your case.
Title: Re: configuring zone shipping module
Post by: ryanlynch on November 16, 2008, 11:01:39 pm
Quote from: Anni on November 28, 2007, 02:56:52 pm
hi julie,

thanks for the answer. I've tried that and replaced the exception with:

Zone = new Integer(4); //formerly: Zone = 4;

but now I constantly get a numberFormatException. do you maybe start with 0 (e.g. 0=zone 1, 1=zone 2 etc.)? or could there be another problem?

regards, anni


I found the answer to this and it's not related to the new Integer(4).

NumberFormatException happens when the Zone n Handling Fee = null in the Admin App Modules/Shipping. Zone n Handling Fee has to have an int value.

This should probably be addressed in the next release.. it was pretty hard to track down.