We know that after the sale of some products in Ecshop, sales of high sales of products, can form a sales ranking, Ecshop sales must maintain two conditions, first of all, ecshop must be stocked with goods, and then the goods must be listed.
We analyze how to call the promotional price and market prices in the Ecshop sales line, first find the function functions get_top10 ($cats = ") in the lib_goods.php in Ecshop, first retrieve the commodity market price, G.market_price , and then get the promotion price and the start and end time of the promotion g.promote_start_date, G.promote_end_date,g.promote_price.
The promotion price is obtained by the start and end time of the promotion price. If the price is not zero, it is within the promotional period. Then the normal price can be invoked.
if ($arr [$i] [' promote_price '] > 0)
{
$arr [$i] [' promote_price '] = Bargain_price ($arr [$i] [' Promote_price '], $arr [$i] [' promote_start_date '], $arr [$i] [' Promote_end_date ']);
}
Else
{
$arr [$i] [' promote_price '] = 0;
}
$arr [$i] [' promote_price_format '] = Price_format ($arr [$i] [' promote_price ']);
Access to market prices is easier, $arr [$i] [' market_price_format '] = Price_format ($arr [$i] [' market_price ']);
We can use this in the template.
{if $goods. Promote_price}
{$goods. Promote_price}
{Else}
{$goods. Price}
{/if}
So how does the market price appear in the Ecshop sales ecshop template?
{$goods. Market_price_format}
The above is Ecshop sales line calls the promotion price and the price of the idea
Ecshop Sales line call promotion prices and market prices