Forums / General Questions / Help with different shipping rates for first and additional items???

Help with different shipping rates for first and additional items???

Locked

Views: 3,167

Results 1 to 20 of 52
This thread is locked. New replies are disabled.
23 Oct 2009, 10:14 PM
#1
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Help with different shipping rates for first and additional items???

Alright, I have checked the forum over as much as I can tolerate looking for the exact answer I need. I sell baseball cards, Hot Wheels, and Shoes. All of these have such drastically different weights that I cannot come up with a table rate by myself that would accomodate all of them without charging incorrectly for something.

One baseball card is $1.22 for S&H. A customer could add up to 4 more cards for that to go up $1.39 (I add .17 to the 1.22 for the one ounce increase in weight). Now here is where it gets tricky.

One hot wheels costs $2.07 for S&H and adding one more jumps that to 2.58 (I add .51 to the 2.07 for the three ounce increase in weight).

One pair of shoes is 11.57 for S&H. Adding a second pair goes up to 13.03 (I add 1.46 to the 11.57 for the two pound increase in weight).

Now we can all see that I can't just set up a table rate that will satisfy all of these different weights and spaces between first and second items. I tried different mathematical solutions, but all have failed and I am now here to find someone that actually knows what is more about Zen Cart instead of me just guessing. Any help will get my head to stop pounding. Thanks ahead of time!!

Kristofer Benham

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

24 Oct 2009, 4:34 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

This is based on counting the Products based on the master_categoriesid being the indicator for:
Cards master_categories_id 10
Hot Wheels master_categories_id 15
Shoes master_categories_id 12

What this does is break out the number of items sold and using the rates build the charges ...

I did get a bit lost on shoes as you went from count to weight, but this might give you some ideas ...

I just tossed this in the table.php shipping module just above the code that reads:
$this->quotes = array('id' => $this->code,

so that I could see the results without a lot of work ...

global $cart;
  $cnt_cards = $_SESSION['cart']->in_cart_check('master_categories_id','10');
  $card_ship = ceil($cnt_cards/4) * .17;
  $card_ship = $card_ship+ 1.05;

  $cnt_hotwheels = $_SESSION['cart']->in_cart_check('master_categories_id','15');
  $hotwheels_ship = ceil($cnt_hotwheels/4) * .51;
  $hotwheels_ship = $hotwheels_ship+ 1.56;

  $cnt_shoes = $_SESSION['cart']->in_cart_check('master_categories_id','12');
  $shoes_ship = ceil($cnt_shoes/4) * 1.46;
  $shoes_ship = $shoes_ship+ 11.56;
  echo '<br><br>CARDS: ' . $cnt_cards . ' = ' . $card_ship . '<br>';
  echo '<br><br>HOTWHEELS: ' . $cnt_hotwheels . ' = ' . $hotwheels_ship . '<br>';
  echo '<br><br>SHOES: ' . $cnt_shoes . ' = ' . $shoes_ship . '<br>';

Now I add a Product from each of the 3 categories and change the quantities ...

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 Oct 2009, 8:25 PM
#3
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

I tried what you had in the box and put it where you wanted me to. It did not work on my site. If I knew how to capture a screen shot, I would have. It changed the screen by lowering the store page to the lower left corner of the screen and entered three lines of text above the top of the Benham Collectibles logo that had to do with the prices for each category. It looked really weird. So I took it out and it went back to normal. Any other ideas? Basically I have three drastically different package sizes and can't use the tare, the perunitweight, zone or the table features. I am at a loss for what else can be done for a script because I know nothing about php or any other programming language. I do appreciate you trying to help me. I feel so confused on what to do.

Kristofer

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

24 Oct 2009, 10:58 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

Are the 3 Products in 3 different Categories or many categories?

What I was trying to do was find something common about them that could be tested when added to the shopping cart to know how many of each are in the cart to build a formula to calculate the shipping ...

On the Shoes, if you only sold shoes ... would you be able to use UPS or USPS for the shipping based on weight?

The idea that comes to mind here is to calculate the shipping for the Cards and Hotwheels different, as you say weight does not work for you ... and since Shoes are heavier, maybe weight does work for them ...

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 Oct 2009, 11:39 PM
#5
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

You're on the same track that I was on now, Ajeh. I was also trying to find a common thread among the three categories. Yes, those three examples are three categories. There will be more, but I can learn from anything you figure out and copy what you do now to any other additonal categories later.

I am not interested in using the real time USPS setup that is provided if that is what you were talking about and I don't use UPS to ship any of my small items, too much money.

I actually do use weight to figure all of my shipping. I think some confusion may have come earlier when you thought I was using count on the two smaller categories and weight on the shoes. I do actually use weight, ounces for cards and hot wheels and pounds for shoes. That is why it seemed to be such a difference. I kept typing 17¢. That is the USPS First Class price for an additional ounce on a package in the 1-13 ounce range. If anything is bigger, it goes to pounds and gets thrown to the Parcel Post scale which is much higher in price.

For the last 3 hours I have been trying to figure out how many cards a pair of shoes weighs just trying to find a common number to use for all, but I could not. This is because all three products have a different "first item weights". Cruising around on the web in just ran into something very close to what I would like. I will see if I can get the link in here:

http://www.github.com/BDQ/spree-flexi-rate-shipping

If this doesn't hyperlink, I apologize. The whole page pretty much explains perfectly what I would like. If you scroll down to the Examples section, you can see a chart that is almost exactly what I need. One big problem is I am hosted at GoDaddy and they don't support Ruby on Rails. I am just hoping that this may give you a better visual idea of what I am looking for. I have seen on these Zen boards that alot of other people are looking for the same thing. Let me know if this helps or if I need to keep at it. I know this is tough, but I am hoping that you see it as a challenge that you can overcome and use in the future for others that need help. Thanks again, Ajeh.

Kristofer Benham

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 12:01 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

The reason I suggested throw that code in with the table.php is that when you check shipping, it would echo the results ...

What that is doing is counting how many products are in those categories based on the master_categories_id ...

Go look at your products and get the master_categories_id for a Card, Hot Wheel and Shoes Product ...

Then we can set this up so you can see how this works ...

Once we get the pattern, I think you will be able to charge the way you want to on shipping ... it just takes a bit to get the hang of it ... :smile:

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!

25 Oct 2009, 12:47 AM
#7
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

I am pretty sure that the ID's you need are:

Baseball Cards 9
Hot Wheels 10
Shoes 11

Unless there is a number I am missing, these are what you need.

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 2:10 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

Let's try to test this ...

What will happen is when you look at Shipping Estimator or the checkout_shipping ... you will see it echo out the counts or Products in these categories_id where the Products use the matching master_categories_id ...

Edit the file:
/includes/modules/shipping/table.php

and change the function quote with this new code:

  /**
   * Enter description here...
   *
   * @param unknown_type $method
   * @return unknown
   */
  function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes, $total_count;

    // shipping adjustment
    switch (MODULE_SHIPPING_TABLE_MODE) {
      case ('price'):
        $order_total = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
        break;
      case ('weight'):
        $order_total = $shipping_weight;
        break;
      case ('item'):
        $order_total = $total_count - $_SESSION['cart']->free_shipping_items();
        break;
    }

    $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;

    $table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);
    $size = sizeof($table_cost);
    for ($i=0, $n=$size; $i<$n; $i+=2) {
      if (round($order_total,9) <= $table_cost[$i]) {
        if (strstr($table_cost[$i+1], '%')) {
          $shipping = ($table_cost[$i+1]/100) * $order_total_amount;
        } else {
          $shipping = $table_cost[$i+1];
        }
        break;
      }
    }

    if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
      $shipping = $shipping * $shipping_num_boxes;
      // show boxes if weight
      switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
        case (0):
        $show_box_weight = '';
        break;
        case (1):
        $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
        break;
        case (2):
        $show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . TEXT_SHIPPING_WEIGHT . ')';
        break;
        default:
        $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . TEXT_SHIPPING_WEIGHT . ')';
        break;
      }
    }


