Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free Shipping FedEx Based on Order Quantities


ncss*lsh

Recommended Posts

Our site, www.labelsupplyhut.com is supposed to allow free shipping if a customer orders 5 boxes or above, plus any configuration after that rule. For example, 5 boxes of one style and one box of another style. We have a simple free FedEx shipping module that programs this based on a field in the product details, "Minimum Order Quantity for Free Shipping." Not being familar with php code, can someone look at the code for this function and tell me if there is something off that is causing this not to work? (For reference, we are using osCommerce Online Merchant v2.2 RC2a, PHP Version 5.3.23 and this should be independent of the free module, but FedEx Web Services version 9.

 

 

function quote($method = '') {

global $shipping_weight, $shipping_num_boxes, $cart, $order, $total_weight, $total_free_shipping_weight;

 

$products = $cart->get_products();

 

$free_shipping = array();

foreach ($products as $product)

{

$free_shipping[$product['products_free_shipping_qty']] += $product['quantity'];

}

foreach ($free_shipping as $threshold => $quantity)

{

if ($quantity >= $threshold && $threshold > 0)

{

 

$total_free_shipping_weight = 0;

break;

}

}

 

if (isset($total_free_shipping_weight) && $total_free_shipping_weight < $total_weight) {

 

if ($total_free_shipping_weight == 0) {

function quote($method = '') {

global $shipping_weight, $shipping_num_boxes, $cart, $order, $total_weight, $total_free_shipping_weight;

 

$products = $cart->get_products();

 

$free_shipping = array();

foreach ($products as $product)

{

$free_shipping[$product['products_free_shipping_qty']] += $product['quantity'];

}

foreach ($free_shipping as $threshold => $quantity)

{

if ($quantity >= $threshold && $threshold > 0)

{

 

$total_free_shipping_weight = 0;

break;

}

}

 

if (isset($total_free_shipping_weight) && $total_free_shipping_weight < $total_weight) {

 

if ($total_free_shipping_weight == 0) {

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...