Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Shipping module calls - From what page??

Shipping module calls - From what page??

Locked

Views: 652

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
18 Sep 2009, 7:31 PM
#1
bladerogers avatar

bladerogers

New Zenner

Join Date:
Sep 2009
Posts:
18
Plugin Contributions:
0

Shipping module calls - From what page??

When you click the** Go To Checkout **button on the shopping cart page you are directed to index.php?main_page=checkout_shipping. I figured based on the main_page qstring paramater I could figure out exactly where the shipping modules are called (the page that calls the options for shipping to calculate shipping totals for each option). No such luck, I am getting very frustrated trying to hunt these down. So please, in what page/script are the shipping modules called to calculate shipping costs for all items in the shopping cart?

Thanks!

18 Sep 2009, 8:13 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Shipping module calls - From what page??

That happens in the quote() method of the individual shipping module class itself. Each shipping module has its own.

18 Sep 2009, 9:01 PM
#3
bladerogers avatar

bladerogers

New Zenner

Join Date:
Sep 2009
Posts:
18
Plugin Contributions:
0

Re: Shipping module calls - From what page??

OK, and where, or at what point and in which file, is the quote method called/referenced?

Again, thanks DrByte, you seem to be the goto person around here :)

18 Sep 2009, 11:47 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Shipping module calls - From what page??

I have this sense that you're asking the wrong question, and steering yourself in the wrong direction. So, I'll ask: why

19 Sep 2009, 12:29 AM
#5
bladerogers avatar

bladerogers

New Zenner

Join Date:
Sep 2009
Posts:
18
Plugin Contributions:
0

Re: Shipping module calls - From what page??

Because what I need to do is split up the current shopping cart and determine shipping costs through multiple service providers for only portions of the shopping cart. It's easier if I give you an example:

A shopping cart contains 6 items. 2 of these items can only be shipped via UPS, 2 more can only be shipped via Canada post, and the other two may be shipped via either CP or UPS. The available shipping providers are determined through boolean values associated to each product and set in the administrative section; each product has a radio button for UPS allows shipping and CP allows shipping. This is a requirement as policy dictates that some of the items this particular store sells cannot be shipped via UPS and others cannot be shipped via CP.

On the shopping cart screen each item displays in its description which shipping providers will ship the item. Currently on the shipping options page these are all lumped together in the quotes. In the above scenario this page will instead display 4 "options" two of which cannot be modified. First option, the two items that MUST be shipped via CP and the quote to ship (obtained using CP module). Second option, the two items that MUST be shipped via UPS and the quote to ship. Third option the first two CP only items combined with the other two items that may be shipped via either provider and the fourth the UPS only items combined with the other two that maybe shipped via either provider, both with quotes and this time a radio button option to select between the two.

At this time I need to break down the shopping cart and call the appropriate quote() method for each of these scenarios in order to obtain the correct quotes. I hope this helps, perhaps there is an easier way to do this using the Zen software?

19 Sep 2009, 1:56 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Shipping module calls - From what page??

/includes/modules/pages/checkout_shipping/header_php.php calls $shipping_modules->quote() , and $shipping_modules is an instantiation of the /includes/classes/shipping.php class, which is really just a parent class which calls the specified method in all the active shipping module classes, one by one. So, you'll need to work with that in conjunction with the various places where $_SESSION['shipping'] array contents are set/managed.

19 Sep 2009, 3:29 PM
#7
bladerogers avatar

bladerogers

New Zenner

Join Date:
Sep 2009
Posts:
18
Plugin Contributions:
0

Re: Shipping module calls - From what page??

One place I'd never even thought to check and it makes perfect sense! Thanks DrByte, I'll follow up in this thread if there are anymore questions regarding this.