Jump to content

Changing order reference to order ID


mysho

Recommended Posts

I haven't tried it. I've decided for a smaller change - random reference code, but numeric (instead of alphabetical). Still better random numbers than random letters :)

 

If anybody wants to apply the same modification:

In this file: \classes\order\Order.php - generateReference()

 

change this return in the function generateReference():

return strtoupper(Tools::passwdGen(7, 'NON_NUMERIC'))

 

I think there was (9,'NON_NUMERIC'), but I am not sure. This number describes the length of a generated string. 

 

to

return strtoupper(Tools::passwdGen(7, 'NUMERIC'))

Link to comment
Share on other sites

  • 4 months later...

Hi everyone,

 

I would like to ask which way is the easiest for changing the order reference from random letters to the order ID.

 

Will this http://nemops.com/prestashop-replace-order-references-with-ids/#.WG49KPnhCUk work for PS 1.7 (1.7.0.3 exactly)?

 

THX!

Hello,

 

I tried it, but override didn't work for me on PS 1.7.1.

 

"Use Overrides" from BO is enable and I delete /app/cache/prod/class_index.php  but nothing happen.

 

Any idea?

Thanks

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • 2 years later...
On 8/9/2022 at 10:35 AM, vskand said:

@muynck your module doubles the total spent of the customers.

If you go to customers and select a customer, in the details page, the total of all the orders (and the total per order) is doubled. 

Not sure why.

The module may have created a duplicate order references. If that happens (due to malformed order reference configuration) the amounts paid can be doubled, or any multiplication.

 

Make sure you have an order reference configured that will create a unique order reference. Do this be using the order id or cart id. And make sure it is not cutoff at the end because it is too long.

 

Let me know if this helps. 

Link to comment
Share on other sites

58 minutes ago, muynck said:

Make sure you have an order reference configured that will create a unique order reference. Do this be using the order id or cart id. And make sure it is not cutoff at the end because it is too long.

Hi, thanks for the reply. 

 

The module is setup with the following: {order->id:%05d}

All the references are unique.

This happens in 2 different sites/installations.

 

You don't have this issue? 

Thanks

Link to comment
Share on other sites

2 minutes ago, vskand said:

Hi, thanks for the reply. 

 

The module is setup with the following: {order->id:%05d}

All the references are unique.

This happens in 2 different sites/installations.

 

You don't have this issue? 

Thanks

Can you share a printscreen of the order page?

Link to comment
Share on other sites

18 hours ago, vskand said:

Does it work correctly on your sites?

I could not pinpoint the issue nor did I find a hook or something that might affect this.

Yes, I see this in one other project too!

I can not find it for now, and I don't have enough time to investigate this now!

I have a few questions

What is your PrestaShop version?
What is your module version?

I created an issue: https://github.com/blauwfruit/PrestaShop-Order-Reference/issues/10

Edited by muynck (see edit history)
Link to comment
Share on other sites

On 8/20/2022 at 2:24 PM, Nickz said:

Those custom changes have no benefit in raising sales.
People should concentrate on selling more instead of fiddling around om their shops. 

Unless you have so many orders, that you need to automise and organise your orders to reduce labour cost.

And, @vskand found a serious bug, that needs solving.

Edited by muynck (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...