Confirmed, it is set to 0 (no).
master_categories_id: 316
Printable View
Confirmed, it is set to 0 (no).
master_categories_id: 316
These are the changes that you need for your shipping files just add the code in RED ...
/includes/modules/shipping/ups.php
Quote:
$qsize = sizeof($upsQuote);
// bof: seperate item cost 1 category
$chk_cart = $_SESSION['cart']->in_cart_check('master_categories_id','65');
$extra_shipping_charge = $chk_cart * 5.99;
// 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 == $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');
$extra_shipping_charge = $chk_cart * 5.99;
// 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 == $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>';
On all three of these, set the master_categories_id to your value, as I used 65: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');
$extra_shipping_charge = $chk_cart * 5.99;
echo '$total_count: ' . $total_count . ' $chk_cart: ' . $chk_cart . '<br>';
if ($extra_shipping_charge == 0 || $chk_cart != $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) {
On the Modules ... Shipping ... set the Shipping Cost to 5.99 ...Code:$chk_cart = $_SESSION['cart']->in_cart_check('master_categories_id','65');
This should make the cart add for UPS and USPS a $5.99 charge per item in the shipping costs for any Products in the cart for your 1 category ...
When Products from the 1 category are the only thing in the cart, then UPS and USPS will not show and only the Item Rate will show ...
Finally, be sure to test when a Gift Card is the only Product in the cart or when a Gift Card is added with other Products to ensure all is still working ...
thank you. I will test and let you know!
Andrew
i'm afraid it didn't work.
I noticed when trying to update the USPS file, I didn't have the latest module. I upgraded it, then made the correct changes, but now I have only 3 shipping modules showing in my admin: flat rate, free shipping options, and free shipping.
also getting this error across the top of my admin page: Warning Shipping Configuration errors!
Warning: USPS shipping module is either missing the username, or it is set to TEST rather than PRODUCTION and will not work.
If you cannot retrieve USPS Shipping Quotes, contact USPS to activate your Web Tools account on their production server. 1-800-344-7779 or [email protected]
Sounds like you have errors in the file(s) ...
If you look in the directory /logs (this is /cache on older versions of Zen Cart) do you see any debug logs? If so, could you post the content on your next post please?
duh, thanks for reminding me... it's easy to get frustrated when your website quits working like it's supposed to...
I messed up the item.php file. I left the extra ( in part of the code. as soon as I took it out, fixed.
i'll let you know how it goes from here...
seems to be working, however, the following things are happening:
in the shopping cart, the following is displayed just above the "Estimate Shipping": $total_count: 1 $chk_cart: 1
Also, when checking out (shipping method screen) on just the 1 category, USPS doesn't show, but UPS does. Not the whole thing, just the UPS box with nothing in it:
UPS
Store Pickup
Per Item
Gift card: I added a gift card to the order with 1 item from the 5.99 category, and it jacked the shipping cost up instead of leaving it at 5.99. by itself, gift card ships free.
I tested some very lightweight items, and maybe I didn't notice it before...example: I have weight set for a pack of yeast to .01 lbs and the quote for USPS shipping is 8.10 just for that 1 item.
A slightly more pressing issue: when I click over to the "choose your payment method", screen goes blank and I get the "$total_count: 3 $chk_cart: 3" message at the top...
Those are 3 of the kits.
When I add a non-kit item, it doesn't do it...meaning it works fine. I can select my payment method.
Have you an URL to your shop that we could perhaps peek at?