AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > PHP编程

如何在Ecshop中增加用户订单编辑功能

51自学网 2016-09-26 http://www.51zixue.net
第一步:准备模版文件。修改模板文件中的user_transaction.dwt。
在文件中增加一段用户显示用户编辑订单的界面模版,其实该模版可以从该文件中的详细订单显示界面模板修改过 来,只要截取商品列表和费用总计部分就好!
1、搜索”<!– {if $allow_to_cart} –>”,在该代码的前面加入:
<!– {if $allow_to_modify} –>
<a href="user.php?act=modify&order_id={$order.order_id}">编辑订单</a& gt;
<!– {/if} –>
2、搜索“<!– #BeginLibraryItem "/library/help.lbi" –>”,在其之前加入:
<!–修改订单–>
<!–{if $action eq "modify"} –>
{insert_scripts files=’transport.js’}
<div class="titles">修改订单</div>
<div class="listbox">
    <form action="user.php" name="list" method="post">
            <table width="100%" id="orderlist2">
              <tr>
            <th>{$lang.goods_name}</th>
            <th>{$lang.goods_attr}</th>
            <th align="right">{$lang.goods_price}<!– {if $order.extension_code eq "group_buy"} –>{$lang.gb_deposit}<!– {/if} –></th>
            <th width="60px;" style="text-align:center">{$lang.number}</th>
            <th width="60px;" class="rightborder">{$lang.subtotal}</th>
            <th width="60px;" class="rightborder">操作</th>
             </tr>
              <!– {foreach from=$goods_list item=goods} –>
              <tr>
            <td><a href="goods.php?id={$goods.goods_id}" target="_blank">{$goods.goods_name}</a>
              <!– {if $goods.parent_id > 0} –>
              <span style="color:#FF0000">({$lang.accessories})</span>
              <!– {elseif $goods.is_gift} –>
              <span style="color:#FF0000">({$lang.largess})</span>
              <!– {/if} –></td>
            <td>{$goods.goods_attr|nl2br}</td>
            <!–<td>{$goods.market_price}</td>–>
            <td >{$goods.goods_price}</td>
            <td ><input type=text  name=good_number[{$goods.goods_id}]  size=5 value="{$goods.goods_number}" style="text-align:center"></td>
            <td class="rightborder">{$goods.subtotal}</td>
            <td style="text-align:center;line-height:150%"><a href="javascript:if (confirm(’你确定要删除该商品吗?’)) location.href=’user.php?act=modify&do=del&oid={$order.order_id}&bid={$goods.goods_id}’; ">{$lang.drop}</a></td>
              </tr>
              <!– {/foreach} –>
              <tr>
            <td colspan="8" style="border-top:1px dotted #DADADA;text-align:right;">{$lang.shopping_money}<!– {if $order.extension_code eq "group_buy"} –>{$lang.gb_deposit}<!– {/if} –>: {$order.formated_goods_amount}</td>
              </tr>
            </table>
     <table width="716" border="0" cellspacing="0" cellpadding="0">
          <tr>
              <td width="300" height="50" align="center" valign="bottom">
              <input type="image" src="images/edit_button.gif" width="100" height="40" border="0" />
              </td><td width="416">&nbsp;</td>
          </tr>
      </table>
      <input type="hidden" name="do" value="update">
      <input type="hidden" name="act" value="modify">
      <input type="hidden" name="oid" value="{$order.order_id}">
    </form>
</div>
<div class="titles">费用总计</div>
<div class="listbox">
          <table width="100%" border="0" align="center" cellpadding="4" cellspacing="2">
            <tr>
              <td align="right">
                  {$lang.goods_all_price}<!– {if $order.extension_code eq "group_buy"} –>{$lang.gb_deposit}<!– {/if} –>: {$order.formated_goods_amount}
                <!– {if $order.discount gt 0} 折扣 –>
                - {$lang.discount}: {$order.formated_discount}
                <!– {/if} –>
                <!– {if $order.tax gt 0} –>
                + {$lang.tax}: {$order.formated_tax}
                <!– {/if} –>
                <!– {if $order.shipping_fee > 0} –>
                + {$lang.shipping_fee}: {$order.formated_shipping_fee}
                <!– {/if} –>
                <!– {if $order.insure_fee > 0} –>
                + {$lang.insure_fee}: {$order.formated_insure_fee}
                <!– {/if} –>
                <!– {if $order.pay_fee > 0} –>
                + {$lang.pay_fee}: {$order.formated_pay_fee}
                <!– {/if} –>
                <!– {if $order.pack_fee > 0} –>
                + {$lang.pack_fee}: {$order.formated_pack_fee}
                <!– {/if} –>
                <!– {if $order.card_fee > 0} –>
                + {$lang.card_fee}: {$order.formated_card_fee}
                <!– {/if} –>
              </td>
            </tr>
            <tr>
              <td align="right">
                <!– {if $order.money_paid > 0} –>
                - {$lang.order_money_paid}: {$order.formated_money_paid}
                <!– {/if} –>
                <!– {if $order.surplus > 0} –>
                - {$lang.use_surplus}: {$order.formated_surplus}
                <!– {/if} –>
                <!– {if $order.integral_money > 0} –>
                - {$lang.use_integral}: {$order.formated_integral_money}
                <!– {/if} –>
                <!– {if $order.bonus > 0} –>
                - {$lang.use_bonus}: {$order.formated_bonus}
                <!– {/if} –>
              </td>
            </tr>
            <tr>
              <td align="right" style="border-top: 1px dotted #DADADA">{$lang.order_amount}: {$order.formated_order_amount}
              <!– {if $order.extension_code eq "group_buy"} –><br />{$lang.notice_gb_order_amount}<!– {/if} –></td>
            </tr>
              <!– {if $allow_edit_surplus} 如果可以编辑使用余额数 –>
            <tr>
              <td align="right" style="border-top: 1px dotted #DADADA">
        <form action="user.php" method="post" name="formFee" id="formFee">{$lang.use_more_surplus}:
              <input name="surplus" type="text" size="8" value="0" />{$max_surplus}
              <input type="submit" name="Submit" value="{$lang.button_submit}" />
              <input type="hidden" name="act" value="act_edit_surplus" />
              <input type="hidden" name="order_id" value="{$smarty.get.order_id}" />
        </form>
    </td>
       </tr>
      {/if}
</table>
</div>
<!–{/if}–>
<!–#修改订 单–>



说明
:本教程来源互联网或网友上传或出版商,仅为学习研究或媒体推广,51zixue.net不保证资料的完整性。
 
上一篇:如何实现ecshop中商品分类页分类搜索的功能  下一篇:如何在ecshop文章详情页增加文章描述