Zen Cart Logo

shipping scheme

Views: 1,040

Results 1 to 10 of 10
18 Jun 2012, 12:40 AM
#1
rayl avatar

rayl

New Zenner

Join Date:
Jun 2009
Posts:
10
Plugin Contributions:
0

shipping scheme

ZC 1.5.0

I have tried finding an answer to my question, and will be deeply shamed if someone points out that my question has already been answered.

My boss sells t-shirts, short sleeve and long sleeve

For shipping the first shirt is $5 for short sleeve, and all additional short sleeved shirts are $1 extra each.
The first long sleeve shirt is $7 to ship, and all additional long sleeve shirts are $2 extra each.
If the order has both long and short then the long sleeve is the first shirt.

Example orders:
2 short sleeve shirts: total shipping $6 (5+1)
3 short sleeve shirts: total shipping $7 (5+1+1)
4 short sleeve shirts: total shipping $8 (5+1+1+1)

2 long sleeve shirts: total shipping $9 (7+2)
3 long sleeve shirts: total shipping $11 (7+2+2)
4 long sleeve shirts: total shipping $13 (7+2+2+2)

3 short sleeve and 1 long sleeve: total shipping $10 (7+1+1+1)
2 short sleeve and 2 long sleeve: total shipping $11 (7+2+1+1)
1 short sleeve and 1 long sleeve: total shipping $8 (7+1)

4 long sleeve shirts and 1 short sleeve shirt: total shipping $14 (7+2+2+2+1)

Anyone have any idea on how to accomplish this?

Ray

18 Jun 2012, 2:41 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: shipping scheme

How do you identify the Short Sleeve vs the Long Sleeve shirts? :unsure:

18 Jun 2012, 3:28 AM
#3
rayl avatar

rayl

New Zenner

Join Date:
Jun 2009
Posts:
10
Plugin Contributions:
0

Re: shipping scheme

Ajeh:

How do you identify the Short Sleeve vs the Long Sleeve shirts? :unsure:

Each shirt is individually identified in the store.

http://shirtcircuitinc.com

18 Jun 2012, 3:39 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: shipping scheme

Pretend I know nothing about your site and have no clue how to navigate in there ...

What is identifying Long Sleeve vs Short Sleeve shirts?

All I see is some text that sometimes says short but nothing that really flags the Product as being long or short sleeve ...

What about the other Products that do not seem to say long or short sleeve?

18 Jun 2012, 4:29 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: shipping scheme

You could use the Product Weight to control this ...

Set the Product Weight for Short Sleeve to 5.1 ...

Set the Product Weight for Long Sleeve to 7.2 ...

Customize the Flat Rate flat shipping file:
/includes/modules/shipping/flat.php

with the code in RED:

// class methods
    function quote($method = '') {
      global $order;

// bof: calculate shipping
$chk_short = 0;
$chk_long = 0;
$ship_charge = 0.00;
$chk_short = $_SESSION['cart']->in_cart_check('products_weight','5.1');
$chk_long = $_SESSION['cart']->in_cart_check('products_weight','7.2');

switch (true) {
  case ($chk_short > 0 && $chk_long == 0):
    $ship_charge = 5.00 + (($chk_short -1) * 1);
    break;
  case ($chk_long > 0 && $chk_short == 0):
    $ship_charge = 7.00 + (($chk_long -1) * 2);
    break;
  case ($chk_short > 0 && $chk_long > 0):
    $ship_charge = 7.00 + (($chk_long -1) * 2) + (($chk_short) * 1);
    break;
}

echo 'Comment out echos to not see them ...' . '<br>';
echo 'Short: ' . $chk_short . '<br>';
echo 'Long: ' . $chk_long . '<br>';
echo 'Shipping: ' . $ship_charge . '<br>';

      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
                                                     'cost' => $ship_charge)));
