久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

magento 訂單列表查詢

magento orders list query(magento 訂單列表查詢)
本文介紹了magento 訂單列表查詢的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想在 Magento 中選擇所有訂單的列表.

I want to select the list of all orders in Magento.

這是我目前正在處理的另一個 PHP 應用程序中顯示來自 magento 的所有訂單列表所必需的.

This is required for me to show the list of all the orders from magento in another PHP application presently I'm working on.

也有人可以使用 Magento 約定為我編寫代碼,例如 Mage::

Also can some one write me the code using the Magento conventions such as Mage::

我使用的是 Magento 1.4.2 版本.

Im using Magento 1.4.2 version.

謝謝,
標記

推薦答案

此代碼使用Magento 方式"并通過模型層訪問數據,該層使您免受表結構的變化(例如平面與 EAV)的影響.在 Magento 安裝的根目錄中創建一個包含此框架代碼的新 PHP 文件(如果在其他地方更新第一個 require 語句的路徑).

This code uses the "Magento way" and accesses the data through the Model layer which insulates you from changes in the table structure (e.g. flat vs EAV). Create a new PHP file containing this skeleton code in the root of your Magento install (if elsewhere update the path for the first require statement).

這為您提供了一些如何向集合添加屬性的示例,如果需要,您應該能夠按照示例添加更多屬性.它向您展示了如何按屬性過濾和按屬性排序.還用于回顯您需要的字段的示例.

This gives you some examples of how to add attributes to the collection, you should be able to follow the examples to add more if required. It shows you how to filter by attributes, and sort by attributes. Examples also for echo'ing out the fields that you need.

HTH,
京東

require_once 'app/Mage.php';
umask(0);
Mage::app('default');
    $orders = Mage::getResourceModel('sales/order_collection')
        ->addAttributeToSelect('*')
        ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_street', 'order_address/street', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_company', 'order_address/company', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_city', 'order_address/city', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_region', 'order_address/region', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_country', 'order_address/country_id', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_postcode', 'order_address/postcode', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_telephone', 'order_address/telephone', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_fax', 'order_address/fax', 'billing_address_id', null, 'left')
        ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_street', 'order_address/street', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_company', 'order_address/company', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_city', 'order_address/city', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_region', 'order_address/region', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_country', 'order_address/country_id', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_postcode', 'order_address/postcode', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_telephone', 'order_address/telephone', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_fax', 'order_address/fax', 'shipping_address_id', null, 'left')

        ->addFieldToFilter('status', array("in" => array(
            'complete',
            'closed')
            ))

        ->addAttributeToFilter('store_id', Mage::app()->getStore()->getId())
        ->addAttributeToSort('created_at', 'asc')
        ->load();
  foreach($orders as $order):
    echo $order->getIncrementId().'<br/>';
    echo $order->getShippingTelephone().'<br/>';
  endforeach;

這篇關于magento 訂單列表查詢的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 日韩在线一区二区三区 | av一级 | 欧美在线一区二区三区 | 中文字幕在线不卡播放 | 黄色片亚洲 | 偷拍第一页 | 自拍偷拍精品 | 国产高清无av久久 | 福利一区二区 | 国产精品久久久爽爽爽麻豆色哟哟 | 久久久久久久久淑女av国产精品 | 日本特黄a级高清免费大片 成年人黄色小视频 | 韩国主播午夜大尺度福利 | 国产一区精品 | 中文字幕亚洲精品在线观看 | 日本网站在线看 | 成人在线视频免费看 | 久久精品国产亚洲 | 成人午夜视频在线观看 | 99精品久久久久久 | 欧美成人激情 | 精品亚洲一区二区三区四区五区 | 亚洲欧洲在线观看视频 | 亚洲欧洲色视频 | 欧美日韩国产精品一区 | 综合视频在线 | www.9191.com| 日韩在线一区二区三区 | 久久a久久 | 99热精品在线 | 午夜精品在线 | 久久久久久久久99 | 亚洲一区二区在线电影 | 精品成人在线 | 欧美日韩久久 | 国产精品永久在线观看 | 久久久精品 | 99热这里都是精品 | 国产欧美日韩精品一区二区三区 | 国产精品成人在线播放 | 久久尤物免费一区二区三区 |