zen cart模仿taobao销售排行

2010-09-16 23:56 来源:www.chinab4c.com 作者:admin

     zen cart目前所有的销售排行。是十分简单的。也是十分粗浅的.我们将结合ecshop的开发和zen cart开发的共性。来用zen cart模仿taobao销售排行.从而达到对zen cart二次开发的有效性.

    1:includes/modules/sideboxes/best_sellers.php修改以下代码

     $bestsellers_list[$rows]['id'] = $best_sellers->fields['products_id'];
                $best_sellers->fields['products_name'] =  zen_trunc_string($best_sellers->fields['products_name'],5);
        $bestsellers_list[$rows]['name']  = $best_sellers->fields['products_name'];

        $bestsellers_list[$rows]['products_image']  = $best_sellers->fields['products_image'];
        $bestsellers_list[$rows]['products_image'] =  zen_image(DIR_WS_IMAGES . $best_sellers->fields['products_image'], $best_sellers->fields['products_name'], 70, 70);
        $best_sellers->MoveNext();

      2:includes/templates/template_default/sideboxes/tpl_best_sellers.php修改成以下代码.

      for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
    $content .= '<li >';
    $content .='<div style="float:left;margin-left:0px; margin-top:10px;"><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">'.$bestsellers_list[$i]['products_image'].'</a></div>';
    $content .='<div><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a><br>卖:12</div>';
    $content .='<div></div>';
    $content .='</li>' . "\n";
  }

      通过以上修改。达到模仿taobao 销售排行的目的。

 来源:http://www.chinab4c.com