Can anyone offer guidance on how I’d accomplish the feature outlined in this thread: http://www.magentocommerce.com/boards/viewthread/8387/
To summarize, I’d like to create a cart-level promo that scales depending on the amount of a particular product-type is in the cart. This functionality doesn’t exist with core magento, so Moshe suggested I modify a few files. Here is his response, but I’m new enough to magento that I dont know what to make of it or where to begin!:
any help is greatly appreciated
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
With existing price rules logic components it is not possible to create this promotion.
However, it is possible to extend price rules to allow this functionality.
Basically that would boil down to counting quantity of matching “condition” wall mount items in cart, and then limiting discounted items to this quantity for matching “action” cable items.
I know it sounds obvious, but that previous sentence would directly translate to programming steps.
Overloaded files would be Mage/SalesRule/Model/Validator.php and Mage/Sales/Model/Quote/Address/Total/Discount.php
Alternatively you could bind to event “sales_quote_address_discount_item” (dispatched in Mage/Sales/Model/Quote/Address/Total/Discount.php) and using simple logic set for matching items (cables) these values if other items match to wall mount items, limiting by total quantity of wall mounts:
* discount_percent to 100
* discount_amount to row_total
* base_discount_amount to base_row_total