Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need PHP help, please


carpesitus

Recommended Posts

I'm trying to add an additional condition to a per item shipping module.

 

It is processing the zone properly but I can't get it to calculate the shipping correctly. It returns a $0.00 shipping total.

 

Here is the code:

 

if ($dest_zone == 0) {

$groups_cost = constant('MODULE_SHIPPING_PIPC_COST_DEFAULT');

$handle_cost = constant('MODULE_SHIPPING_PIPC_HANDLING_DEFAULT');

} elseif ($dest_zone == 1 && $total_count > 2) {

$shipping_cost = $groups_cost + $groups_cost;

} else {

$groups_cost = constant('MODULE_SHIPPING_PIPC_COST_' . $dest_zone);

$handle_cost = constant('MODULE_SHIPPING_PIPC_HANDLING_' . $dest_zone);

}

 

$shipping_method = MODULE_SHIPPING_PIPC_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_PIPC_TEXT_UNITS;

$shipping_cost = $groups_cost * $total_count + $handle_cost;

 

$this->quotes = array('id' => $this->code,

'module' => MODULE_SHIPPING_PIPC_TEXT_TITLE,

'methods' => array(array('id' => $this->code,

'title' => $shipping_method,

'cost' => $shipping_cost)));

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...