- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何在 Magento 1.5 中自定义订单、发票等的起始编号?
最佳答案
来自 magento 的论坛:
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';
希望有帮助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.phpto/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;
}
关于magento - Magento 1.5 中订单号的自定义起始号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5838368/
我正在实现我的第一个支付网关,虽然我的情况可能很简单,因为我可以使所有三个相同,但我想知道一些应该不同的情况。 再说一次,订单号、交易编号和发票编号有什么区别?以及任何其他形式的交易相关信息? 它们都
我目前正在使用 $order = new WC_Order($order_id); (使用网络表单)用于获取与该订单 ID 相关的客户详细信息。我只想能够使用客户的帐单电子邮件或帐单电话从数据库中获取
我有以下查询: SELECT o.ClientId, o.MAX(Date), o.OrderNumber FROM dbo.tblOrders GROUP BY o.ClientId, o.Orde
我公司有一款集成了应用内结算功能的 Android 应用。当客户购买订单时,应用程序会收到订单 ID。之后,应用将此数据发送到服务器,服务器通过 Notification History API 检查
我正在处理重力表,我需要从 Woocommerce 获取订单号。当用户成功下单时,订单号应传递给表单,以便用户可以管理该订单的更多内容。我正在使用这些插件:1. 电子商务2.重力形式3. Gravit
基本要求是以以下格式创建订单号: (M)M-SSS 其中 MM 代表当前月份,SSSS 代表当月的订单顺序。例如,1-002 代表一月份提交的第二个订单。 使用 TRIGGER 我希望自动递增和插入透
我遇到一个问题,我需要将 Amazon.com 的订单号存储到 MySQL 表中。 Amazon.com 订单号由数字和连字符组成,例如 102-1234567-1234567(17 个数字和 2 个
我是一名优秀的程序员,十分优秀!