: Ecshop itself only involves discounts in the shopping cart. What we want is not the price ratio of a single product. In the include directory, find lib_goods.php and add the following function at the end: functionget_zhekou ($ goods_id) {$ sqlselectshop_price, market_pricefrom. $ GLOBALS [e
: Ecshop itself only involves discounts in the shopping cart. What we want is not the price ratio of a single product. In the include directory, find lib_goods.php and add the following function at the end: function get_zhekou ($ goods_id) {$ SQL = select shop_price, market_price from. $ GLOBALS ['e
:
Ecshop itself only involves discounts in the shopping cart. What we want is not the price of a single product.
Follow these steps:
Find lib_goods.php in the include directory and add the following function at the end:
Function get_zhekou ($ goods_id) {$ SQL = "select shop_price, market_price from ". $ GLOBALS ['ecs']-> table ('goods '). "WHERE goods_id = ". $ goods_id. ""; $ res = $ GLOBALS ['db']-> query ($ SQL ); while ($ row = $ GLOBALS ['db']-> fetchRow ($ res) {$ a = $ row ['shop _ price']; // product price $ B = $ row ['market _ price']; // product market price} $ c = 10; if ($ B <> 0) {$ c = $ a/$ B;} else {} // return number_format ($ c, 2) * 10; return number_format ($ c, 2) * 10 ;}
Find the following content near row 327 of the file:
$goods[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);
Add below this row:
$goods[$idx]['goods_zhekou']= get_zhekou($row['goods_id']);
Then, add the call in the foreground template:
For example:
{If $ goods. goods_zhekou} {$ goods. goods_zhekou} {else} 0 {/if} fold
Complete, simple.