建站之星产品帮助

查看: 6386|回复: 16
打印 上一主题 下一主题

遇到一点小麻烦,请知道的朋友帮个忙,在线等待

[复制链接]
跳转到指定楼层
1#
发表于 2010-8-26 17:55:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
产品价格都是带小数点和两个零,例如:120.00我想去掉小数点和后面的两个零,只显示到元,但是不知道在哪里设置,请知道的朋友指点一下。
先谢谢了。

在线等候
2#
发表于 2010-8-26 22:07:06 | 只看该作者
您可以使用intval函数 进行取整。具体示例如下 <?php echo intval($curr_product->delivery_fee); ?>
1.2版本需要修改 \view\mod_product\view.php文件 newprd.php文件中价格显示部份。以下为view.php文件

  1. <?php if ($curr_product->online_orderable && EZSITE_LEVEL=='2') { ?>
  2.                         <?php if ($curr_product->discount_price != $curr_product->price) { ?>
  3.                                 <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
  4.                                 <?php _e('Discount Price'); ?> : ¥<?php echo intval($curr_product->discount_price); ?><br />
  5.                                 <?php } else { ?>
  6.                                 <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
  7.                                 <?php } ?>
  8.                                 <?php _e('Delivery Fee'); ?> : ¥<?php echo intval($curr_product->delivery_fee); ?><br />
  9.                                 <?php _e('Quantity'); ?> : <?php echo Html::input('text', 'prod_num_'.$curr_product->id, $_COOKIE['n_prd'][$curr_product->id]?$_COOKIE['n_prd'][$curr_product->id]:1, 'size="4"'); ?><br />                                
  10.                                 <input type="button" class="add_to_cart_b_view" value="<?php _e('Add to cart'); ?>" onclick="add2cart('<?php echo $curr_product->id; ?>');return false;" />
  11.             <?php } ?></div>
复制代码
3#
 楼主| 发表于 2010-8-27 10:37:17 | 只看该作者
谢谢管理员
newprd.php文件不知道该怎么改
view\mod_product\view.php改过以后在产品介绍页出现错误
Parse error: syntax error, unexpected ';' in C:\wwwroot\web\view\mod_product\view.php on line 48

如果可以,我把这两个文件传给你,你帮我改一下可以吗
我的QQ是55999829
有点急,在线等候。
4#
发表于 2010-8-27 10:54:35 | 只看该作者
建议您自己修改,因为程序更新有可能会覆盖掉这两个文件注意以下问题
按以下修改即可
原代码中
  1. <?php echo $curr_product->delivery_fee; ?>
复制代码
修改为
  1. <?php echo intval($curr_product->delivery_fee); ?>
复制代码
<?php echo $curr_product->price; ?>
修改为 <?php echo intval($curr_product->price); ?>
<?php echo $curr_product->discount_price; ?>
修改为
<?php echo intval($curr_product->discount_price); ?>
5#
 楼主| 发表于 2010-8-27 10:54:55 | 只看该作者
view\mod_product\view.php修改前的代码

<?php if (!defined('IN_CONTEXT')) die('access violation error!'); ?>


