As mc12345678 pointed out in post #8 , the Per Weight Unit shipping module needs to be modified as well.
So, if the cart contains an item from category 78 plus other products from other categories, then the Per Weight Unit shipping module must be disabled.
In that module you insert (corresponding to my post #2):
PHP Code:
// bof disable only for certain category in cart
if (IS_ADMIN_FLAG == false) {
if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0))
{
$this->enabled = false;
} else {
$this->enabled = true;
}
}
// eof disable only for certain category in cart
hi
Ok its very unlikely that a client will order both an assembled unit and a flat packed unit on one order. If that helps matters.
Ok I have read that thread and added the following to perweightunit.php
And the per weight unit works fine with 2nd shipping method appearing. But if I clear this cart and try to buy an item from the other categories, nothing appears.Code:// disable only when entire cart is free shipping if (zen_get_shipping_enabled($this->code)) { $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false); } // disable for one master_categories_id if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','78') > 0)) { $this->enabled = false; }
In fact the javascript pop-up box for shipping estimator does not pop up.
Please help.
Try and replace your code:
with this one:PHP Code:
// disable for one master_categories_id
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','78') > 0)) {
$this->enabled = false;
}
PHP Code:
// bof disable only for certain category in cart
if (IS_ADMIN_FLAG == false) {
if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0))
{
$this->enabled = false;
} else {
$this->enabled = true;
}
}
// eof disable only for certain category in cart
It works!!!! Thank you so much
One last thing: How could I opt for 2 master categories?
Go back to frank18's post #4 and follow the format of the "if" part of the code. Don't change the content of your new code that sets $this->enabled to true/false. Just duplicate the if(){ part.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Hi mc
I have tried this line in both the mileageship.php and perweightunit.php files and once again I get the per weight unit showing up a £0
Try and purchase https://sitstandforbusiness.com/ssfb...dule-p-29.html and you'll see what I mean.
In one file should have:In the other it should be almost exactly the same but "reversed":Code:// bof enable only for certain category in cart if (IS_ADMIN_FLAG == false) { if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0) || ($_SESSION['cart']->in_cart_check('master_categories_id','99') > 0)) { $this->enabled = true; } else { $this->enabled = false; } } // eof enable only for certain category in cart
That is for product that have a master category of 78 and 99. While I haven't navigated the site enough to see if there is even a 78 in the category uri for any of them I have so far found 57 and 60 as a result of the limited testing performed and the below information.Code:// bof enable only for certain category in cart if (IS_ADMIN_FLAG == false) { if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0) || ($_SESSION['cart']->in_cart_check('master_categories_id','99') > 0)) { $this->enabled = true; } else { $this->enabled = false; } } // eof enable only for certain category in cart
I'm not sure which shipping method this product is to represent. If it is "weight" based it's a no go, because it weighs nothing. If it is to be the other method, well, it appears as if no shipping price is applied so there is a shipping method that is presented, but it doesn't have a cost.
As far as entering a shipping destination I haven't a clue what locations may/may not work for this store so I am not surprised at any lack of specific shipping calculations. Also, take not of a few things with the site: there is mixed content (annoying to try to test something that pops up a warning message on each screen), hovering over the cart causes the screen on at least my mobile device to move and actually prevent getting to the cart, when I added one of the mileage based products (as identified in the category name) and viewed the shipping estimator the first line after the close button indicated some sort of error being caught (that doesn't occur with the above product).
As for the "line" of code when I went to this product: https://sitstandforbusiness.com/ssfb...form-p-62.html and added it to the cart, I did get a "weight" based Total shipping cost in £. So it tells me that there is something about the logic that is working, whether the product is setup correctly or not...
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks