0

I am using extra fees extension, if customer choose shipping method : Pick from store how to remove Handling fees(extra fees extension).

What event used to check if customer chooses to pick from store in checkout page, if customer chooses to pick from store how to remove or hide handling fees.

If i use https://stackoverflow.com/a/40486717/11697039 what is my event.

enter image description here

  • Please check first admin panel/store/configuration/shipping Method/pick from store method and check to handle fee and remove handling fee, save configuration and check. I hope it will help you. – Monark Bhawani Aug 12 at 13:15
2

Take a look https://github.com/yvoronoy/magento-extension-extra-fee/blob/master/app/code/local/Voronoy/ExtraFee/Block/Sales/Order/Totals/Rule.php

Check to see if the shipping method matches your local pickup method and exit the function. So instead of trying to remove the fee, you prevent it from been added. (Keep in mind that you should rewrite this class or try another acceptable way of making changes without directly editing this extension)

/**
 * Add this total to parent
 */
public function initTotals()
{
    /* start custom code */

    if (Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod() === 'local_pickup') {
        return $this;
    }
    /* end custom code */

    if ((float) $this->getSource()->getExtraFeeRuleAmount() <= 0) {
        return $this;
    }
    if ($this->getSource()->getExtraFeeRuleDescription()) {
        $discountLabel = $this->__('%s (%s)', Mage::helper('voronoy_extrafee')->getExtraFeeRuleLabel(),
            $this->getSource()->getExtraFeeRuleDescription());
    } else {
        $discountLabel = Mage::helper('voronoy_extrafee')->getExtraFeeRuleLabel();
    }
    ....
  • I just created new observer, i am stick with condition gist.github.com/ZusZus/ea4b46ecec6f3fbb2ce395b5688dcb6b – zus Aug 13 at 6:28
  • @zus... not sure what you are trying to accomplish, the quickest way to accomplish your goal would be to add you logic around the area where it adds the fee. – Renon Stewart Aug 13 at 16:54
  • copy Rule.php from app/code/local/Voronoy/ExtraFee/Block/Sales/Order/Totals/Rule.php to app/code/local/Gta/ExtraFeesRemoveAus/Block/Sales/Order/Totals/Rule/Rule.php -> pastiebin.com/5d5680344a0a0 is right what i did? – zus Aug 16 at 10:07
  • How can i add website filter? – zus Aug 16 at 10:09
1

Solved.

https://github.com/yvoronoy/magento-extension-extra-fee/blob/master/app/code/local/Voronoy/ExtraFee/Model/Quote/Address/Total/Fee/Rule.php

public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        if (!Mage::helper('voronoy_extrafee')->isRuleExtraFeeEnabled()) {
            return $this;
        }
        parent::collect($address);
        $quote = $address->getQuote();
        $shipping_method = $quote->getShippingAddress()->getShippingMethod();

        /* Flat Rate Condition Start*/
        if($shipping_method != 'flatrate_flatrate'):
            $store = Mage::app()->getStore($quote->getStoreId());
            $this->_calculator->reset($address);

            $items = $this->_getAddressItems($address);
            if (!count($items)) {
                return $this;
            }

            $this->_calculator->init($store->getWebsiteId(), $quote->getCustomerGroupId(), $quote->getCouponCode());
            $this->_calculator->initTotals($items, $address);

            $items = $this->_calculator->sortItemsByPriority($items);
            foreach ($items as $item) {
                if ($item->getParentItemId()) {
                    continue;
                }
                if ($item->getHasChildren() && $item->isChildrenCalculated()) {
                    foreach ($item->getChildren() as $child) {
                        $this->_calculator->process($child);
                        $this->_addAmount($child->getExtraFeeRuleAmount());
                        $this->_addBaseAmount($child->getBaseExtraFeeRuleAmount());
                    }
                } else {
                    $this->_calculator->process($item);
                    $this->_addAmount($item->getExtraFeeRuleAmount());
                    $this->_addBaseAmount($item->getBaseExtraFeeRuleAmount());
                }
            }
            $this->_calculator->prepareDescription($address);
        endif;
        / Flat Rate Condition End /
    }

Thanks : https://community.magento.com

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.