The weight on the gift card is set to 0.
Printable View
What is the master_categories_id on the Gift Card?
Does it match what is on the Gift Card if you edit it?
On the Attributes on the Gift Card, do any of the Attributes have weight?
And the Gift Card is marked as:
Quote:
Always Free Shipping: Yes, Always Free Shipping
Aha! I think I figured it out ...
You have Gift Cards setup totally different from the norm as your Gift Cards are not treated like normal Zen Cart Gift Certificates nor configured in the same manner ...
So, all of these changes to the Item Rate, UPS and USPS shipping have to take into account the Gift Certificate as a different kind of Product, so to speak ...
Give me a few to give this some thought ... and while I am going out to dinner, I just got a call changing the time for everything, so hopefully I can get this done in the next few minutes to the next hour or so ... :lookaroun
Okay, let's try this new code:
/includes/modules/shipping/ups.php
Code:$qsize = sizeof($upsQuote);
// bof: seperate item cost 1 category
$chk_cart = $_SESSION['cart']->in_cart_check('master_categories_id','65');
$chk_cart_always_free_shipping = $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1');
$extra_shipping_charge = $chk_cart * 5.99;
//echo 'UPS $total_count: ' . $total_count . ' $chk_cart: ' . $chk_cart . ' $extra_shipping_charge: ' . $extra_shipping_charge . ' Always + chk_cart: ' . ($chk_cart + $chk_cart_always_free_shipping) . '<br>';
// eof: seperate item cost 1 category
for ($i=0; $i<$qsize; $i++) {
/includes/modules/shipping/usps.phpCode:$cost = preg_replace('/[^0-9.]/', '', $cost);
// bof: seperate item cost 1 category
global $total_count;
if (($chk_cart + $chk_cart_always_free_shipping) == $total_count) {
// skip shipping
} else {
$methods[] = array('id' => $type,
'title' => $this->types[$type],
'cost' => ($cost * $shipping_num_boxes) + $extra_shipping_charge + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING) );
}
}
$this->quotes['methods'] = $methods;
Code:// eof: example to block USPS Priority MailTM Small Flat Rate Box when anything from master_categories_id 12 or 15 are in the cart
// bof: seperate item cost 1 category
$chk_cart = $_SESSION['cart']->in_cart_check('master_categories_id','65');
$chk_cart_always_free_shipping = $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1');
$extra_shipping_charge = $chk_cart * 5.99;
//echo 'USPS $total_count: ' . $total_count . ' $chk_cart: ' . $chk_cart . ' $extra_shipping_charge: ' . $extra_shipping_charge . ' Always + chk_cart: ' . ($chk_cart + $chk_cart_always_free_shipping) . '<br>';
// eof: seperate item cost 1 category
for ($i=0; $i<$PackageSize; $i++) {
/includes/modules/shipping/item.phpCode:$show_hiddenCost = '';
// bof: seperate item cost 1 category
global $total_count;
if (($chk_cart + $chk_cart_always_free_shipping) == $total_count) {
// skip shipping
} else {
$methods[] = array('id' => $type_rebuilt,
'title' => $title . $show_hiddenCost,
'cost' => $cost + $extra_shipping_charge,
'insurance' => $usps_insurance_charge,
);
}
// eof: seperate item cost 1 category
//echo 'setting insurance: ' . $usps_insurance_charge . '<br>';
} else {
Let's see if this works better for you ...Code:$item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
// bof: seperate item cost 1 category
$chk_cart = $_SESSION['cart']->in_cart_check('master_categories_id','65');
$chk_cart_always_free_shipping = $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1');
//echo 'ITEM $total_count: ' . $total_count . ' $chk_cart: ' . $chk_cart . ' $extra_shipping_charge: ' . $extra_shipping_charge . ' Always + chk_cart: ' . ($chk_cart + $chk_cart_always_free_shipping) . '<br>';
$extra_shipping_charge = $chk_cart * 5.99;
if ($extra_shipping_charge == 0 || ($chk_cart + $chk_cart_always_free_shipping) != $total_count) {
// skip shipping
} else {
$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' => $extra_shipping_charge)));
}
// eof: seperate item cost 1 category
if ($this->tax_class > 0) {
Can you see the shipping modules Item Rate, USPS and UPS in your Zen Cart Admin in the Modules ... Shipping ...
When you add just a normal Product to the shopping cart, do you see any debug logs in the /logs directory (/cache in older Zen Cart Versions)?
If so, can you post the content?
This is a Zip of these files to compare to what you have used ...
Looks like you are getting somewhere but I have to get off to dinner ... I will check back later tonight ...
Thanks for that. I must have messed something up with the USPS file. That one was missing from my admin shipping module. Looks like it's working now, except for the ups shipping option tries to show during checkout. i'm trying to attach a screen shot, but I can't figure this thing out either.