Pergunta

How do I enable free shipping as shipping method when we create order from admin panel ?

Foi útil?

Solução

Override

app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php

And add

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
        if (!$this->getConfigFlag('active')) {
            return false;
        }

if (!Mage::app()->getStore()->isAdmin())) {
            return false;
        }

And set to active in backend

You can place the code in local if you dont want to overwrite the core

I can imagine that we add this as an extra option in backend settings and this way make it configurable.

Outras dicas

While in payment methods it is possible to activate them with a flag only on frontend and also on backend (but not vice-versa), for shipping methods there are no such flags at all.

You could derive an own shipping method in a custom module and overwrite getAllowedMethods() to determine if the order is to be created in the frontend or in the backend,

A very simple workaround would be to create a free-shipping cart rule with a promo code that only you know. This then can be simply entered in the backend.

You would make collectRates() return empty unless it's being invoked via admin. How to know if its invoked via admin, well you could set a registry value.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top