Forums / Setting Up Categories, Products, Attributes / Zone shipping for a single product

Zone shipping for a single product

Views: 8,153

Results 1 to 9 of 9
26 Jun 2016, 5:18 PM
#1
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Zone shipping for a single product

I'm not certain I really understand what the zone shipping does, but what I need to do is set up zones which would all have the same shipping rate regardless of the address within the zone. I see how to add states to each of the three zones, and have done that. But I don't see how to apply zone shipping to a single specific product. Is that even possible?

27 Jun 2016, 8:04 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Zone shipping for a single product

HeleneWallis:

I'm not certain I really understand what the zone shipping does, but what I need to do is set up zones which would all have the same shipping rate regardless of the address within the zone. I see how to add states to each of the three zones, and have done that. But I don't see how to apply zone shipping to a single specific product. Is that even possible?

Yes, it is possible, but not via any settings (that I'm aware of).

Unless you are trying to prevent/allow specific products to specific zones, I'm not really sure what you are trying to achieve with this.

If you could do what you are seeking, what would you expect the outcome to be if a customer in Zone 'x' adds two products to their cart, one product with zone 'y' rates and another with zone 'z' rates? Or am I misinterpreting what you are trying to achieve?

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

27 Jun 2016, 1:47 PM
#3
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Zone shipping for a single product

RodG:

If you could do what you are seeking, what would you expect the outcome to be if a customer in Zone 'x' adds two products to their cart, one product with zone 'y' rates and another with zone 'z' rates? Or am I misinterpreting what you are trying to achieve?

What I hoped zone shipping would accomplish would be to allow zones and their rates to be associated with a product. In my case, I'd define three zones that would include all the states and the US territories. It wouldn't matter which product a customer chose, if that product had zone shipping, because the customer's shipping address would determine which zone was applied. Looks like that's not how it works. Oh well. Thanks anyway.

28 Jun 2016, 7:12 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Zone shipping for a single product

HeleneWallis:

Looks like that's not how it works. Oh well. Thanks anyway.

Try this for size --- Lets assume that your store has 1000 products. Let us also assume that you have 4 shipping zones.

If I am reading your needs correctly, this means that you will need to enter 4000 different prices for shipping. (1 price per product, per zone) - That is a lot of data entry, and since shipping rates tend to change every 6-12months, that is also a lot of maintenance.

On the other hand, the standard zone rates module has options so that you can base the zone rates by weight, price, or per item basis. If you have 4 zones, you basically need to only enter 4 different prices. These 4 prices, in conjuction with the 'Weight, Price or Item' settings provide a means to provide similar results to what you are seeking, with a lot less effort and maintenance.

Your proposed method has another shortcoming - if your shipping costs are based on the product, it means that your customers would never benefit from combined shipping. The costs will be purely additive. Some merchants prefer this, many others prefer to offer combined shipping to help increase sales. Customers prefer combined shipping.

Furthermore - most shipping companies charge by weight - so this being the case, by using the 'by Weight' method in the std zones module (and giving your products accurate weights) will provide good quotes to all customers in all zones, no matter how many (or how heavy) the individual products weigh. No need for you to enter the theortetical 4000 different costs that would negate any combined shipping.

So, please ask yourself again - is what you say you want really what you want, or are you just going to be making a lot of work for yourself with no real benefit? I suspect the latter.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

28 Jun 2016, 8:35 AM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Zone shipping for a single product

HeleneWallis:

What I hoped zone shipping would accomplish would be to allow zones and their rates to be associated with a product. In my case, I'd define three zones that would include all the states and the US territories. It wouldn't matter which product a customer chose, if that product had zone shipping, because the customer's shipping address would determine which zone was applied. Looks like that's not how it works. Oh well. Thanks anyway.

As built and like RodG was saying, the code doesn't offer a specific application of a shipping module to a product, or any variation of that. But, it is built to support adding such code. Personally I was hoping that one of the below related links might offer the routine questions that are asked (but then RodG asked them :P). One thing not really answered though is what is to happen if a purchase includes one of the products to be applied to the special zone rate as well as a product not normally to be provided that zone rate? Should the zone based shipping option be available to be applied against the entire order or should it not exist?

Generally speaking in the quote section of the code is where some additional code could be added to disable a method if it doesn't meet desired conditions. In this case, it would be likely somewhere in this region that such code could be added:

      for ($i=1; $i<=$this->num_zones; $i++) {
        $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
        $countries_table = strtoupper(str_replace(' ', '', $countries_table));
        $country_zones = preg_split("/[,]/", $countries_table);
        if (in_array($dest_country, $country_zones)) {
          $dest_zone = $i;
          break;
        }
        if (in_array('00', $country_zones)) {
          $dest_zone = $i;
          break;
        }
      }

BTW, if there are # symbols, ignore them/treat them like spaces. I copied the above code from github and sometimes spaces get replaced with # symbols when I do so.

So in that region, it seems (and untested) that during the loop if the product in the $order variable (should be looped through as well) is not going to the applicable zone then the $dest_zone should be set to 0. This will cause the applicable zone rate to be disabled.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

1 Jul 2016, 11:22 PM
#6
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Zone shipping for a single product

As I said in the original question, I want to do this for only one product. So no great amount of maintenance would be needed. It would ship by USPS first class, since it's under 15 ounces. I could just do free shipping, but I don't want to increase the product price to cover the cost of shipping. People tend to look at the price and decide they don't want the product, without considering the fact that they aren't paying any shipping. I'm also dealing with the fact that they can get this product cheaper anyway, but they would have to order it direct from Australia and wait for it to be delivered. The benefit I can offer is that I'll be stocking it in the US and can have it in the mail the same day they order it.

But it's clear the zone shipping isn't going to do what I want, so I'll leave things as they are for the moment.

Thanks for the information.

RodG:

Try this for size --- Lets assume that your store has 1000 products. Let us also assume that you have 4 shipping zones.

If I am reading your needs correctly, this means that you will need to enter 4000 different prices for shipping. (1 price per product, per zone) - That is a lot of data entry, and since shipping rates tend to change every 6-12months, that is also a lot of maintenance.

On the other hand, the standard zone rates module has options so that you can base the zone rates by weight, price, or per item basis. If you have 4 zones, you basically need to only enter 4 different prices. These 4 prices, in conjuction with the 'Weight, Price or Item' settings provide a means to provide similar results to what you are seeking, with a lot less effort and maintenance.

Your proposed method has another shortcoming - if your shipping costs are based on the product, it means that your customers would never benefit from combined shipping. The costs will be purely additive. Some merchants prefer this, many others prefer to offer combined shipping to help increase sales. Customers prefer combined shipping.

Furthermore - most shipping companies charge by weight - so this being the case, by using the 'by Weight' method in the std zones module (and giving your products accurate weights) will provide good quotes to all customers in all zones, no matter how many (or how heavy) the individual products weigh. No need for you to enter the theortetical 4000 different costs that would negate any combined shipping.

So, please ask yourself again - is what you say you want really what you want, or are you just going to be making a lot of work for yourself with no real benefit? I suspect the latter.

Cheers
RodG

1 Jul 2016, 11:30 PM
#7
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Zone shipping for a single product

You're right, of course, that a combined order would be a problem. The program would have to subtract the weight of any product that had zone shipping before talking to USPS or UPS or whoever was supplying the shipping costs. More complicated than I have time to deal with at the moment, for sure.

A company that I deal with regularly on the west coast of the US actually does this, though. It's where I got the idea from. But they're big enough that they probably have their own IT department and a custom written shopping cart. I'll drop the idea for now, but may keep it in mind for the future.

mc12345678:

As built and like RodG was saying, the code doesn't offer a specific application of a shipping module to a product, or any variation of that. But, it is built to support adding such code. Personally I was hoping that one of the below related links might offer the routine questions that are asked (but then RodG asked them :P). One thing not really answered though is what is to happen if a purchase includes one of the products to be applied to the special zone rate as well as a product not normally to be provided that zone rate? Should the zone based shipping option be available to be applied against the entire order or should it not exist?

2 Jul 2016, 12:03 AM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Zone shipping for a single product

mc12345678:

As built and like RodG was saying, the code doesn't offer a specific application of a shipping module to a product, or any variation of that. But, it is built to support adding such code. Personally I was hoping that one of the below related links might offer the routine questions that are asked (but then RodG asked them :P). One thing not really answered though is what is to happen if a purchase includes one of the products to be applied to the special zone rate as well as a product not normally to be provided that zone rate? Should the zone based shipping option be available to be applied against the entire order or should it not exist?

Generally speaking in the quote section of the code is where some additional code could be added to disable a method if it doesn't meet desired conditions. In this case, it would be likely somewhere in this region that such code could be added:

  for ($i=1; $i<=$this->num_zones; $i++) {
    $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
    $countries_table = strtoupper(str_replace(' ', '', $countries_table));
    $country_zones = preg_split("/[,]/", $countries_table);
    if (in_array($dest_country, $country_zones)) {
      $dest_zone = $i;
      break;
    }
    if (in_array('00', $country_zones)) {
      $dest_zone = $i;
      break;
    }
  }
> 
> BTW, if there are # symbols, ignore them/treat them like spaces. I copied the above code from github and sometimes spaces get replaced with # symbols when I do so.
> 
> So in that region, it seems (and untested) that during the loop if the product in the $order variable (should be looped through as well) is not going to the applicable zone then the $dest_zone should be set to 0. This will cause the applicable zone rate to be disabled.

In that case:
  for ($i=1; $i<=$this->num_zones; $i++) {
    $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
    $countries_table = strtoupper(str_replace(' ', '', $countries_table));
    $country_zones = preg_split("/[,]/", $countries_table);
    $prod_present = false;
    foreach ($order->products as $prod_data) {
     if ($prod_data['id'] == [b]75[/b]) {
       $prod_present = true;
       break;
     }
   }
   if (!$prod_present) {
     $dest_zone = 0;
     continue;
   }
    if (in_array($dest_country, $country_zones)) {
      $dest_zone = $i;
      break;
    }
    if (in_array('00', $country_zones)) {
      $dest_zone = $i;
      break;
    }
  }

Although untested, I think this would at least address being offered if the product is present in the cart. With a little mod it could be made to be inactive if there is anything else in the cart. As to some sort of "subtraction" the standard ZC shipping modules don't tend to offer a single purchase to be split across multiple shipping options. There are ways to adjust for various considerations and outside software for this type thing, but at least ZC gets one started with some sort of shipping option(s).

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Jul 2016, 12:46 PM
#9
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Zone shipping for a single product

Thanks, I'll keep this in mind for the future, and also for when I'm more competent with php than I am so far, lol. Once I don't have to spend every waking hour making the transition to the new shopping cart, I'll have time to do more with the software itself.