Change invoice and order reference format

dipen.vyas
dipen.vyas Spryker Solution Partner Posts: 7 🧑🏻‍🚀 - Cadet

I want to change the order and Inovice reference number.

order # US-7767-A634

Invoice # USIN-7871-2312

I am using 202401.0 release and I don't see any configurable option. How can we achieve this?

Can we update existing order refernce or we create new field for the order and generate the new reference there and show it to customer?

Can anyone help to understand any challenge with this approach?

Comments

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 110 ⚖️ - Guardians (admin)

    Take a look at the SalesConfig file where you can adjust the prefix for the sales order reference

    getOrderReferenceDefaults()
    

    src/Pyz/Zed/Sales/SalesConfig.php at project level, which extends the core one

  • profuel
    profuel SSA Sprykee Posts: 106 🪐 - Explorer

    @dipen.vyas I think that we introduced most of the sales order reference configurations only in newer releases, see documentation about order reference configuration here.

    In the most brute-force way, you may introduce your own logic for the order reference generation implementing \Spryker\Zed\Sales\Business\Model\Order\OrderReferenceGeneratorInterface and overriding \Spryker\Zed\Sales\Business\SalesBusinessFactory::createReferenceGenerator on the project level with your model.