Hello everyone.
I'm having a problem with the new USPS module.
This is what we used to have that doesn't work anymore.
We ship, priority all our products throughout the US, Canada and International, but one of our products (perfumes) due to restrictions is shipped only within the US via Parcel (standard).
The way we had it set up with rules gathered from this thread, we were able to turn on or off the shipping options depending on the product ID. Now with the new usps.php file the changes didn't work any longer, so we decided to clone the usps.php file (uspsperfumes.php), but of course we have problems.
We've been trying to add the statements to turn on or off if certain products ID's are in the shopping cart, and that part works as long as the customers has a US shipping address. The moment an international customer comes along, the customer only sees the select a shipping method message and no shipping options are provided. The way it worked before, it would show an international customer a message telling them to remove the perfume from the shopping cart because perfumes are not shipped internationally. No matter what we don't get the same results and we haven't been able to figure out what's going on, so if anyone could help us visualize the problem that would be great.
I tried posting the entire uspsperfume.php file, but I get an error that my post is too long.
This is the code we added to the usps.php file
PHP Code:
// CUSTOMIZED CONDITIONS GO HERE
// Optionally add additional code here to change $this->enabled to false based on whatever custom rules you require.
// -----
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','116') > 0) {
$this->enabled = false;
}
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114') > 0) {
$this->enabled = false;
}
// -----
// eof: optional additional code
This below is the code we added to the cloned usps file uspsperfume.php
PHP Code:
// CUSTOMIZED CONDITIONS GO HERE
// Optionally add additional code here to change $this->enabled to false based on whatever custom rules you require.
// -----
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114') > 0) {
$this->enabled = true;
}
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','116') > 0) {
$this->enabled = true;
} else {
$this->enabled = false;
}
// -----
// eof: optional additional code
It is possible we might have not cloned the usps.php file the right way, but I can't figure out where the damage might be.
Thanks for the help.