As you have by now set your own magento store and you see that the order number a customer gets after purchasing starts from100000001. But as its your new store and you don’t want your store to look like an amateur to others, you thought of changing the value of the order/shipment/invoice/credit memo number. But as you might have found out that there is no option in magento to change the value of this. Also it occurred to you that you want to modify in a way that it has a prefix related to your store name. e.g. Your store name is BestBooks.com, so you want that your order number looks like BB10023123. It looks definitely better than the default.
So I would now like to proceed to show you how its done.
How to find your store’s current order/shipment/invoice /credit memo number
- ?Login to the Cpanel and go to phpMyAdmin
- ?Select the database in which your magento installation is running.
- ?Go to SQL.
- ?Run the codes.
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;
Now the changing part
Change The Order Number And Prefix
Change order number value (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_last_id='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='order';
Change the order prefix (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='X' WHERE eav_entity_type.entity_type_code='order';
X
to NULL
?(no quotes) to disable the order prefix, then run the query.DO NOT set the increment prefix to NULL
on anything less than v1.6.0
Change order number value (Specific Store)
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='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='order' AND eav_entity_store.store_id = 'Y';
Y
with the store ID of the store you want to modify. The press Go.
Change the order prefix (Specific Store)
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='X' WHERE eav_entity_type.entity_type_code='order' AND eav_entity_store.store_id = 'Y';
X
to NULL
?(no quotes) to disable the order prefix. Replace Y
with the store ID of the store you want to modify, then run the query.DO NOT set the increment prefix to NULL
on anything less than v1.6.0.
Change Invoice Number and Prefix
Change?Invoice number value (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_last_id='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='invoice';
Change the?Invoice prefix (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='X' WHERE eav_entity_type.entity_type_code='invoice';
Change Invoice number value (Specific Store)
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='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='invoice' AND eav_entity_store.store_id = 'Y';
Y
with the store ID of the store you want to modify. The press Go.
Change the?Invoice prefix (Specific Store)
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='X' WHERE eav_entity_type.entity_type_code='invoice' AND eav_entity_store.store_id = 'Y';
Change Shipment Number and Prefix
Change?Shipment number value (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_last_id='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='shipment';
Change the?Shipment prefix (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='X' WHERE eav_entity_type.entity_type_code='shipment';
Change?Shipment number value (Specific Store)
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='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='shipment' AND eav_entity_store.store_id = 'Y';
Y
with the store ID of the store you want to modify. The press Go.
Change the?Shipment prefix (Specific Store)
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='X' WHERE eav_entity_type.entity_type_code='shipment' AND eav_entity_store.store_id = 'Y';
Change Credit Memo Number and Prefix
Change?Credit Memo number value (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_last_id='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='creditmemo';
Change the?Credit Memo prefix (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='X' WHERE eav_entity_type.entity_type_code='creditmemo';
Change?Credit Memo number value (Specific Store)
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='XXXXXXXXXX' WHERE eav_entity_type.entity_type_code='creditmemo' AND eav_entity_store.store_id = 'Y';
Y
with the store ID of the store you want to modify. The press Go.
Change the?Credit Memo prefix (Specific Store)
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='X' WHERE eav_entity_type.entity_type_code='creditmemo' AND eav_entity_store.store_id = 'Y';
引用及备注
本文来自thevortexcode 的博客
转载请注明:(●--●) Hello.My Weicot » How To Change Order Prefix And Default Value Of Order/Shipment/Invoice Number/Credit Memo In Magento/Magento 的订单号 的事