4

I need to set up a promotion such that if a customer spends at least $X, he can get one item from category Y free (the prices in category Y vary). When I set it up as follows: Actions Apply percent of product price discount Discount Amount 100 Maximum Qty Discount is Applied to 1 Discount Qty step (buy x) 0 Apply to shipping amount No Free Shipping for shipment with matching items Stop Further Rules Processing No If all of these conditions are true Category is

Conditions Subtotal in cart is greater than or equal to 125

I have also tried under Actions It all of these conditions are true Category is one of Quantity in cart is 1

When I do this and add multiple products from category Y, one of 2 things happens: The coupon doesn't apply because there is more than 1 qualifying item (with Quantity in cart is 1) The coupon discounts every item from category Y in the cart (instead of one free, they get a bunch)

Is there a way to make it so that the discount of the full price of only one item from category Y is applied to the cart? (Note: my interim solution is to use Fixed amount discount for the whole cart/is median value of product from category Y)?

Thanks in advance!

1

1 Answer 1

1

It's not possible by default rules types, but you can add a new (custom) rule type, like "cheapest", "most expensive", "random", ect and handle them via listening event salesrule_validator_process.

To add a new rule type listen for adminhtml_block_salesrule_actions_prepareform event and in your observer add a function like

public function handleFormCreation($observer)
{
    $actionsSelect = $observer->getForm()->getElement('simple_action');
    if ($actionsSelect){
        $actionsSelect->setValues(array_merge(
            $actionsSelect->getValues(), 
            $arrayWithNewTypesHere
        ));

    }
}

There are also ready to use solutions at the magento connect.

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.