如何为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