Zen Cart Logo
Forums / Addon Shipping Modules / Shipping and Pre-Order/Upcoming Items

Shipping and Pre-Order/Upcoming Items

Locked

Views: 3,739

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
15 Jun 2010, 3:43 AM
#1
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Shipping and Pre-Order/Upcoming Items

We are having trouble charging fair shipping rates for items we have available for Pre-Orders/upcoming products.

Currently we are charging shipping on a per-item basis which works out great for items we have in stock. The problem comes in when customers order Pre-Order products and current items in stock at the same time.

We are an online comic boos store ... so for instance a customer may order 5 comic books and of those five one may be currently in stock, one may be released next month and than the next one released the next month and so on. We have t ship them as they are released.

Now if the customer orders all five comics that are in stock they pay one shipping charge with their order for the number of comics they ordered and I ship the comics.

But if they order comics that are to be shipped on consecutive months they still pay the one shipping charge, but we will have to ship the comics individually each month and our shipping charges will be much more than was paid at the time of the order.

Is there anything we can do to have separate shipping charges apply to pre-order products so when customers order them they are paying for the shipping for each individual comic. Basically an extra shipping fee that can be added to pre-order products only.

Our site is Comic Mega Store

Your help will be GREATLY Appreciated!

15 Jun 2010, 4:29 AM
#2
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

I also wanted to mention that we are currently using the Zone Rate shipping module calculated by item.

15 Jun 2010, 1:57 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

Are you using the Date Available: (products_date_available field from the products table) to determine which of these Products needs the extra charge?

If so, you could customize the shipping module to calculate how many of the Products in the cart have a products_date_available set for greater than the current date and then calculate an additional charge for them to be added to the current shipping charge ...

It sounds like you need a an item charge based on products_date_available ...

This might be a bit tricky to write but it can be done ...

15 Jun 2010, 3:13 PM
#4
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

Ajeh:

Are you using the Date Available: (products_date_available field from the products table) to determine which of these Products needs the extra charge?

If so, you could customize the shipping module to calculate how many of the Products in the cart have a products_date_available set for greater than the current date and then calculate an additional charge for them to be added to the current shipping charge ...

It sounds like you need a an item charge based on products_date_available ...

This might be a bit tricky to write but it can be done ...

Thank you for responding to our post!

I do use the date available field. And an item charge based on products_date_available sounds like what we need, but unfortunately we have no idea how to implement this to work.

I was thinking for each pre-ordered item a shipping charge of $2.50 added for that item. Though, if a customer orders 5 of one particular pre-order item the charge should still only be $2.50.

Also if it makes things easier I could create a product category called "Pre-Order" and as the dates become current move the products to their proper category.

I have a basic understanding of programing and PHP, but am far from an expert. This is hurting us so we need all the help we could get!

15 Jun 2010, 3:50 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

If this Pre-Order category was the master_categories_id it would be easier if it were a charger per product x quantity ...

Let's say the categories_id was 10 ... if you had:
1 x Product 3
3 x Product 4
5 x Product 12

You would get from:
$_SESSION['cart']->in_cart_check('master_categories_id','10')

the quantity 9 ...

If you need to do this in a different manner where you want to charge 1 amount per Product vs Quantity, then you would need to work a more complex test for computing the charge ...

15 Jun 2010, 3:58 PM
#6
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

Ajeh:

If this Pre-Order category was the master_categories_id it would be easier if it were a charger per product x quantity ...

Let's say the categories_id was 10 ... if you had:
1 x Product 3
3 x Product 4
5 x Product 12

You would get from:
$_SESSION['cart']->in_cart_check('master_categories_id','10')

the quantity 9 ...

If you need to do this in a different manner where you want to charge 1 amount per Product vs Quantity, then you would need to work a more complex test for computing the charge ...

This way is a lot better than the way we have it now and I think it could work. I am going to create a master category "Pre-Order" now and add a few of the pre-orders.

Once this is done ... I'm not sure what to do next?

15 Jun 2010, 4:10 PM
#7
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

comicmegastore:

This way is a lot better than the way we have it now and I think it could work. I am going to create a master category "Pre-Order" now and add a few of the pre-orders.

Once this is done ... I'm not sure what to do next?

OK, I just created a pre-order category and added a couple of the pre-order products. The category id is "123". I have it set as disabled for now until I understand what to do next.

Thanks for all your help!

15 Jun 2010, 4:39 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

This code change to the Zone Rate zones shipping module:
/includes/modules/shipping/zones.php

// bof: add additional charge for categories_id 123
      global $cart;
      $chk_products_upcoming = $_SESSION['cart']->in_cart_check('master_categories_id','123');
      $extra_charge = $chk_products_upcoming * 2.50;

      $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_charge)));
// eof: add additional charge for categories_id 123

