• France
lyra.com
Search
Categories
Tags
docs.
France
Spain
Europe (English)
India
Home
Implementation
Embedded form (cards)
REST payment API
REST PCI-DSS payment API
REST SEPA API
Hosted payment
Data collection form
File exchange
Mobile payment
Snippets
Plugins
Marketplace
Back Office
Merchant Back Office
Expert Back Office
Guides
Help
FAQ
Video tutorials
Support

How to manage the PrestaShop order ID?

The PrestaShop order ID is generated once the payment has been finalized. This is why when PrestaShop calls the payment platform, the order ID does not yet exist. Only the shopping cart number is generated and sent to the payment gateway.

In the Expert Back Office, the registered order ID corresponds to the shopping cart number of PrestaShop.

Therefore, it is normal that you cannot see the order ID in the payment confirmation e-mails sent by Lyra Collect. Only the shopping cart number is displayed.

Modification of the PrestaShop code:

You have the possibility to modify the PrestaShop code in order to display the shopping cart ID in the PrestaShop order table.

For versions prior to Prestashop 1.7.7.0

Open the following file: AdminOrdersController.php ( controllers/admin directory)

After the following code (around line 82):

$this->fields_list = array
( 'id_order' => array(
'title' => $this->trans('ID', array(), 'Admin.Global'),
'align' => 'text-center', 
'class' => 'fixed-width-xs' 
),

Add the following code:

'id_cart' => array(
'title' => $this->l(‘Shopping cart'), 
'align' => 'center', 
'width' => 25),

The addition of this code will allow to display a column entitled Shopping cart between the ID and Reference columns.

For versions greater than or equal to Prestashop 1.7.7.0

Open the following file: OrderGridDefinitionFactory.php ( src / Core / Grid / Definition / Factory directory)

After the following code (around line 188):

->add((new IdentifierColumn('id_order'))
            ->setName($this->trans('ID', [], 'Admin.Global'))
            ->setOptions([
                'identifier_field' => 'id_order',
                'preview' => $previewColumn,
                'clickable' => false,
            ])
       )

Add the following code:

->add((new IdentifierColumn('id_cart'))
            ->setName($this->trans('Shopping cart ID', [], 'Admin.Global'))
            ->setOptions([
                'identifier_field' => 'id_cart',
                'preview' => $previewColumn,
                'clickable' => false,
            ])
       )

After the following code (around line 321):

->add((new Filter('id_order', TextType::class))
            ->setTypeOptions([
                'required' => false,
                'attr' => [
                    'placeholder' => $this->trans('Search ID', [], 'Admin.Actions'),
                ],
            ])
            ->setAssociatedColumn('id_order')
       )

Add the following code:

->add((new Filter('id_cart', TextType::class))
            ->setTypeOptions([
                'required' => false,
                'attr' => [
                    'placeholder' => $this->trans('Search Shopping cart ID', [], 'Admin.Actions'),
                ],
            ])
            ->setAssociatedColumn('id_cart')
       )

Open the following file: OrderQueryBuilder.php ( src / Core / Grid / Query directory)

Replace the following code (around line 92):

->addSelect('o.id_order, o.reference, o.total_paid_tax_incl, os.paid, osl.name AS osname')

with:

->addSelect('o.id_order, o.id_cart, o.reference, o.total_paid_tax_incl, os.paid, osl.name AS osname')

After the following code (around line 165):

'id_order' => 'o.id_order',

Add the following code:

'id_cart' => 'o.id_cart',

After the following code (around line 300):

'id_order' => 'o.id_order',

Add the following code:

'id_cart' => 'o.id_cart',

The addition of this code will allow to display a column entitled Shopping cart between the ID and Reference columns. A search field and sorting by cart number will also be available.

Recruitment

Head Office :

LYRA NETWORK
109, rue de l’innovation
31670 Labège
FRANCE

2.8.1-doc-1.8