3

I want to create a new custom shipping method which will be my own delivery method. I would like to show this shipping method for some of the selected products only.
Is this possible to do? Currently, I am using this extension: shipping cost per product tp work on it. But I didn't get the result that I am looking for.

0

You're going to have to edit the getAllowedMethods method of your shipping class. All you need to do is add an if condition to add your method to the array that method returns. So I'm imaging something like this;

public function getAllowedMethods()
{
    $allowed = [];
    if (in_array('YOURSKUHERE', array_column(Mage::getSingleton('checkout/cart')->getAllItems(), 'sku')) {
        $allowed[] = 'your_method_name_here';
    } 
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.