I don't know too much about zone rates and I would like this to be on all shipping methods but I am most concerned about the USPS method since that is what I am currently using. Thank you so much!!!
I don't know too much about zone rates and I would like this to be on all shipping methods but I am most concerned about the USPS method since that is what I am currently using. Thank you so much!!!
You could edit the module:
/includes/modules/shipping/usps.php
by adding the code in RED:
Code:// switch comment marks to show $hiddenCost: from quote title $show_hiddenCost = ' $hiddenCost: ' . $hiddenCost; //$show_hiddenCost = ''; // bof: force minimum of $8.00 if ($cost < 8.00) { $cost = 8.00; } // eof: force minimum of $8.00 $methods[] = array('id' => $type_rebuilt, 'title' => $title . $show_hiddenCost, 'cost' => $cost, 'insurance' => $usps_insurance_charge, );
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!]
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!
Thank you so much!! This worked:) BTW... I asked for a quote from someone to do this for me and was quoted $80/hr and it would take 2 hours. I can't tell you how thrilled I am that I pushed ahead and asked questions.
BTW, though I hadn't seen that Ajeh had provided the solution (was reading emails from the thread rather than the thread itself) I had come up with something a little less "intrusive" though haven't tested it, just a "thought" experiment, but was something I was thinking could work for others in the future... Involves creating 2 files and using the observer/notifier systems. To be ever more elaborate could add some configuration items into the USPS script for install/remove to provide a field on the admin panel to replace the hard coded 8.00 that is below. Was written with consideration of the "standard" update function possibly going away (I doubt) so yes the same code is listed twice, but with the redesign in ZC 1.5.3, there are a few more "options".
First file (suggest uploading "last")
includes/auto_loaders/config.shipping_usps_quotes.php:
Second file (suggest loading "first")Code:<?php // loading of the class $autoLoadConfig[10][] = array('autoType'=>'class', 'loadFile'=>'observers/class.shipping_usps_quotes.php'); $autoLoadConfig[199][] = array('autoType'=>'classInstantiate', 'className'=>'shipping_usps_quotes', 'objectName'=>'shipping_usps_quotes_obj'); ?>
includes/classes/observers/class.shipping_usps_quotes.php:
Code:<?php class shipping_usps_quotes extends base { function shipping_usps_quotes () { global $zco_notifier; $this->attach($this, array('NOTIFY_SHIPPING_USPS_QUOTES_READY_TO_RETURN')); } // end initialization of class //Below is applicable to ZC version 1.5.3 and above, will be run instead of the update function. function updateNotifyShippingUspsQuotesReadyToReturn(&$callingClass, $notifier, $paramsArray = array()) { foreach ($callingClass->quotes['methods'] as $method) { $method['cost'] = max($method['cost'], 8.00); } // end loop on all methods } // end observer update listener //Below is applicable to all ZC versions with notify system associated. function update(&$callingClass, $notifier, $paramsArray = array()) { if ($notifier == 'NOTIFY_SHIPPING_USPS_QUOTES_READY_TO_RETURN') { foreach ($callingClass->quotes['methods'] as $method) { $method['cost'] = max($method['cost'], 8.00); } // end loop on all methods } // not a NOTIFY_SHIPPING_USPS_QUOTES_READY_TO_RETURN notifier } // end update } // end class
Last edited by mc12345678; 24 Jun 2015 at 10:39 PM.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Yes, that is exactly what I want. The minimum charge to be $8.00. Thank you.
You are most welcome ... glad to have been able to help!
Remember the Zen Cart Team when you are rich and famous!![]()
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!]
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!