2

I'm using Magento 1.7.0.2 and enabled the checkout store pickup function as described here: http://www.magentocommerce.com/boards/viewthread/12703/

It works fine so far. But I also need to apply a cart price rule to add 5% discount if a customer picks store pickup as the Shipping method.

Unfortunately that doesn't seem to work. The rule is not considered.

My cart price rule looks like:

If ALL conditions are TRUE:
Shipping IS [pickup] Store Pickup

Action:

Percent of product price discount, Discount Amount: 5

If I select any other condition instead of pickup (like flatrate) it works as desired. But if I select pickup, nothing happens.

Any ideas why and how to fix this?

0

Change this file /app/code/core/Mage/Shipping/Model/Carrier/Pickup.php. Cause of this issue is when collectRates() method executed, carrier method 'pickup' will be setted as shipping method ($method->setMethod('store')), but member function getAllowedMethods() offers only 'pickup' method, and thats why we change 'store' to 'pickup'. By the way Shopping cart price rules uses getAllowedMethods(), and frontend checkout uses collectRates(), but both function picks different shipping method.

EDIT

Sorry, I was little confused while giving previous answer, but solution already given at this point. You should change function collectRates() this line:

$method->setMethod('store');

to

$method->setMethod('pickup');
  • Never modify a core file. Ever. – philwinkle Nov 1 '13 at 6:18
  • Thanks for the answer. :) I don't know if I understand you correctly but the file and the function you mentioned already looks like this: return array('pickup'=>Mage::helper('shipping')->__('Store Pickup')); When comparing the Pickup.php's getAllowedMethods() function I can't see any difference between this and (for instance) Flatrate.php's getAllowedMethods() function, except for the different names. But it is always return array('method' => 'caption'); – Mario Werner Nov 1 '13 at 7:28
  • @philwinkle Yes, you are right. Strange thing with this is if you copy the required structure and files over to local and modify it Magento does not recognize the change somehow and does not enable the method. And yes, file and directory structure was 1:1 identical. – Mario Werner Nov 1 '13 at 7:31
  • @philwinkle, I modified because of this file is already have been modified. I give simple solution, If Mario Werner knows extend core files, he should extend it without modifying. – mageUz Nov 1 '13 at 9:42
  • @Mario Werner, see updated answer, it should give result. – mageUz Nov 1 '13 at 13:37

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.