Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / How to check cart contents from shipping module?

How to check cart contents from shipping module?

Locked

Views: 957

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
27 Jul 2009, 4:31 PM
#1
benbirdx avatar

benbirdx

New Zenner

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

How to check cart contents from shipping module?

I would like to edit our shipping module to check if a user's cart contains a certain item, then add a surcharge to the shipping costs of that entire order.

In code, how would we check to see if the cart contains an item?

27 Jul 2009, 4:37 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: How to check cart contents from shipping module?

$_SESSION['cart']->get_products() will return an array of products which you can then loop through as needed.