I have added a product in commerce. Each products have a price and sale price. In product listing page the price is cutout and sale price is displayed. When a product is added to the cart, sale price is not calculated in checkout. Instead original price is calculated. Since i'm new in drupal, I have no idea to solve this problem.
Could you change the field labels and make the field used for the price calculation the actual sale price field? The other one you could possibly call something like "original price" or so.
If this isn't feasible and you're on Drupal 8, it sounds like you want to implement a custom price resolver.
You need to change one of your views:
Shopping cart summary (Cart line item summary displayed during checkout.) I think just that you need.
Shopping cart block(Display a list of line items added to cart.)
If above mentioned is not the answer to your question. You need to calculate new price for product item on checkout form page.
For that you need to implement
hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) function in your custom module, then grabbing price from
$form_state array you need to change it for your needs then assign new price to a