zen cart订单详细信息增加产品图片显示

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

      zen cart订单详细信息增加产品图片显示,主要是通过zen cart模板中的includes/templates/template_default/templates/tpl_account_history_info_default.php中,以及修改order.php里面订单类function query($order_id) 来达到目的.

       $img_info = $db ->Execute("select products_image from ".TABLE_PRODUCTS." where products_id = '{$orders_products->fields[products_id]}' ");
 
      $this->products[$index] = array('qty' => $new_qty,
                                      'id' => $orders_products->fields['products_id'],
                                      'name' => $orders_products->fields['products_name'],
           'img' => $img_info->fields['products_image'],
                                      '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']);

 

     里面的img就是产品图片。

     在该模板includes/templates/template_default/templates/tpl_account_history_info_default.php.我们修改成以下.

     echo '<a href="' . zen_href_link(zen_get_info_page( $order->products[$i][id]), 'products_id=' .  $order->products[$i]['id']) . '" target="_blank">'; 
  echo  $order->products[$i]['name'];
  echo "</a><br>";
 
  echo zen_image(DIR_WS_IMAGES . $order->products[$i]['img'], $order->products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

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