LOL! Well, if I didn't do all this I wouldn't have found the /logs directory wasn't working!
Thank you for helping me out Ajeh. Sending you a donation :)
Printable View
LOL! Well, if I didn't do all this I wouldn't have found the /logs directory wasn't working!
Thank you for helping me out Ajeh. Sending you a donation :)
You are most welcome ... and thanks for the coffee and donuts!! We really appreciate the support! :P
You're most welcome!
I have another question. Is it possible to restrict options on a per product or master category?
Currently I have it so only certain products can be shipped on Small Flat Rate, because physically other products don't fit on this little box, but I have a product that can only ship via Parcel within the US (contains alcohol). Is it possible to add an if statement that if product X is in the shopping cart then only Parcel or Ground options are displayed?
These are the statements I have to block Small Flat Rate
PHP Code:
if (true) {
$chk_cart = 0;
//Categories
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','5');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','18');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','25');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','27');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','29');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','30');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','31');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','32');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','34');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','35');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','43');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','44');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','46');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','88');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','92');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','101');
$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','103');
//Products
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','264');
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','457');
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','463');
}
Thanks a bunch :smile:PHP Code:
if (true) {
if ($chk_cart > 0 && $type == 'Priority MailTM Small Flat Rate Box') {
// echo 'USPS $type: ' . $type . ' $chk_cart:' . $chk_cart . '<br>';
continue;
}
}
You could add the code in RED:
That would only show Media Mail Parcel and USPS Retail GroundTM when products_id 6 is in the cart ...Code:$show_hiddenCost = '';
// bof: only show Parcel & Ground if products_id 6 is in the cart
//echo 'USPS $type_rebuilt: ' . $type_rebuilt . '<br>';
$chk_parcel_ground = 0;
$chk_parcel_ground += $_SESSION['cart']->in_cart_check('products_id','6');
if ($chk_parcel_ground > 0 && ($type_rebuilt != 'Media Mail Parcel' && $type_rebuilt != 'USPS Retail GroundTM')) {
continue;
}
// eof: only show Parcel & Ground if products_id 6 is in the cart
$methods[] = array('id' => $type_rebuilt,
Thank you!
But it seems not to be working (?)
No Parcel or ground options show at all on my test. Is ground not available to all addresses?
The Media Mail Parcel should show regardless of where the shipping is, but the USPS Retail GroundTM is dependent on the Zone you are shipping to ...
For example, I cannot ship from Ohio to Ohio and see the USPS Retail GroundTM, but I can ship from Ohio to Florida and see the USPS Retail GroundTM ...
Have you a specific Product that you are trying this with, that we can look at?
NOTE: you can also force USPS Retail GroundTM, but then you cannot get the other methods of shipping quoted ...
We don't use Media Parcel (isn't that for books, magazines, etc?)
But the test I'm doing is to ship from Michigan to Georgia and it doesn't show at all.
Is it possible to (successfully) clone the module that way pushing Parcel only on that product?
I think would be the only solution, since USPS has made it so hard to use Parcel Nationwide.
Sorry, yes, this is the product. When this product is in the shopping cart, all other shipping options need to be removed and only ship via ground the entire order.
Edit that USPS shipping module and uncomment the echo:
On the methods echoed, which do you want to show when this product is in the Cart?Code:// bof: only show Parcel & Ground if products_id 6 is in the cart
echo 'USPS $type_rebuilt: ' . $type_rebuilt . '<br>';
Have you an URL to this Product that you only want to limit the shipping methods to show?
If this is the product you want to force the USPS Retail GroundTM to be the only USPS shipping method, then the code I gave you above is wrong ...
Remove that code and use this code instead:
Now if that products_id 114 is in the cart, only USPS Retail GroundTM will show regardless of where in the US it is being shipped ...Code:$usps_groundonly = 'false';
// $usps_groundonly = ($_SESSION['cart']->in_cart_check('products_groundonly','1') ? 'true' : 'false');
// bof: only show USPS Retail GroundTM if products_id 114 is in the cart
//echo 'USPS $type_rebuilt: ' . $type_rebuilt . '<br>';
$chk_ground = 0;
$chk_ground += $_SESSION['cart']->in_cart_check('products_id','6');
if ($chk_ground > 0) {
$usps_groundonly = 'true';
}
// eof: only show USPS Retail GroundTM if products_id 114 is in the cart
if ($usps_groundonly == 'false') {