global $cart;
  $cnt_cards = $_SESSION['cart']->in_cart_check('master_categories_id','9');
  $card_ship = ceil($cnt_cards/4) * .17;
  $card_ship = $card_ship+ 1.05;

  $cnt_hotwheels = $_SESSION['cart']->in_cart_check('master_categories_id','10');
  $hotwheels_ship = ceil($cnt_hotwheels/4) * .51;
  $hotwheels_ship = $hotwheels_ship+ 1.56;

  $cnt_shoes = $_SESSION['cart']->in_cart_check('master_categories_id','11');
  $shoes_ship = ceil($cnt_shoes/4) * 1.46;
  $shoes_ship = $shoes_ship+ 11.56;
  echo '<br><br>CARDS: ' . $cnt_cards . ' = ' . $card_ship . '<br>';
  echo '<br><br>HOTWHEELS: ' . $cnt_hotwheels . ' = ' . $hotwheels_ship . '<br>';
  echo '<br><br>SHOES: ' . $cnt_shoes . ' = ' . $shoes_ship . '<br>';
  
    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
    'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));

    if ($this->tax_class > 0) {
      $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    }

    if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);

    return $this->quotes;
  }

Again, it will look messie ... we care about the counts based on what you put in your cart ...

Don't worry about the quote yet ... first let's see if this identifies the number of Products in the cart for each of the 3 kinds ...

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!

25 Oct 2009, 2:28 AM
#9
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

How do I do a screen shot?

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 2:37 AM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

Hit PrntScrn ... now paste that into an image program as a new file ...

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!

25 Oct 2009, 2:38 AM
#11
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

It is doing something wrong. It is showing 0.00 dollar as the best way for shipping. It has these lines on the shopping cart screen below the ;back to shopping' button:

CARDS: 0 = 1.05

HOTWHEELS: 0 = 1.56

SHOES: 0 = 11.56

CARDS: 0 = 1.05

HOTWHEELS: 0 = 1.56

SHOES: 0 = 11.56

