Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Views: 6,327

Results 1 to 20 of 37
14 Jun 2011, 12:01 AM
#1
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Using v1.3.9e ZenCart
http://www.waterweedmat.com

I would like to sell 8 items via UPS according to their weight and destination - in addition to 1 item (a Rake) that I would like to ship at a flat rate (will go USPS but not necessary to calculate it through USPS).

If the customer orders one or more of the first 8 items, they get charged by total weight - if they want to also purchase a Rake, they get charged the total weight of the other items (that ship UPS) PLUS the flat rate for the Rake that will ship separately (via USPS).

How do I set this up?

Thank you very much.
Marlene

14 Jun 2011, 12:53 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

You could count the number of Rakes ...

Let's say the Rake is products_id 27 and the charge is $12.50 per Rake, you can customize the code with the code in red:

          $cost = preg_replace('/[^0-9.]/', '',  $cost);


// bof: add Rake charge
$chk_rakes = 0;
$chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
$chk_rakes = $chk_rakes * 12.50;

          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING + $chk_rakes) );
// eof: add Rake charge

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!

14 Jun 2011, 12:56 AM
#3
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Thank you for the code... I'd like to try that.
What file do i put that into?

Marlene

14 Jun 2011, 12:43 PM
#4
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

I did donate for a Starbucks Coffee... or a regular coffee AND a Donut. :smile:

14 Jun 2011, 2:24 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

If you want to customize the USPS shipping module, then you would be customizing the file:
/includes/modules/shipping/usps.php

with the Rake with Product Weight 0, this will add to the shipping the charge per Rake that you setup ...

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!

14 Jun 2011, 2:38 PM
#6
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Ok, but that means I would have to install the USPS module - which I would rather not do for one item. I just want to ship the rake at a flat rate - how I ship it can be transparent to the system - I can always put a "notice" on the item description that it will come in the mail.

So I would be using the UPS module, only on the rake, I would be charging a flat rate vs. the other items that would be shipped according to weight and destination.

Does that make sense?

If I turn the weight off (to 0) on the rake - is there a way to add a charge for shipping or handling or whatever ... on just that one item?

thanks again.

14 Jun 2011, 3:38 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Sorry ... then use the UPS shipping module and adjust the code for it ...
/includes/modules/shipping/ups.php

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!

14 Jun 2011, 3:40 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

If you calculate the Rake charge with the custom code:

// bof: add Rake charge
$chk_rakes = 0;
$chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
$chk_rakes = $chk_rakes * 12.50;

You can then add the $chk_rakes to the cost ...

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 Jun 2011, 1:07 AM
#9
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

THANK YOU! Just saw that last response. :)

24 Jun 2011, 1:30 AM
#10
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Sorry to be so ignorant... but I really don't know what I'm doing.

I added the code (that you wrote):

// bof: add Rake charge
$chk_rakes = 0;
$chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
$chk_rakes = $chk_rakes * 14.95;
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING + $chk_rakes) );
// eof: add Rake charge

To the end (before the ?>) of the ups.php file that is in in the Includes>Modules>Shipping file.

On my product (Water Weed Rake)... I changed the weight to 0.

When I check out, it is still calculating a UPS charge (without a weight!) but not using the $14.95 Flat Rate.

Do I have to change the "product_id" to '27' as you have in the code?... what is that? What else do I have to change in any of the files - or in the product itself.

Appreciate your help!

Marlene
https://www.waterweedmat.com
my email: [email protected]

24 Jun 2011, 11:20 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

You would probably need to customize the code further so that if the Rake is the only Product in the Cart then it does not use UPS at all but rather uses something like Item Rate item and turns off the UPS ...

You need the UPS module to add the charge for the $14.95 per Rake to regular UPS charges when other Products are in the cart ... but it sounds like you do not want to do this when the Rake is the only Product in the Cart ...

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 Jun 2011, 11:47 PM
#12
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Yes, that is correct.

If the rake is the only item in the cart - I do not want to use UPS at all - I just want a flat rate of $14.95 added as shipping costs.

