Forums / Built-in Shipping and Payment Modules / Shipping Question - How to setup up to 4 items per shipping charge

Shipping Question - How to setup up to 4 items per shipping charge

Started by ringlis1 on 24 Sep 2014, 7:11 PM · Views: 1,182

Results 1 to 8 of 8
24 Sep 2014, 7:11 PM
#1
ringlis1 avatar

ringlis1

New Zenner

Join Date:
Sep 2014
Location:
California
Posts:
3
Plugin Contributions:
0

Shipping Question - How to setup up to 4 items per shipping charge

Hello,

I have a new product that I would like to sell in my cart. However, my drop shipper allows for 4 items to ship for 1 price. Does anyone have a good idea how to make this work?

So if they purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges.

This is only for 1 type of product, so the changes cannot affect other items.

24 Sep 2014, 9:46 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Shipping Question - How to setup up to 4 items per shipping charge

What shipping modules do you have installed in Modules ... Shipping ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Sep 2014, 10:11 PM
#3
ringlis1 avatar

ringlis1

New Zenner

Join Date:
Sep 2014
Location:
California
Posts:
3
Plugin Contributions:
0

Re: Shipping Question - How to setup up to 4 items per shipping charge

I currently use Zone Rates, which is set up for USA is one shipping cost and everything else is another shipping cost.

I have activated "Per Unit" to see if that might work, but, I don't see how to make the settings work. I have also tried "Per Item", but again, cannot get the settings to work using every 4 items is a shipping cost.

24 Sep 2014, 10:29 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Shipping Question - How to setup up to 4 items per shipping charge

What is your Zone Shipping based on? Price, Item or Weight?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Sep 2014, 11:22 PM
#5
ringlis1 avatar

ringlis1

New Zenner

Join Date:
Sep 2014
Location:
California
Posts:
3
Plugin Contributions:
0

Re: Shipping Question - How to setup up to 4 items per shipping charge

The Zone Rates are set to calculate by weight. ( 20:25.00) for zone 1 (20:55.00) for zone 2 and (20:105.00) for zone 3

25 Sep 2014, 12:34 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Shipping Question - How to setup up to 4 items per shipping charge

Edit the shipping module:
/includes/modules/shipping/zones.php

You could try this custom code in RED:

[B]// bof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges.
$chk_products_id = 180; // products_id of product to charge special charge
$extra_charges = 12.00; // charge for each extra charge group
$chk_product_quantity = $_SESSION['cart']->get_quantity($chk_products_id);
switch (true) {
  case ($chk_product_quantity < 5):
    $extra_shipping = $extra_charges;
    break;
  case ($chk_product_quantity <= 7):
    $extra_shipping = $extra_charges * 2;
    break;
  case ($chk_product_quantity <= 9):
    $extra_shipping = $extra_charges * 3;
    break;
  default:
    $extra_shipping = 0.00; // nothing set for 5, 7 or 9 so no charge
    break;
}
[/B]      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => $shipping_method,
                                                     'cost' => $shipping_cost[B] + $extra_shipping[/B])));
[B]// eof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges.
[/B]

Set the settings on:
$chk_products_id <-- your products_id number
$extra_charges <-- amount you want to charge per group

Change the settings in your Zone Rates zones shipping module to:
Zone 1 0:0.00;20:25.00
Zone 2 0:0.00;20:55.00
Zone 3 0:0.00;20:105.00

Be aware on order weights over 20lbs, your settings will have no charges and the shipping will calculate to $0.00 ...

If you always want to have those charges, change 20 to a high value such as 10000 ...

In the Configuration ... Shipping/Packaging ... make sure that you have set the two Tare Rates to 0:0 so that they do not add more weight ...

Set to 0 the settings for:

Order Free Shipping 0 Weight Status
If there is no weight to the order, does the order have Free Shipping?
0= no
1= yes
Note: When using Free Shipping, Enable the Free Shipping Module this will only show when shipping is free.

See if that works for you ...

Be aware that the settings you wanted for the extra charges for the special Product only covers to quantity 9, if someone adds quantity 10, it will calculate $0.00 on the extra charges ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

27 Sep 2014, 3:44 AM
#7
eagleeye avatar

eagleeye

New Zenner

Join Date:
Jan 2008
Location:
MD, USA
Posts:
9
Plugin Contributions:
0

Re: Shipping Question - How to setup up to 4 items per shipping charge

Ajeh:

Edit the shipping module:
/includes/modules/shipping/zones.php

You could try this custom code in RED:

[B]// bof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges.
$chk_products_id = 180; // products_id of product to charge special charge
$extra_charges = 12.00; // charge for each extra charge group
$chk_product_quantity = $_SESSION['cart']->get_quantity($chk_products_id);
switch (true) {
case ($chk_product_quantity < 5):
$extra_shipping = $extra_charges;
break;
case ($chk_product_quantity <= 7):
$extra_shipping = $extra_charges * 2;
break;
case ($chk_product_quantity <= 9):
$extra_shipping = $extra_charges * 3;
break;
default:
$extra_shipping = 0.00; // nothing set for 5, 7 or 9 so no charge
break;
}
[/B]
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_method,
'cost' => $shipping_cost[B] + $extra_shipping[/B])));
[B]// eof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges.
[/B]


Try this as it accounts for any number of items and automaticly rounds up.

<? // bof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges. $chk_products_id = 180; // products_id of product to charge special charge $extra_charges = 12.00; // charge for each extra charge group $chk_product_quantity = $_SESSION['cart']->get_quantity($chk_products_id); $item_count = ceil(($chk_product_quantity / 4)) $extra_shipping = $extra_charges * $item_count; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost + $extra_shipping))); // eof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges. ?>
27 Sep 2014, 12:57 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Shipping Question - How to setup up to 4 items per shipping charge

Thanks for the update that this is working for you and for the changes you were able to incorporate ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!