Would add an additional charge per item per quantity for Products using the master_categories_id 123 ...

If using Item Rate item you would change the code in:
/includes/modules/shipping/item.php

to read:

// bof: add additional charge for categories_id 123
      global $cart;
      $chk_products_upcoming = $_SESSION['cart']->in_cart_check('master_categories_id','123');
      $extra_charge = $chk_products_upcoming * 2.50;

      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
                                                     'cost' => (MODULE_SHIPPING_ITEM_COST * $item_total_count) + MODULE_SHIPPING_ITEM_HANDLING + $extra_charge)));
// eof: add additional charge for categories_id 123
15 Jun 2010, 4:40 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

NOTE: if you do not want the initial charge for the Item Count, you need to subtract the $chk_products_upcoming from the Item count being used in these modules to calculate the charges for the Upcoming Products totally separate from the other Products in the cart ...

15 Jun 2010, 4:53 PM
#10
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

Ajeh:

NOTE: if you do not want the initial charge for the Item Count, you need to subtract the $chk_products_upcoming from the Item count being used in these modules to calculate the charges for the Upcoming Products totally separate from the other Products in the cart ...

Wow this is great! I did not think I would be resolving this problems so soon!

Where should I insert the above code in the zones.php

15 Jun 2010, 4:59 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

Search for the:
$this->quotes = array(

that matches the one I posted ... then look at the changes to the code for that same seaction that I posted ...

15 Jun 2010, 11:03 PM
#12
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

Ajeh:

Search for the:
$this->quotes = array(

that matches the one I posted ... then look at the changes to the code for that same seaction that I posted ...

I'm having trouble getting this to work. I changed the code and uploaded it over the old file. I am using zone shipping calculated by item. Also (I don't know if this makes a difference) I changed the upcoming products so they would read "Pre-Order Items" on the main page.

Here is exactly how I have it on the zones.php file:

            

  // don't charge per box when done by Price

              $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);

            break;

        	  case (MODULE_SHIPPING_ZONES_METHOD == 'Item'):

              // don't charge per box when done by Item

              $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);

            break;

          }

        }

      }

	 
	 // bof: add additional charge for categories_id 123
      global $cart;
      $chk_products_upcoming = $_SESSION['cart']->in_cart_check('master_categories_id','123');
      $extra_charge = $chk_products_upcoming * 2.50;

	  
      $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_charge)));
	  // eof: add additional charge for categories_id 123
	  


      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);



      if (strstr(MODULE_SHIPPING_ZONES_SKIPPED, $dest_country)) {

        // don't show anything for this country

Please stick with me ... I'll get this!

I'm not sure if this helps, but our exact site is Comic Mega Store and I have the pre-order category active for testing.

16 Jun 2010, 12:28 AM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

What are your settings in the Zones Rate zones shipping module?

16 Jun 2010, 1:08 AM
#14
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

Ajeh:

What are your settings in the Zones Rate zones shipping module?

This is how I have it set.

Enable Zones Method
Do you want to offer zone rate shipping?

True
False

Calculation Method
Calculate cost based on Weight, Price or Item?

Weight
Price
Item

Tax Class
Use the following tax class on the shipping fee.
None

Tax Basis
On what basis is Shipping Tax calculated. Options are
Shipping - Based on customers Shipping Address
Billing Based on customers Billing address
Store - Based on Store address if Billing/Shipping Zone equals Store zone

Shipping
Billing
Store

Sort Order
Sort order of display.
0

Skip Countries, use a comma separated list of the two character ISO country codes
Disable for the following Countries:
DZ,AS

Zone 1 Countries
Comma separated list of two character ISO country codes that are part of Zone 1.
Set as 00 to indicate all two character ISO country codes that are not specifically defined.
US

Zone 1 Shipping Table
Shipping rates to Zone 1 destinations based on a group of maximum order weights/prices. Example: 3:8.50,7:10.50,... Weight/Price less than or equal to 3 would cost 8.50 for Zone 1 destinations.
You can end the last amount as 10000:7% to charge 7% of the Order Total
1:2.95,2:5.50,6:6.50,11:7.50,16:8.75,26:13.75,50:15.75,10000:3%

Zone 1 Handling Fee
Handling Fee for this shipping zone
None

Zone 2 Countries
Comma separated list of two character ISO country codes that are part of Zone 2.
Set as 00 to indicate all two character ISO country codes that are not specifically defined.
IE,ES,AU,GB,NL,FR,FI,PT,NZ,NO,IT,BR,CA

Zone 2 Shipping Table
Shipping rates to Zone 2 destinations based on a group of maximum order weights/prices. Example: 3:8.50,7:10.50,... Weight/Price less than or equal to 3 would cost 8.50 for Zone 2 destinations.
You can end the last amount as 10000:7% to charge 7% of the Order Total
1:12.25,2:22.99,11:85.99,76:95.99,10000:275.99

Zone 2 Handling Fee
Handling Fee for this shipping zone

Zone 3 Countries
Comma separated list of two character ISO country codes that are part of Zone 3.
Set as 00 to indicate all two character ISO country codes that are not specifically defined.

Zone 3 Shipping Table
Shipping rates to Zone 3 destinations based on a group of maximum order weights/prices. Example: 3:8.50,7:10.50,... Weight/Price less than or equal to 3 would cost 8.50 for Zone 3 destinations.
You can end the last amount as 10000:7% to charge 7% of the Order Total
3:8.50,7:10.50,99:20.00

Zone 3 Handling Fee
Handling Fee for this shipping zone

16 Jun 2010, 1:37 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

It almost looks like either the file is loaded in the wrong place or the master_categories_id of the product is not 123

Could you check the Product by editing it to see what it says the master_categories_id is for the product:
Brightest Day: The Atom Special Comic Book #1

and make sure it is master_categories_id Pre-Order It

Then, could you go to the Tools ... Developers Tool Kit ... and do a search in the bottom input box for:
add additional charge for categories_id

and select the Catalog ... and click Search ...

What file does it find this line in it?

16 Jun 2010, 2:19 PM
#16
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

Ajeh:

It almost looks like either the file is loaded in the wrong place or the master_categories_id of the product is not 123

Could you check the Product by editing it to see what it says the master_categories_id is for the product:
Brightest Day: The Atom Special Comic Book #1

and make sure it is master_categories_id Pre-Order It

Then, could you go to the Tools ... Developers Tool Kit ... and do a search in the bottom input box for:
add additional charge for categories_id

and select the Catalog ... and click Search ...

What file does it find this line in it?

I copied and pasted the following ID from the Brightest Day: The Atom Special Comic Book #1: Product Master Category: ID# **123 Pre-Order Items **

and this is what came up in the search:

/home/content/g/f/a/gfarina/html/comicmegastore/includes/modules/shipping/zones.php

Line #233 : } // bof: add additional charge for categories_id 123 global $cart; $chk_products_upcoming = $_SESSION['cart']->in_cart_check('master_categories_id','123'); $extra_charge = $chk_products_upcoming * 2.50;

Line #238 : 'cost' => $shipping_cost + $extra_charge))); // eof: add additional charge for categories_id 123
 

Your help has been amazing so far. Thank you!

16 Jun 2010, 3:04 PM
#17
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

Can you look at the file:
/includes/modules/shipping/zones.php

From the server you show:

Line #233 : } // bof: add additional charge for categories_id 123 global $cart; $chk_products_upcoming = $_SESSION['cart']->in_cart_check('master_categories_id','123'); $extra_charge = $chk_products_upcoming * 2.50;

Which makes it look like the code is all on 1 line and that line is commented out ... meaning its value for the calculation is 0.00 ... :eek:

Check that you are using a good TEXT Editor and not something like MS Word or WordPad etc.

16 Jun 2010, 4:19 PM
#18
comicmegastore avatar

comicmegastore

New Zenner

Join Date:
Dec 2009
Posts:
30
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

Ajeh:

Can you look at the file:
/includes/modules/shipping/zones.php

From the server you show:

Line #233 : } // bof: add additional charge for categories_id 123 global $cart; $chk_products_upcoming = $_SESSION['cart']->in_cart_check('master_categories_id','123'); $extra_charge = $chk_products_upcoming * 2.50;

> 
> Which makes it look like the code is all on 1 line and that line is commented out ... meaning its value for the calculation is 0.00 ... :eek:
> 
> Check that you are using a good TEXT Editor and not something like MS Word or WordPad etc.

I use notepad++ and that was it! I just hit enter after each line and it worked like a charm.

This will make a huge difference for us!
16 Jun 2010, 4:29 PM
#19
ajeh avatar

ajeh

Oba-san

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

Re: Shipping and Pre-Order/Upcoming Items

Glad that this works for you now ... :smile:

Don't forget to check what happens when you have 1 Pre-Order in the cart vs 1 regular Product vs 1 Pre Order and 1 regular Product to ensure your calculation is doing the right thing ...

Then try the same thing with 2 of each ...

24 Jun 2010, 5:49 PM
#20
csiadp avatar

csiadp

New Zenner

Join Date:
Jun 2010
Posts:
3
Plugin Contributions:
0

Re: Shipping and Pre-Order/Upcoming Items

I had exactly the same need and it looks like this will do the trick. Thank you!

Question, though: Will the surcharge (the $2.50) be added even if the ONLY thing in the order is a single product with the category 123?

Is there a way to make sure the customer is only getting the extra charge in an order that includes both items that are now shipping and items that will ship later (the 123 category)?