@devansh-webkul
Thank you for presenting the document
We will check here once and ask again if we don't understand.
Thank you very much.
If possible, could you please tell me the safest way to make the increment_id in the orders table unique in Bagisto?
For example, if I want to change it like this, how can I add and load custom functions in Bagisto?
Target file
bagisto/packages/Webkul/Sales/src/Generators/Sequencer.php
Sample change
Example: Before change
/**
* Create and return the next sequence number for e.g. an order.
*/
public function generate(): string
{
return $this->prefix.sprintf(
"%0{$this->length}d",
($this->lastId + 1)
).($this->suffix);
}
Example: After change (I want a unique ID like this)
/**
* Create and return the next sequence number for e.g. an order.
*/
public function generate(): string
{
return $this->prefix.\Str::uuid().($this->suffix);
}
The goal is to use this as one of the keys to retrieve items purchased via guest checkout. Currently, it doesn't work with Bagisto 2.1.2 and Bagisto APIs (REST) 2.0.0, so I'm creating it myself.
I apologize for the inconvenience, but thank you in advance.