Are you saying that the tested products_id should NOT be allowed for Flat Rate and should using the other shipping modules only?
Are you saying that the tested products_id should NOT be allowed for Flat Rate and should using the other shipping modules only?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Correct. I would rather block 30 items than allow over 1000...know what I mean? So I'm just blocking the big, bulky, heavy items from flat rate shipping. They can still ship, just using the other modules (USPS, UPS, and in store pickup).
To make this have the checked products_id NOT allow Flat and only allow USPS use the code in RED:
/includes/modules/shipping/flat.php
and for USPS use:Code:function quote($method = '') { global $order; // bof: NOT Allow individual Products to use Flat // set allowed products_id 12, 13, 15 $chk_cart = 0; $chk_cart += $_SESSION['cart']->in_cart_check('products_id','12'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','13'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','15'); if ($chk_cart == 0) { // allow flat rate $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FLAT_TEXT_WAY, 'cost' => MODULE_SHIPPING_FLAT_COST))); } else { // skip flat rate } // eof: Allow individual Products to use Flat if ($this->tax_class > 0) {
and then use something similar on FedEx and UPS ...Code:function quote($method = '') { global $order, $shipping_weight, $shipping_num_boxes, $currencies, $shipping; // bof: NOT Allow individual Products to use Flat enable USPS // set allowed products_id 12, 13, 15 $chk_cart = 0; $chk_cart += $_SESSION['cart']->in_cart_check('products_id','12'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','13'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','15'); if ($chk_cart > 0) { // NOT allow flat rate only allow USPS } else { return; } // eof: NOT Allow individual Products to use Flat enable USPS //echo 'USPS function quote BEFORE IF $this->enabled $this->uspsQuote $this->enabled: ' . ($this->enabled ? ' ON' : ' OFF') . ' $shipping_weight: ' . $shipping_weight . '<br>'; $usps_shipping_quotes = '';
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I updated the Flat Rate and USPS and lost the shipping module in the admin, and those shipping options don't show at all on the site during checkout. It seems to be the Flat Rate file that makes the admin shipping module crash. When I undid the USPS, no change. Undid the Flat Rate, back to normal.
Last edited by bigandrew; 23 Oct 2015 at 08:39 PM.
You have an error then in the file ... if you check in the /logs (or /cache in older versions of Zen Cart) you will see a log file that explains the problem ...
Check and read the debug log file and post its contents and we can help you figure out the problem ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
[23-Oct-2015 15:48:38 America/New_York] PHP Parse error: syntax error, unexpected 'else' (T_ELSE) in .../store/includes/modules/shipping/flat.php on line 95
Sounds like a typo on the new code ... I am using this:
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Not sure why the attachment has jibberish, however, I think I found my issue. testing now...
Last edited by bigandrew; 24 Oct 2015 at 02:18 PM. Reason: Might have found the issue....
My coding error in the Flat Rate file was due to placing the edits too high in the file. I moved it to just behind the class methods and it worked. It just didn't look right when I placed it behind the class constructor. It seems to be working. I will continue testing and report back with any issues.
Donation on the way.
Thanks!
Andrew
Thanks for the update that this appears to be working for you now and the explination on the problem you had ... Let us know if you run into any issues ...
Thanks also for the donation to the Zen Cart Team, that is always of great help to us!![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Bookmarks