如何爲Magento 1.5中的訂單,發票等定製起始號碼?Magento 1.5訂單號碼的自定義起始號碼
回答
從Magento的論壇:
- by LindyKyaw (Magento Team Member),改變起始號碼(通過SQL查詢):
There is a table in the database which stored increment id of order. It is called 「eav_entity_store」 table. You can check which entity type id belongs to which entity by looking at eav_entity_type table. You can run following query to update last increment id for the order.update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id=3001 where eav_entity_type.entity_type_code='order';
- by FOOMAN (active contributor),改變起始號碼(通過數據庫管理工具)並在開頭刪除「0」:
希望幫助With a tool like phpmyadmin look at your database. In the table eav_entity_type you will find all entity types listed. The one of interest to change where the order number starts is order sales/order. Remember the entity_type_id (in my install it is 11). To remove the leading zeros (padding) set increment_pad_length to 1.Next go to the table eav_entity_store. Look up the entity_type_id. Now you can change the value of increment_prefix and increment_last_id. If you wanted to have your next orderId to be 15000 set increment_last_id to 14999 and increment_prefix to 0.
Additionally you need to make a copy of this file /app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php to /app/code/local/Mage/Eav/Model/Entity/Increment/Abstract.php
public function getPadLength() { $padLength = $this->getData('pad_length'); if (empty($padLength)) { $padLength = 0; } return $padLength; } ... public function format($id) { $result= str_pad((string)$id, $this->getPadLength(), $this->getPadChar(), STR_PAD_LEFT); return $result; }
它當然可以,謝謝 – 2011-05-02 02:24:10
Magento的訂單號
很簡單....
- 去phpmyadmin的
- 選擇datbase,然後選擇表「eav_entity_store 「
- 在此表中,更改
increment_last_id
(例如,我在表格中設置了3456767) - 之後我創建了一個新訂單。現在我的訂單從數字開始346768
我試過了,它對於訂單號碼的效果很好,但是訂單號是不同的。例如,當我下訂單並點擊訂單詳情時,網址爲:sales/order/view/order_id/7 / – NotJay 2015-08-21 20:13:40
實際上,對於較新的版本(也可能在1.5版本中),有一種更簡單的方法來更改它。在PHPMyAdmin或您的mysql客戶端中,轉至eav_entity_type
表。找到entity_type_code
列中的表格(可能爲order
),並將increment_pad_length
設置爲任何你想要的,以及increment_pad_char
。
那麼你不必重寫核心代碼 - 一個雙贏。
JMAX
有實際上是爲完成這一任務good extension。
它允許您自定義的順序ID在很多不同的方式: 例如,你可以使用一個組合:
- 像數年,月,,日,小時,秒,
- 使用自定義計數器(你可以決定起始編號)
- 的所有上述方法進行組合
- 添加一些自定義字符串中的順序編號的任何位置
這是分機。在Magento的連接: http://www.magentocommerce.com/magento-connect/custom-order-id-8210.html
我親自試過它,它很好的(正常工作與我所有的支付方式和我沒有任何問題,在所有)
- 1. Magento-自定義屬性導致空白訂單號碼
- 2. Magento的變更訂單號碼長度
- 3. Magento:創建發票號碼=訂單號的發票?
- 4. 來自訂單對象的Magento跟蹤號碼
- 5. Magento如何自動將追蹤號碼添加到訂單中
- 6. 如何更改Magento中的訂單起始編號
- 7. 在magento 1.5中創建自定義訂單狀態
- 8. 客戶號碼,訂單號碼的最佳格式是什麼?
- 9. 如何獲得Magento中的所有訂單追蹤號碼?
- 10. Excel中的自定義格式號碼
- 11. 最大距離的訂單號碼集
- 12. 刪除django中的訂單號碼
- 13. 獲取訂單號碼的事件sales_order_payment_pay
- 14. 自定義電話號碼控制
- 15. 如何自定義號碼管角2
- 16. 自定義號碼選擇器?
- 17. 自定義電話號碼驗證添加爲magento 2.1.4網站中存在的所有電話號碼字段
- 18. 角度自定義輸入號碼不起作用
- 19. 找到比定義的參數號碼大的最小號碼
- 20. 從WooCommerce訂單獲取發票號碼
- 21. 如何更改起始ID號碼
- 22. Magento獲得發票號碼
- 23. WP Admin defaiult菜單訂單訂單號碼
- 24. 自動號碼?
- 25. 自選號碼
- 26. 自戀號碼
- 27. 7.1 <7.10 - 訂購號碼
- 28. Magento 1.5如何在創建發票後更改自定義訂單狀態
- 29. 只打印一個訂單號碼和與該號碼相關的項目
- 30. Magento在保存前生成訂單號
有一個易於使用的擴展內容:HTTP:// www.magentocommerce.com/magento-connect/custom-order-invoice-shipment-numbers.html – 2014-10-10 11:07:31