I want To create Magento Discount Filter In Magento. Which Will Be on Base Of Special Product. If Product Price is 400 and special Price is 200. then Discount Will be 50% like this all.. The Filter is base on price Difference....It will automatically...created on based on price Difference.....

  • 1
    What have you tried so far, any specific technical issues, any code to show? Posting broad requirements rarely gives any answers – Sander Mangel Nov 10 '15 at 10:04
  • @SanderMangel I want to Any hint...form where...and by which block i should to start.... – Deepak Rai Nov 10 '15 at 10:06

Though my answer is not complete answer to you solution but you can try my code.

1) Create one attribute of type "Dropdown" may be called "discount_percentage".

2) Assign this attribute to the Product attribute set

3) Now for automatic calculation of the product discount you can try using observer event called "catalog_product_save_before" with following code in observer.php file

public function catalog_product_save_before($observer)
    $product = $observer->getProduct();
    $product_price = $product->getPrice();
    $product_sp_price = $product->getSpecialPrice();
    $discount_percentage = ($product_sp_price/$product_price)*100;

Note :- Before discount is assiging to product the that option should be created previously.for example if the discount is 50% the discount option 50% should be their before or else you have to look how to create this options to dropdown attributes programmatically

Not the answer you're looking for? Browse other questions tagged or ask your own question.