pspahn
pspahn

Reputation: 2790

Magento Price Alerts - Trigger on Tiered Price change

I've never set a store up to use Price Alerts before, and now that I've gone through and gotten it to work, it appears as though the alert is only triggered when a product's 'Price' attribute changes.

This is nice, but what about tiered pricing? Looking through the ProductAlert core module, I am not sure where this attribute is being filtered.

I'm guessing that an additional model, say 'productalert/tierprice' will need to be created, followed by a new method in Observer.php, likely _processTierprice(). Just not sure if this concept is correct... could use a little guidance.

Thanks!

Upvotes: 0

Views: 1044

Answers (1)

benmarks
benmarks

Reputation: 23205

This shouldn't be too difficult; lots of options (it's Magento, after all)!

I'd add new methods to deal with tier price alerts. For products with tier pricing, you'd need to capture the relevant tier data along with the final price (either in a new table or in new columns on the existing product alert table). The alerts are sent out via scheduled job. So, in a nutshell (overrides where necessary):

  1. Alter the product alert schema as necessary, and amend the frontend form fields to suit
  2. In the overridden Mage_ProductAlert_AddController add a tierPriceAction() method to process the alert subscription, or adjust its existing priceAction() to handle the data being posted in / tier condition
  3. Override Mage_ProductAlert_Model_Observer as needed; I'd include a _processesTierPrice method() similar to _processPrice().
  4. Add a resource model method to get the tier-related prices
  5. Add a tier price email block and template (reference Mage_ProductAlert_Block_Email_Abstract)
  6. Profit!

As a reference for your price logic, see Mage_Catalog_Model_Product_Type_Price.

Upvotes: 1

Related Questions