<div class="art_list">
        <div class="art_list_title"><?php echo $curr_product->name; ?></div>
        <div class="prodview_info"><?php _e('Category'); ?>: <?php echo $curr_product->masters['ProductCategory']->name; ?>&nbsp;
    <?php _e('Publish Time'); ?>: <?php echo date('Y-m-d H:i', $curr_product->create_time); ?>&nbsp;</div>
        <div class="artview_intr"><?php echo $curr_product->introduction; ?></div>
        <div class="prodview_pic jqzoom"><!--a href="<?php echo $curr_product->feature_img; ?>" title="<?php echo $curr_product->name; ?>" class="thickbox">
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" border="0" align="left" class="productimg" /></a-->
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" jqimg="<?php echo $curr_product->feature_img; ?>" /></div>
        <div class="prodview_prices">
        <?php if ($curr_product->online_orderable && EZSITE_LEVEL=='2') { ?>
            <script type="text/javascript" language="javascript">
            <!--
                function updatecartstate(response) {
                    var o_result = _eval_json(response);
                    if (!o_result) {
                        return addprodfailed(response);
                    }
                    
                    if (o_result.result == "ERROR") {
                        alert(o_result.errmsg);
                        return false;
                    } else if (o_result.result == "OK") {
                        $("#disp_n_prds").html(o_result.n_prds);
                        alert("<?php _e('The product has been added to cart!'); ?>");
                        return true;
                    } else {
                        return on_failure(response);
                    }
                }
               
                function addprodfailed(response) {
                    alert("<?php _e('Request failed!'); ?>");
                    return false;
                }
               
                function add2cart(p_id) {
                    var p_num = document.getElementById("prod_num_" + p_id).value;
                    _ajax_request("mod_cart", "addtocart",
                        { p_id: p_id, p_num: p_num }, updatecartstate, addprodfailed);
                }
            //-->
            </script>
                        <?php if ($curr_product->discount_price != $curr_product->price) { ?>
                                <?php _e('Price'); ?> : ¥<?php echo $curr_product->price; ?><br />
                                <?php _e('Discount Price'); ?> : ¥<?php echo $curr_product->discount_price; ?><br />
                                <?php } else { ?>
                                <?php _e('Price'); ?> : ¥<?php echo $curr_product->price; ?><br />
                                <?php } ?>
                                <?php _e('Delivery Fee'); ?> : ¥<?php echo $curr_product->delivery_fee; ?><br />
                                <?php _e('Quantity'); ?> : <?php echo Html::input('text', 'prod_num_'.$curr_product->id, $_COOKIE['n_prd'][$curr_product->id]?$_COOKIE['n_prd'][$curr_product->id]:1, 'size="4"'); ?><br />                               
                                <input type="button" class="add_to_cart_b_view" value="<?php _e('Add to cart'); ?>" onclick="add2cart('<?php echo $curr_product->id; ?>');return false;" />
            <?php } ?></div>
        <div class="prodview_content"><?php
    $pos = strpos($_SERVER['PHP_SELF'],'/index.php');
        $path = substr($_SERVER['PHP_SELF'],0,$pos);
        if(strpos($curr_product->description,$path.'/') == 0) {
                $curr_product->description = str_replace('/admin/fckeditor',$path.'/admin/fckeditor',$curr_product->description);
        }
        echo $curr_product->description; ?></div>



