Magento 如何向订单号添加前缀

Magento 如何向订单号添加前缀,magento,magento-1.9,Magento,Magento 1.9,如何为Magento 1.9.01中的所有未来订单号添加前缀?我已经尝试了下面描述的数据库解决方案: 但这没有效果。新订单没有前缀。您是否尝试重写classMage\u Eav\u Model\u Entity\u Type并在方法fetchNewIncrementId中添加自定义订单号逻辑 像 您是否尝试过在事件之后通过更改门店id连接到销售\订单\地点,\u并通过编程修改增量id? public function fetchNewIncrementId($storeId = null) {

如何为Magento 1.9.01中的所有未来订单号添加前缀?我已经尝试了下面描述的数据库解决方案:


但这没有效果。新订单没有前缀。

您是否尝试重写class
Mage\u Eav\u Model\u Entity\u Type
并在方法
fetchNewIncrementId
中添加自定义订单号逻辑


您是否尝试过在事件之后通过更改门店id连接到
销售\订单\地点,\u并通过编程修改增量id?
public function fetchNewIncrementId($storeId = null)
{
    $incrementId = parent::fetchNewIncrementId($storeId); 

    $incrementId = 'prefix' . $incrementId;

    return $incrementId;
}
Find all order id

SELECT core_store_group.name AS group_name, core_website.name AS website_name, core_store.name AS store_name, core_store.store_id, increment_prefix, increment_last_id, entity_type_code
FROM eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
INNER JOIN core_store ON core_store.store_id = eav_entity_store.store_id
INNER JOIN core_store_group ON core_store_group.group_id = core_store.group_id
INNER JOIN core_website ON core_website.website_id = core_store.website_id
WHERE eav_entity_store.store_id != 0 ORDER BY eav_entity_store.store_id;

Change your Order Prefix on All Stores

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_prefix='SPB'
WHERE eav_entity_type.entity_type_code='order';

Change your Invoice Prefix on All Stores

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_prefix='SPB'
WHERE eav_entity_type.entity_type_code='invoice';

Change your Shipment Prefix on  All Stores->

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_prefix='SPB'
WHERE eav_entity_type.entity_type_code='shipment';

Change your Credit Memo Prefix on All Stores

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_prefix='SPB'
WHERE eav_entity_type.entity_type_code='creditmemo';