吵吵   2011-03-03  阅读:2,312

吵吵发布:www.chaochaoblog.com
这段时间一直在研究zen cart商城,昨天老板给了一个nextag的代码,让我把这段代码插到购买商品的确认页去,于是就循着蛛丝马迹慢慢的找它本身的那个函数。还好是php做的东西,找了好久,终于找到了。原来在zen cart中有这么一个类:
class order extends base {
  var $info, $totals, $products, $customer, $delivery, $content_type, $email_low_stock, $products_ordered_attributes,
  $products_ordered, $products_ordered_email, $attachArray;//吵吵发布。
<!–more–>
这个类定义了order也就是客户拍下来商品的一些信息,其中就包括了:
$this->products[$index] = array(‘qty’ => $new_qty,
                                      ‘id’ => $orders_products->fields[‘products_id’],
                                      ‘name’ => $orders_products->fields[‘products_name’],
                                      ‘model’ => $orders_products->fields[‘products_model’],
                                      ‘tax’ => $orders_products->fields[‘products_tax’],
                                      ‘price’ => $orders_products->fields[‘products_price’],
                                      ‘final_price’ => $orders_products->fields[‘final_price’],
                                      ‘onetime_charges’ => $orders_products->fields[‘onetime_charges’],
                                      ‘products_priced_by_attribute’ => $orders_products->fields[‘products_priced_by_attribute’],
                                      ‘product_is_free’ => $orders_products->fields[‘product_is_free’],
                                      ‘products_discount_type’ => $orders_products->fields[‘products_discount_type’],
                                      ‘products_discount_type_from’ => $orders_products->fields[‘products_discount_type_from’]);
可以看到,在products中我们清楚的知道了商品的价格、名称等等信息。那么只需要吧这个值再交给js代码,让js把它传递给NexTag就ok了。

吵吵微信朋友圈,请付款实名加入:

吵吵 吵吵

发表评论

电子邮件地址不会被公开。 必填项已用*标注