Ecshop Sales line call promotion prices and market prices

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.