Do I need to do something to the table rate or something else???? I have nothing in the table rate box because I don't know what to put in it. I am not sure what should be in place for this to work.

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 2:42 AM
#12
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

print screen button alone is not working, don't I need to push something else at the same time??

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 2:47 AM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

For now, this is fine ... we are just looking for counts ...

Now add 1 Hot Wheel ... 1 Card ... and 1 Shoes ...

Now test the amounts displayed by raising the Hot Wheels to 2, then 3, then 4, then 5 ... all the way to 20 ... are the rates right for the Hot Wheel?

Do the same on the Cards ...

I don't know if the shoes will work with this formula, as it sounds like you want a different formula for them ... but try it for fun ...

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!

25 Oct 2009, 2:54 AM
#14
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

No, nothing is increasing when I add any amount of any item. The shipping still says 0.00. I have a screenshot now. How should I get it to you? I think if you see what it is doing, it will definitely help. I know what I am seeing is not right, but I need you to see it so you know what to do with it.

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 3:08 AM
#15
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

http://s188.photobucket.com/albums/z12/kristoferbenham/Random%20Stuff/?action=view&current=ScreenshotBC.jpg

This should do the trick. Below the back to shopping button is what I know shouldn't be there.

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 3:39 AM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

I am afraid I cannot see anything from a screen shot ...

From what I can see you need to either be in the shipping estimator or the checkout_shipping with the Table Rates shipping module installed to see this work ...

But I cannot tell if you have this installed right or not ...

Without actually setting this up I am not sure how to help you further ...

This code:

global $cart;
  $cnt_cards = $_SESSION['cart']->in_cart_check('master_categories_id','9');
echo 'Cards: ' . $cnt_cards;

Should tell you how many Products are in the cart that have the master_categories_id 9 ...
$cnt_cards would display the value ...

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!

25 Oct 2009, 3:56 AM
#17
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

Here is what mine say right now for just the cards:

global $cart;
$cnt_cards = $_SESSION['cart']->in_cart_check('master_categories_id','9');
$card_ship = ceil($cnt_cards/4) * .17;
$card_ship = $card_ship+ 1.05;

I know it has been very difficult to work with not knowing what is happening on this end. I do appreciate you trying to help me. you are the only one that I got any help from. Not sure what to do now. Pretty sure all the other open source carts don't have the shipping feature that I need either. The only thing I can think of now is to set up 3 different stores for the three different categories, each in its own store. I had someone else do that for me once before, but it was really hard to manage and it was OSCommerce so it didn't have all the extras that this Zen has. When God wants me to have this, He will provide a way for me to get it to work. Thanks again for being patient with me, Ajeh.

Kristofer Benham

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 3:29 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Help with different shipping rates for first and additional items???

The problem you are having is that you are not using the Product's master_categories_id

I also changed the formula a bit to account for when 0 so that didn't need a lot of change, example for cards to work with 2 categories:

  $cnt_cards = $_SESSION['cart']->in_cart_check('master_categories_id','17'); // 2009 Allen & Ginter Base Cards
  $cnt_cards = $cnt_cards + $_SESSION['cart']->in_cart_check('master_categories_id','13'); // 2009 Topps Base Cards
  $card_ship = ceil($cnt_cards/4) * .17;
  $card_ship = ($card_ship == 0 ? 0.00 : $card_ship+ 1.05);

Based on your site, and that this is going to be a lot more categories than this method is easily used for, you may want to alter it somewhat ...

If you are not using the products_model then this field would be ideal to use:
cards
hotwheels
shoes

as the content of the products_models field ... then the checks can be done with:

$cnt_cards = $_SESSION['cart']->in_cart_check('products_model','cards');
  $cnt_hotwheels = $_SESSION['cart']->in_cart_check('products_model','hotwheels');
  $cnt_shoes = $_SESSION['cart']->in_cart_check('products_model','shoes');

Meanwhile, try the code as it is setup now with the changes I added to your site to see how this works ...

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!

25 Oct 2009, 8:06 PM
#19
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

I follow some of what you said below. I will just try it out this way and see how it works at this moment. I will report any descrepancies or mistakes to you ASAP. And no, I do not like using the model number box. It make sme have to make up a model number for 150,000 cards alone, plus Hot Wheels and any shoes I may get. I hope that helps you in making this a little easier. Thank you for your help on this project.

Kristofer

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com

25 Oct 2009, 8:17 PM
#20
benhamcollectibles avatar

benhamcollectibles

Zen Follower

Join Date:
Oct 2009
Posts:
131
Plugin Contributions:
0

Re: Help with different shipping rates for first and additional items???

Well, on the first test run, I see that the counters that are on the cart screen are actually counting the items as I increase them. But there is still no shipping total at the bottom of the screen (best way 0.00). Do I need to set up a table rate now or just leave it alone? I like the idea of the models box being used kinda like a categorizer for shipping purposes. Not sure what else to test without some input from you on what I should do now.

Kris

Here is a link to my site if this will help anyone that needs to see how things look.

https://www.benhambaseballcards.com