Question

Comment puis-je personnaliser le numéro de départ pour les commandes, les factures, etc dans Magento 1.5?

Était-ce utile?

La solution


Du forum 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.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; }

Hope qui aide

Autres conseils

En fait, avec les versions les plus récentes (et probablement à 1,5 également), il existe un moyen plus facile de le changer. En PHPMyAdmin, ou votre client MySQL, allez à la table de eav_entity_type. Localisez le tableau dans la colonne entity_type_code (probablement order), et définir la increment_pad_length être tout ce que vous voulez, ainsi que le increment_pad_char.

Ensuite, vous n'avez pas à réécrire le code de base -. Gagnant-gagnant

Jmax

Magento d'ordre Il est simple ....

  • aller à phpmyadmin
  • sélectionnez votre datbase puis sélectionnez la table "eav_entity_store"
  • dans ce tableau, changer le increment_last_id (par exemple, je l'ai mis dans ma table 3456767)
  • après que je crée un nouvel ordre. Maintenant, mes commandes commencent à partir du numéro 346768

Il est en fait un bonne extension pour accomplir cette tâche.

Il vous permet de personnaliser l'ID de commande dans beaucoup d'autre façon: par exemple, vous pouvez utiliser une combinaison de:

  1. nombre comme année, mois ,, jour, heure, sec,
  2. utilisez un compteur personnalisé (vous pouvez décider du nombre de départ)
  3. une combinaison de toutes les méthodes ci-dessus
  4. ajouter une chaîne personnalisée dans toutes les positions de l'ID de commande

est le poste. sur Magento connecter: http://www.magentocommerce.com/magento-connect/custom -order-id-8210.html

Je personnellement essayé et très bon (fonctionne très bien avec tous mes moyens de paiement et je n'avais pas question du tout)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top