<?php if (defined('SYSVER')) { ?>
        <p id="product_gallery">
            <?php
                $curr_product->loadRelatedObjects(REL_CHILDREN, array('ProductPic'));
                $ext_pics = $curr_product->slaves['ProductPic'];
                if (sizeof($ext_pics) > 0) {
                    foreach ($ext_pics as $pic) {
            ?>
                <a href="<?php echo $pic->pic; ?>" rel="product_gallery" class="thickbox">
                    <img class="product_gallery_pic" src="<?php echo $pic->pic; ?>" /></a>
            <?php
                    }
                }
            ?>
        </p>
<?php } ?>
</div>
6#
发表于 2010-8-27 10:57:48 | 只看该作者
view\mod_product\view.php 修改后
  1. <?php if (!defined('IN_CONTEXT')) die('access violation error!'); ?>


  2. <div class="art_list">
  3.         <div class="art_list_title product_title"><?php echo $curr_product->name; ?></div>
  4.         <div class="prodview_info"><?php _e('Category'); ?>: <?php echo $curr_product->masters['ProductCategory']->name; ?>&nbsp;
  5.     <?php _e('Publish Time'); ?>: <?php echo date('Y-m-d H:i', $curr_product->create_time); ?>&nbsp;</div>
  6.         <div class="artview_intr"><?php echo $curr_product->introduction; ?></div>
  7.         <div class="prodview_pic jqzoom"><!--a href="<?php echo $curr_product->feature_img; ?>" title="<?php echo $curr_product->name; ?>" class="thickbox">
  8.         <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" border="0" align="left" class="productimg" /></a-->
  9.         <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" jqimg="<?php echo $curr_product->feature_img; ?>" /></div>
  10.         <div class="prodview_prices">
  11.         <?php if ($curr_product->online_orderable && EZSITE_LEVEL=='2') { ?>
  12.                         <?php if ($curr_product->discount_price != $curr_product->price) { ?>
  13.                                 <?php _e('Price'); ?> : ¥<?php echo $curr_product->price; ?><br />
  14.                                 <?php _e('Discount Price'); ?> : ¥<?php echo intval($curr_product->discount_price); ?><br />
  15.                                 <?php } else { ?>
  16.                                 <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
  17.                                 <?php } ?>
  18.                                 <?php _e('Delivery Fee'); ?> : ¥<?php echo intval($curr_product->delivery_fee); ?><br />
  19.                                 <?php _e('Quantity'); ?> : <?php echo Html::input('text', 'prod_num_'.$curr_product->id, $_COOKIE['n_prd'][$curr_product->id]?$_COOKIE['n_prd'][$curr_product->id]:1, 'size="4"'); ?><br />                                
  20.                                 <input type="button" class="add_to_cart_b_view" value="<?php _e('Add to cart'); ?>" onclick="add2cart('<?php echo $curr_product->id; ?>');return false;" />
  21.             <?php } ?></div>
  22.         <div class="prodview_content"><?php
  23.     $pos = strpos($_SERVER['PHP_SELF'],'/index.php');
  24.         $path = substr($_SERVER['PHP_SELF'],0,$pos);
  25.         if(strpos($curr_product->description,$path.'/') == 0) {
  26.                 $curr_product->description = str_replace('/admin/fckeditor',$path.'/admin/fckeditor',$curr_product->description);
  27.         }
  28.         echo $curr_product->description; ?></div>



  29. <?php if (defined('SYSVER')) { ?>
  30.         <p id="product_gallery">
  31.             <?php
  32.                 $curr_product->loadRelatedObjects(REL_CHILDREN, array('ProductPic'));
  33.                 $ext_pics = $curr_product->slaves['ProductPic'];
  34.                 if (sizeof($ext_pics) > 0) {
  35.                     foreach ($ext_pics as $pic) {
  36.             ?>
  37.                 <a href="<?php echo $pic->pic; ?>" rel="product_gallery" class="thickbox">
  38.                     <img class="product_gallery_pic" src="<?php echo $pic->pic; ?>" /></a>
  39.             <?php
  40.                     }
  41.                 }
  42.             ?>
  43.         </p>
  44. <?php } ?>
  45. </div>
复制代码
7#
 楼主| 发表于 2010-8-27 10:59:50 | 只看该作者
view\mod_product\view.php修改后的代码


<?php if (!defined('IN_CONTEXT')) die('access violation error!'); ?>


