Add a discount to a product with Rules I want to add a new price field called Discount to a product. So now I have two price fields, Price and Discount.

Then with the help of the rule, I am interested in showing in the node page the price(with line-trough) and the discount.

Then when adding the product to the cart, the discount price will be added, instead of the normal price. How can I achieve this with rules?

PS: I don't want to use the Commerce Sale price module since it doesn't integrate with Search api.

I have found these instructions but I am not sure how to create the rule!


Add another price field to your product type.
Add a rule that applies the discount to the price on that product if the extra price field exists. Make sure you use the Discount price component when creating the rule.
Use Extra Price Formatters to display the difference.
I finally found a solution:I cloned the rule of the Commerce Sale module:
I created a Component:
Conditions:
-Entity has field:Parameter: Entity: [line-item], Field: commerce_product
-Entity has field:Parameter: Entity: [line-item:commerce-product], Field: field_discount_price
-NOT Data value is empty:line-item:commerce-product:field-discount-price:amount

Actions:Set the unit price to a specific amount 
(Specify the numeric amount to set the price to:Price:Amount
Value:Discount

Then I created a rule:
Events:Calculating the sell price of a product
Action:The previous component
(Data selector:Commerce line items)

Then I used a price formatter and its done https://www.drupal.org/project/commerce_extra_price_formatters
Thanks!