문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top