How do I manage this?

Thank you.
Marlene

25 Jun 2011, 12:02 AM
#13
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

When testing the shopping cart... it seems to be adding $29.02 for shipping no matter what is purchased! Whether 5 lb. or 70 lb. item or rake at flat rate ($14.95)... now I'm really confused.:blink:

25 Jun 2011, 12:21 AM
#14
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

The more I try to figure ZenCart out the more confused I get.

I'm thinking that ZenCart is more for developers than web designers like myself.

I'm thinking about purchasing a "Cart66" license since my site is a WordPress website.

What do you think?

Do you think I will ever be able to make ZenCart work for me?

Does anyone have any experience with Cart66?

Is there a better WordPress plugin that utilizes live UPS rates, taxes, and multiple shipping options?

Thanks!
Marlene

25 Jun 2011, 12:35 AM
#15
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

If there is 1 Rake it is $14.95 ... what happens on 2 Rakes? 3 Rakes? 10 Rakes? Is it $14.95 per Rake? :unsure:

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 Jun 2011, 12:48 AM
#16
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

Good question! I don't know but will find out. Thanks for bringing that up.

25 Jun 2011, 6:03 PM
#17
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

My client says he wants $14.95 charged for each ... if the buyer wants more, he figures they will call him and then they'll work it out.

so I'm still at a point of standstill, however, since the shopping cart is charging a weird amount of shipping for the rake... $47.89, and the rake doesn't have any weight attached to it. Where is it picking up that amount?

The good news is, when I put a regular "ship by UPS" item in the cart, it actually charged the right amount and included the handling charge ($13.) that I have included in the UPS table.

What can I send you (besides the screenprint of PayPal showing the weird freight charge for the rake) that would help figure this out?

Thank you!
Marlene

25 Jun 2011, 6:07 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

You have so many threads going on your shipping that it is hard to say ...

First, go to the Modules ... Shipping ...

What shipping modules are installed?

NOTE: make sure that you do not have installed any shipping modules that you are not using ... meaning, if you are not using the shipping module, click on it once and see if you see the REMOVE button and if you do, click the REMOVE button ...

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 Jun 2011, 6:25 PM
#19
marlenef avatar

marlenef

New Zenner

Join Date:
Apr 2010
Posts:
41
Plugin Contributions:
0

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

how many threads do I have? That's weird.

Anyway - just a store pickup module, for people locally.

The UPS is coded yellow.

25 Jun 2011, 10:14 PM
#20
ajeh avatar

ajeh

Oba-san

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

Re: How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?

If you want $14.95 per Rake, then install the Item Rate item and customize the code:

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
      }

// bof: only show for Rakes
if (!IS_ADMIN_FLAG) {
  global $cart;
  $chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
  if ($chk_rakes != $_SESSION['cart']->count_contents()) {
    // turn off
    $this->enabled = false;
  }
}
// eof: only show for Rakes

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {

And set the Item Rate to 14.95 ...

This will only show when only Rakes are in the Cart ...

At the Top of the UPS shipping module, add this code so that it will not show when only Rakes are in the Cart ...

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
    }

// bof: do NOT if ONLY show for Rakes
if (!IS_ADMIN_FLAG) {
  global $cart;
  $chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
  if ($chk_rakes == $_SESSION['cart']->count_contents()) {
    // turn off
    $this->enabled = false;
  }
}
// eof: do NOT if ONLY show for Rakes

    if ($this->enabled) {

In the function quote, you should have:

        $cost = preg_replace('/[^0-9.]/', '',  $cost);

// bof: add Rake charge
$chk_rakes = 0;
$chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
$chk_rakes = $chk_rakes * 14.95;

        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING) + $chk_rakes );
      }

      $this->quotes['methods'] = $methods;

Now, if Rakes are only in the Cart the Item Rate will show ...

If this is a mixed cart, then $14.95 per Rake will be added to the Calculated UPS charges for the other Products ...

Make sure that Rakes products_id 27 has a 0 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!