2022-10-31 11:07:12 - 米境通
magento的初始订单号码类似:1000001大家怕这个订单号显得自己的网站是个新网站,所以很多人想改下magento的订单号码。
一般cpanel中都有phpmyadmin,使用phpmyadmin进入我们的数据库,修改表eav_entity_store中的increment_last_id字段的值。这个字段存的是magento的最后一个订单的值,新订单会在此数值上累加。如上图。
如果需要修改订单号码前缀,例如订单改为:a10000667则需要同时将increment_prefix修改为a
注意:你网站首先要有订单,才能用这个方法改订单号码,没有订单,自己去下个订单再来改。
如果你有多店铺,请修改相应店铺的订单号码。
以上文字翻译自:
SometimeStoreAdminwantstohavedifferentdifferentprefixesforOrder#,Invoice#,CreditMemo#andShipment#.SayyouwantOrder#tostartwith1,Invoice#with2,CreditMemo#with3andShipment#with4,forthispleasefollowfollowingsteps(I’massumingyou’remakingthischangeinafreshstore)
PlaceatestOrder,ifyou’venotplacedanysofar,theninvoice,shipandcreateacreditmemoforthisorder.
Afterperformingaboveactivitiesyou’llseefourentriesin‘eav_entity_store’table,oneforeach
Toknowwhichentity_type_idrepresentswhatpleaserunquery“SELECT*FROM'eav_entity_type'WHERE'entity_type_id'IN(4,18,24,28)”.ItestedthisinMagento1.6.2.0andfound4,18,24,28valuesin'eav_entity_type'.'entity_type_id'column.Inyourcasethesevaluesmaybedifferentifyou’reusingdifferentversion.Well,inmycase4representsORDER,18representsINVOICE,24representsSHIPMENTand28representsCREDITMEMO
Nowafterknowingwhich‘entity_type_id’representingwhatin‘eav_entity_store’tableyouneedtoedit‘increment_prefix’columnsvalueasperyourchoice.Bydefaultvaluesinthiscolumnwillbe1forallfourrecords
Afterchangingvaluesfor‘increment_prefix’column,pleasemakesureyouchangeprefixin‘increment_last_id’columnaswell.Forexampleifyousee‘increment_last_id’as100000099forentityInvoiceandyouhavechangedInvoice#prefixwith2thenchange100000099with200000099