// eof: calculate shipping

      if ($this->tax_class > 0) {

After testing, you can comment out the echo section with two // in front of each of the 4 lines starting with echo ...

18 Jun 2012, 4:49 AM
#6
rayl avatar

rayl

New Zenner

Join Date:
Jun 2009
Posts:
10
Plugin Contributions:
0

Re: shipping scheme

Ajeh:

Pretend I know nothing about your site and have no clue how to navigate in there ...

What is identifying Long Sleeve vs Short Sleeve shirts?

All I see is some text that sometimes says short but nothing that really flags the Product as being long or short sleeve ...

What about the other Products that do not seem to say long or short sleeve?

===

Each shirt is identified as SS or LS, which is short hand for Short Sleeve and Long Sleeve.

Each individual shirt is identified as either SS (Short Sleeve) or LS (Long Sleeve).

If you select a shirt to order, it is either one or the other. There is no confusion except in the sense of the shorthand. In the many years of using this shorthand, there has never been to my knowledge any confusion on the part of the customer as to which sleeve length they are ordering.

18 Jun 2012, 1:02 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: shipping scheme

Trying to dig through the description is difficult ...

Using the Product Weight as the code for this is much easier, as I showed you in the code for this above ...

19 Jun 2012, 5:34 AM
#8
rayl avatar

rayl

New Zenner

Join Date:
Jun 2009
Posts:
10
Plugin Contributions:
0

Re: shipping scheme

I have modified flat.php as you indicated below.

I have set Flat Rate Shipping Module as my only shipping method.

Do I set the "Shipping Cost" ? If so, what do I set it to?

I think I had it set to $5.00 before, and that is what it shows now, but I do not know if it is now being controlled by the change in flat.php.

P.S. I see your point regarding your comment about the shirt sizes not being clear. It has made me plan to change the descriptions to be more verbose. First, I have to go back to each shirt and set the correct weight.

Thank you for your help.

Ajeh:

You could use the Product Weight to control this ...

Set the Product Weight for Short Sleeve to 5.1 ...

Set the Product Weight for Long Sleeve to 7.2 ...

Customize the Flat Rate flat shipping file:
/includes/modules/shipping/flat.php

with the code in RED:

// class methods
function quote($method = '') {
global $order;

// bof: calculate shipping
$chk_short = 0;
$chk_long = 0;
$ship_charge = 0.00;
$chk_short = $_SESSION['cart']->in_cart_check('products_weight','5.1');
$chk_long = $_SESSION['cart']->in_cart_check('products_weight','7.2');

switch (true) {
case ($chk_short > 0 && $chk_long == 0):
$ship_charge = 5.00 + (($chk_short -1) * 1);
break;
case ($chk_long > 0 && $chk_short == 0):
$ship_charge = 7.00 + (($chk_long -1) * 2);
break;
case ($chk_short > 0 && $chk_long > 0):
$ship_charge = 7.00 + (($chk_long -1) * 2) + (($chk_short) * 1);
break;
}

echo 'Comment out echos to not see them ...' . '<br>';
echo 'Short: ' . $chk_short . '<br>';
echo 'Long: ' . $chk_long . '<br>';
echo 'Shipping: ' . $ship_charge . '<br>';

$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
'cost' => $ship_charge)));
// eof: calculate shipping

if ($this->tax_class > 0) {

> 
> After testing, you can comment out the echo section with two **//** in front of each of the 4 lines starting with echo ...
19 Jun 2012, 1:10 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: shipping scheme

The Rate on the Flat Rate flat shipping module is no longer used on this code ...

You can test that by changing the amount to 7.50 and see if that is reflected in the code ...

Currently, if you have the echos still displaying, you should see the matching amounts to the Flat Rate shipping cost, example, on 1 long sleeve you would see:

Comment out echos to not see them ...
Short: 0
Long: 1
Shipping: 7

19 Jun 2012, 5:09 PM
#10
rayl avatar

rayl

New Zenner

Join Date:
Jun 2009
Posts:
10
Plugin Contributions:
0

Re: shipping scheme

Again, good to know information. And regarding displaying the output information, I commented out the first line, but left the other 3. Thanks.

Ajeh:

The Rate on the Flat Rate flat shipping module is no longer used on this code ...

You can test that by changing the amount to 7.50 and see if that is reflected in the code ...

Currently, if you have the echos still displaying, you should see the matching amounts to the Flat Rate shipping cost, example, on 1 long sleeve you would see: