Any idea how I would only enable this for a single category and disable all other shipping options please?
Printable View
I did this on my site for books. I only have one book at the moment but the principle worked OK. I created a new attribute of book and cloned all the royal mail modules i wanted to use changing their name from RM... to BK... (and making a small change to the module) then applied the attribute to the book so that the only valid shipping for books was the BK methods. I had an additional complication in that we cannot send books with any other products so I also created an observer that check when you added items to the cart or that you were not mixing books with crystals.
The only other shipping method I use is store collection so as everything else was royal mail the attribute shipping method for products worked fine.
If you want to understand more you would have to look at the royal mail modules in the quote function you will see and array set up called $postage_check this is used in the combination with the attribute checking to see if the method can be used to dispatch the item. If you look in the include quote.php (in ...>shipping>BigRoyalMail>) you will see about line 75 onwards the check being performed.
So the bottom line is if you are happy to do a bit of coding you can mod big royal mail and the other shipping methods that you use to make the changes you need.
If is probably easier to do it for products that it s for a category as if like me you have a product in multiple categories then it does not matter were it comes from you probably need the different postage method.
Not sure if that helps.
Sorry here is the code. I'll add it and release. Obviously too rushed.
You can manually remove US from all your Zone countries.This would be neater as the script will leave , , in the lists. This does not effect the running of the code.PHP Code:
UPDATE configuration SET configuration_value = REPLACE(configuration_value, "US", "")
WHERE `configuration_key` LIKE "MODULE_SHIPPING_RMAM%ZONES_COUNTRIES%";
OK, no problem. I wasn't sure if that was all it did so didn't want to risk it, but I'll do that manually. Thanks
Another issue - International Signed Large Letter is not showing Zone 3. Sods law that this is the one I use most :D
I've uninstalled and reinstalled it 3 times just to check
The issue is it is missing a quote should be
UPDATE configuration SET configuration_value = @ROWHandlingZ3 WHERE configuration_key = 'MODULE_SHIPPING_RMAMTSLETTER_ZONES_HANDLING_4' ;
This one is for Tracked and Signed.
I must have slipped when I transferred the file. You wont' believe that I tested it fine on my system before I put it out there.
Fab, thanks :)