<div class="art_list">
        <div class="art_list_title"><?php echo $curr_product->name; ?></div>
        <div class="prodview_info"><?php _e('Category'); ?>: <?php echo $curr_product->masters['ProductCategory']->name; ?>&nbsp;
    <?php _e('Publish Time'); ?>: <?php echo date('Y-m-d H:i', $curr_product->create_time); ?>&nbsp;</div>
        <div class="artview_intr"><?php echo $curr_product->introduction; ?></div>
        <div class="prodview_pic jqzoom"><!--a href="<?php echo $curr_product->feature_img; ?>" title="<?php echo $curr_product->name; ?>" class="thickbox">
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" border="0" align="left" class="productimg" /></a-->
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" jqimg="<?php echo $curr_product->feature_img; ?>" /></div>
        <div class="prodview_prices">
        <?php if ($curr_product->online_orderable && EZSITE_LEVEL=='2') { ?>
            <script type="text/javascript" language="javascript">
            <!--
                function updatecartstate(response) {
                    var o_result = _eval_json(response);
                    if (!o_result) {
                        return addprodfailed(response);
                    }
                    
                    if (o_result.result == "ERROR") {
                        alert(o_result.errmsg);
                        return false;
                    } else if (o_result.result == "OK") {
                        $("#disp_n_prds").html(o_result.n_prds);
                        alert("<?php _e('The product has been added to cart!'); ?>");
                        return true;
                    } else {
                        return on_failure(response);
                    }
                }
               
                function addprodfailed(response) {
                    alert("<?php _e('Request failed!'); ?>");
                    return false;
                }
               
                function add2cart(p_id) {
                    var p_num = document.getElementById("prod_num_" + p_id).value;
                    _ajax_request("mod_cart", "addtocart",
                        { p_id: p_id, p_num: p_num }, updatecartstate, addprodfailed);
                }
            //-->
            </script>
                        <?php if ($curr_product->online_orderable && EZSITE_LEVEL=='2') { ?>
                        <?php if ($curr_product->discount_price != $curr_product->price) { ?>
                                <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
                                <?php _e('Discount Price'); ?> : ¥<?php echo intval($curr_product->discount_price); ?><br />
                                <?php } else { ?>
                                <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
                                <?php } ?>
                                <?php _e('Delivery Fee'); ?> : ¥<?php echo intval($curr_product->delivery_fee); ?><br />
                                <?php _e('Quantity'); ?> : <?php echo Html::input('text', 'prod_num_'.$curr_product->id, $_COOKIE['n_prd'][$curr_product->id]?$_COOKIE['n_prd'][$curr_product->id]:1, 'size="4"'); ?><br />                                
                                <input type="button" class="add_to_cart_b_view" value="<?php _e('Add to cart'); ?>" onclick="add2cart('<?php echo $curr_product->id; ?>');return false;" />
            <?php } ?></div>
        <div class="prodview_content"><?php
    $pos = strpos($_SERVER['PHP_SELF'],'/index.php');
        $path = substr($_SERVER['PHP_SELF'],0,$pos);
        if(strpos($curr_product->description,$path.'/') == 0) {
                $curr_product->description = str_replace('/admin/fckeditor',$path.'/admin/fckeditor',$curr_product->description);
        }
        echo $curr_product->description; ?></div>



<?php if (defined('SYSVER')) { ?>
        <p id="product_gallery">
            <?php
                $curr_product->loadRelatedObjects(REL_CHILDREN, array('ProductPic'));
                $ext_pics = $curr_product->slaves['ProductPic'];
                if (sizeof($ext_pics) > 0) {
                    foreach ($ext_pics as $pic) {
            ?>
                <a href="<?php echo $pic->pic; ?>" rel="product_gallery" class="thickbox">
                    <img class="product_gallery_pic" src="<?php echo $pic->pic; ?>" /></a>
            <?php
                    }
                }
            ?>
        </p>
<?php } ?>
</div>
8#
发表于 2010-8-27 11:10:20 | 只看该作者
请按此进行修改即可
原代码中<?php echo $curr_product->delivery_fee; ?>
复制代码修改为<?php echo intval($curr_product->delivery_fee); ?>
复制代码<?php echo $curr_product->price; ?>
修改为 <?php echo intval($curr_product->price); ?>
<?php echo $curr_product->discount_price; ?>
修改为
<?php echo intval($curr_product->discount_price); ?>
9#
 楼主| 发表于 2010-8-27 13:27:40 | 只看该作者
谢谢管理员
view\mod_product\newprd.php中您让我找的代码我没有找到,
以下为newprd.php源文件
<?php
if (!defined('IN_CONTEXT')) die('access violation error!');
// for division by zero
//$cols = $p_cols;
$cols = intval($p_cols) ? intval($p_cols) : 3;
?>

                <div class="newprod">
                                <div class="newprod_top"></div>
                                <div class="newprod_con">

            <script type="text/javascript" language="javascript">
            <!--
                function updatecartstate(response) {
                    var o_result = _eval_json(response);
                    if (!o_result) {
                        return addprodfailed(response);
                    }
                    
                    if (o_result.result == "ERROR") {
                        alert(o_result.errmsg);
                        return false;
                    } else if (o_result.result == "OK") {
                        $("#disp_n_prds").html(o_result.n_prds);
                        alert("<?php _e('The product has been added to cart!'); ?>");
                        return true;
                    } else {
                        return on_failure(response);
                    }
                }
               
                function addprodfailed(response) {
                    alert("<?php _e('Request failed!'); ?>");
                    return false;
                }
               
                function add2cart(p_id) {
                    var p_num = document.getElementById("prod_num_" + p_id).value;
                    _ajax_request("mod_cart", "addtocart",
                        { p_id: p_id, p_num: p_num }, updatecartstate, addprodfailed);
                }
            //-->
            </script>
                       
<?php
$n_prd = sizeof($products);
if ($n_prd > 0){
?>
        <table class="media_grid" cellspacing="4" width="100%">
                <?php
                for ($i = 0; $i < $n_prd; $i++) {
                        if ($i % $cols == 0) {
                                echo '<tr>';
                        }
                        $_product=$products[$i];
                        $_product->loadRelatedObjects(REL_PARENT, array('ProductCategory'));
                ?>
                        <td>
            <div class="newprod_list">
                                <div class="newprod_pic"><a href="<?php echo Html::uriquery('mod_product', 'view', array('p_id' => $products[$i]->id)); ?>" title="<?php echo $products[$i]->name;?>"><img name="picautozoom" border="0" src="<?php echo $products[$i]->feature_smallimg;?>" class="prodthumb" /></a></div>
                <div class="newprod_name"><a href="<?php echo Html::uriquery('mod_product', 'view', array('p_id' => $products[$i]->id)); ?>"><?php echo $products[$i]->name;?></a></div>
                <?php if( (EZSITE_LEVEL=='2') && $show_price){?><div class="newprod_price">¥<?php echo $products[$i]->price;?></div><?php }?>
                                <div class="newprod_intr"><?php _e('Category'); ?>: <a href="<?php echo Html::uriquery('mod_product', 'prdlist', array('cap_id' => $_product->masters['ProductCategory']->id)); ?>"><?php echo $_product->masters['ProductCategory']->name; ?></a></div>
                <div class="blankbar1"></div>
            </div>
            
                        </td>
                <?php
                        if (($i % $cols) == ($cols - 1)) {
                                echo '</tr>';
                        }
                }
                if ($i % $cols != 0) {
                        for ($j = 0; $j < ($cols - $i); $j++) {
                                echo '<td width="'.intval(100 / $cols).'%">&nbsp;</td>';
                        }
                        echo '</tr>';
                }
                ?>
        </table>
<?php } ?>

       
                        </div>
                                <div class="list_bot"></div>
                        </div>
                        <div class="blankbar"></div>

请帮助,谢谢。
10#
发表于 2010-8-27 13:34:35 | 只看该作者
修改代码 <?php echo $products[$i]->price;?>
修改为
  1. <?php echo intval($products[$i]->price);?>
复制代码
11#
 楼主| 发表于 2010-8-27 14:17:23 | 只看该作者
谢谢管理员
两个文件都修改了
首页里的商品图片点击后会出现
404 Object Not Found

You see this page because one of modules or pages you requested is not present.
Maybe the module is not properly installed. Please try reinstall the module!

能帮助解决吗?
谢谢
12#
 楼主| 发表于 2010-8-27 18:02:26 | 只看该作者
本帖最后由 wenxin8 于 2010-8-27 18:07 编辑

谢谢管理员
view\mod_product\newprd.php文件里的全部代码如下。这是修改过的,修改前的没有了。

<?php
if (!defined('IN_CONTEXT')) die('access violation error!');
// for division by zero
//$cols = $p_cols;
$cols = intval($p_cols) ? intval($p_cols) : 3;
?>

                <div class="newprod">
                                <div class="newprod_top"></div>
                                <div class="newprod_con">

            <script type="text/javascript" language="javascript">
            <!--
                function updatecartstate(response) {
                    var o_result = _eval_json(response);
                    if (!o_result) {
                        return addprodfailed(response);
                    }
                    
                    if (o_result.result == "ERROR") {
                        alert(o_result.errmsg);
                        return false;
                    } else if (o_result.result == "OK") {
                        $("#disp_n_prds").html(o_result.n_prds);
                        alert("<?php _e('The product has been added to cart!'); ?>");
                        return true;
                    } else {
                        return on_failure(response);
                    }
                }
               
                function addprodfailed(response) {
                    alert("<?php _e('Request failed!'); ?>");
                    return false;
                }
               
                function add2cart(p_id) {
                    var p_num = document.getElementById("prod_num_" + p_id).value;
                    _ajax_request("mod_cart", "addtocart",
                        { p_id: p_id, p_num: p_num }, updatecartstate, addprodfailed);
                }
            //-->
            </script>
                        
<?php
$n_prd = sizeof($products);
if ($n_prd > 0){
?>
        <table class="media_grid" cellspacing="4" width="100%">
                <?php
                for ($i = 0; $i < $n_prd; $i++) {
                        if ($i % $cols == 0) {
                                echo '<tr>';
                        }
                        $_product=$products[$i];
                        $_product->loadRelatedObjects(REL_PARENT, array('ProductCategory'));
                ?>
                        <td>
            <div class="newprod_list">
                                <div class="newprod_pic"><a href="<?php echo Html::uriquery('file:///G|/sitestar_v1.2_build100726%20(1)/view/mod_product/mod_product', 'view', array('p_id' => $products[$i]->id)); ?>" title="<?php echo $products[$i]->name;?>"><img name="picautozoom" border="0" src="<?php echo $products[$i]->feature_smallimg;?>" class="prodthumb" /></a></div>
                <div class="newprod_name"><a href="<?php echo Html::uriquery('file:///G|/sitestar_v1.2_build100726%20(1)/view/mod_product/mod_product', 'view', array('p_id' => $products[$i]->id)); ?>"><?php echo $products[$i]->name;?></a></div>
                <?php if( (EZSITE_LEVEL=='2') && $show_price){?><div class="newprod_price">¥<?php echo intval($products[$i]->price);?></div><?php }?>
                                <div class="newprod_intr"><?php _e('Category'); ?>: <a href="<?php echo Html::uriquery('file:///G|/sitestar_v1.2_build100726%20(1)/view/mod_product/mod_product', 'prdlist', array('cap_id' => $_product->masters['ProductCategory']->id)); ?>"><?php echo $_product->masters['ProductCategory']->name; ?></a></div>
                <div class="blankbar1"></div>
            </div>
            
                        </td>
                <?php
                        if (($i % $cols) == ($cols - 1)) {
                                echo '</tr>';
                        }
                }
                if ($i % $cols != 0) {
                        for ($j = 0; $j < ($cols - $i); $j++) {
                                echo '<td width="'.intval(100 / $cols).'%"> </td>';
                        }
                        echo '</tr>';
                }
                ?>
        </table>
<?php } ?>

        
                        </div>
                                <div class="list_bot"></div>
                        </div>
                        <div class="blankbar"></div>
13#
 楼主| 发表于 2010-8-27 19:01:41 | 只看该作者
本帖最后由 wenxin8 于 2010-8-27 19:05 编辑

谢谢HONG管理员,在您的帮助下,终于可以正常点击了。
可以麻烦您帮我看看为什么小数点和零怎么又出来了,如何能够去掉小数点和后面的两个零。
谢谢了在线等候。
我的网址是http://eso.jp/web/index.php?_m=mod_product&_a=view&p_id=1090

谢谢。
14#
发表于 2010-8-27 19:11:56 | 只看该作者
您可以按之前的方法再修改一次,每修改一个文件,请做好备份,假如修改坏了,也能及时恢复
15#
 楼主| 发表于 2010-8-27 20:04:34 | 只看该作者
谢谢limpiang的提醒,我试验了几遍
第一步:
把view.php原代码中<?php echo $curr_product->delivery_fee; ?>
修改为<?php echo intval($curr_product->delivery_fee); ?>
结果:没有出现问题
第二步:
把viewok.php原代码中<?php echo $curr_product->discount_price; ?>
修改为<?php echo intval($curr_product->discount_price); ?>
结果:没有出错
第三步:
在view.php里做下面更改后会报错,
把viewok.php原代码中<?php echo $curr_product->price; ?>
修改为 <?php echo intval($curr_product->price); ?>
点击商品后,链接的商品页面不表示内容,
Parse error: syntax error, unexpected ';' in C:\wwwroot\web\view\mod_product\view.php on line 15
-----------------------------------------------------------------------------------------------------------
view.php修改后的源码
<?php if (!defined('IN_CONTEXT')) die('access violation error!'); ?>


<div class="art_list">
        <div class="art_list_title product_title"><?php echo $curr_product->name; ?></div>
        <div class="prodview_info"><?php _e('Category'); ?>: <?php echo $curr_product->masters['ProductCategory']->name; ?>&nbsp;
    <?php _e('Publish Time'); ?>: <?php echo date('Y-m-d H:i', $curr_product->create_time); ?>&nbsp;</div>
        <div class="artview_intr"><?php echo $curr_product->introduction; ?></div>
        <div class="prodview_pic jqzoom"><!--a href="<?php echo $curr_product->feature_img; ?>" title="<?php echo $curr_product->name; ?>" class="thickbox">
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" border="0" align="left" class="productimg" /></a-->
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" jqimg="<?php echo $curr_product->feature_img; ?>" /></div>
        <div class="prodview_prices">
        <?php if ($curr_product->online_orderable && EZSITE_LEVEL=='2') { ?>
                        <?php if ($curr_product->discount_price != $curr_product->price) { ?>
                                <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
                                <?php _e('Discount Price'); ?> : ¥<?php echo intval($curr_product->discount_price); ?><br />
                                <?php } else { ?>
                                <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
                                <?php } ?>
                                <?php _e('Delivery Fee'); ?> : ¥<?php echo intval($curr_product->delivery_fee); ?><br />
                                <?php _e('Quantity'); ?> : <?php echo Html::input('text', 'prod_num_'.$curr_product->id, $_COOKIE['n_prd'][$curr_product->id]?$_COOKIE['n_prd'][$curr_product->id]:1, 'size="4"'); ?><br />                                
                                <input type="button" class="add_to_cart_b_view" value="<?php _e('Add to cart'); ?>" onclick="add2cart('<?php echo $curr_product->id; ?>');return false;" />
            <?php } ?></div>
        <div class="prodview_content"><?php
    $pos = strpos($_SERVER['PHP_SELF'],'/index.php');
        $path = substr($_SERVER['PHP_SELF'],0,$pos);
        if(strpos($curr_product->description,$path.'/') == 0) {
                $curr_product->description = str_replace('/admin/fckeditor',$path.'/admin/fckeditor',$curr_product->description);
        }
        echo $curr_product->description; ?></div>



<?php if (defined('SYSVER')) { ?>
        <p id="product_gallery">
            <?php
                $curr_product->loadRelatedObjects(REL_CHILDREN, array('ProductPic'));
                $ext_pics = $curr_product->slaves['ProductPic'];
                if (sizeof($ext_pics) > 0) {
                    foreach ($ext_pics as $pic) {
            ?>
                <a href="<?php echo $pic->pic; ?>" rel="product_gallery" class="thickbox">
                    <img class="product_gallery_pic" src="<?php echo $pic->pic; ?>" /></a>
            <?php
                    }
                }
            ?>
        </p>
<?php } ?>
</div>

-------------------------------------------------------------------------------------------------------------------
view.php修改前的源码
<?php if (!defined('IN_CONTEXT')) die('access violation error!'); ?>


<div class="art_list">
        <div class="art_list_title product_title"><?php echo $curr_product->name; ?></div>
        <div class="prodview_info"><?php _e('Category'); ?>: <?php echo $curr_product->masters['ProductCategory']->name; ?>&nbsp;
    <?php _e('Publish Time'); ?>: <?php echo date('Y-m-d H:i', $curr_product->create_time); ?>&nbsp;</div>
        <div class="artview_intr"><?php echo $curr_product->introduction; ?></div>
        <div class="prodview_pic jqzoom"><!--a href="<?php echo $curr_product->feature_img; ?>" title="<?php echo $curr_product->name; ?>" class="thickbox">
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" border="0" align="left" class="productimg" /></a-->
        <img name="picautozoom" src="<?php echo $curr_product->feature_smallimg; ?>" alt="" jqimg="<?php echo $curr_product->feature_img; ?>" /></div>
        <div class="prodview_prices">
        <?php if ($curr_product->online_orderable && EZSITE_LEVEL=='2') { ?>
                        <?php if ($curr_product->discount_price != $curr_product->price) { ?>
                                <?php _e('Price'); ?> : ¥<?php echo $curr_product->price; ?><br />
                                <?php _e('Discount Price'); ?> : ¥<?php echo intval($curr_product->discount_price); ?><br />
                                <?php } else { ?>
                                <?php _e('Price'); ?> : ¥<?php echo intval($curr_product->price); ?><br />
                                <?php } ?>
                                <?php _e('Delivery Fee'); ?> : ¥<?php echo intval($curr_product->delivery_fee); ?><br />
                                <?php _e('Quantity'); ?> : <?php echo Html::input('text', 'prod_num_'.$curr_product->id, $_COOKIE['n_prd'][$curr_product->id]?$_COOKIE['n_prd'][$curr_product->id]:1, 'size="4"'); ?><br />                                
                                <input type="button" class="add_to_cart_b_view" value="<?php _e('Add to cart'); ?>" onclick="add2cart('<?php echo $curr_product->id; ?>');return false;" />
            <?php } ?></div>
        <div class="prodview_content"><?php
    $pos = strpos($_SERVER['PHP_SELF'],'/index.php');
        $path = substr($_SERVER['PHP_SELF'],0,$pos);
        if(strpos($curr_product->description,$path.'/') == 0) {
                $curr_product->description = str_replace('/admin/fckeditor',$path.'/admin/fckeditor',$curr_product->description);
        }
        echo $curr_product->description; ?></div>



<?php if (defined('SYSVER')) { ?>
        <p id="product_gallery">
            <?php
                $curr_product->loadRelatedObjects(REL_CHILDREN, array('ProductPic'));
                $ext_pics = $curr_product->slaves['ProductPic'];
                if (sizeof($ext_pics) > 0) {
                    foreach ($ext_pics as $pic) {
            ?>
                <a href="<?php echo $pic->pic; ?>" rel="product_gallery" class="thickbox">
                    <img class="product_gallery_pic" src="<?php echo $pic->pic; ?>" /></a>
            <?php
                    }
                }
            ?>
        </p>
<?php } ?>
</div>
--------------------------------------------------------------------------------------------------------------
修改前的状态可以去掉优惠价和邮费的小数点,价格上的小数点去不掉。

上海美橙科技信息发展有限公司 ( 沪ICP备11006888号-4 )

快速回复 返回顶部 返回列表