the download link for the product is not showing
This could mean the link as a whole does not show up, the link target is empty or it is not generated at all (no link_hash value) in the database.
The link to the downloadable Product gets generated within the sales_order_item_save_commit_after
event in the saveDownloadableOrderItem
method in Mage_Downloadable_Model_Observer
.
So if it is not generated at all, have a look in your downloadable_link_purchased_item
database table and check if there are values under link_hash
and link_url
or link_file
fields.
If not, you might have another problem, with your e-mail template maybe.
To calculate the discount amount for each item, Magento uses the following equation:
This is done in the app\code\core\Mage\SalesRule\Model\Validator.php file, process() method.
In your case:
SUM of all the products ordered: $ 161.91
Discount total: $ 4.86
Calculates the items:
(ORIGINAL PRICE / 161.91) * 4.86 = x
- (3.47 / 161.91) * 4.86 = $ 0.10
- (1.87 / 161.91) * 4.86 = $ 0.06
- (156.57 / 161.91) * 4.86 = $ 4.70
Why? No such answer in Magento. But it does distribute the discount equally using the "original price" field.
Best Answer
Finally I found out the answer myself, after several experiment.