Jump to content

[TUTORIAL] Replace Order References with IDs


NemoPS

Recommended Posts

Thank you Nemo this is something I want to implement - When you say "make sure you use an override instead" does that mean that the method you show won't work after an update? I'm no developer so I'm learning as I go with Prestashop. What different steps should I take?

 

Sorry to ask for more when you have given us something for free already.

Link to comment
Share on other sites

  • 1 year later...

Hello, Nemo,

 

Thank you for this terrific tip. Screenshot shows the difference! 

 

I appreciate your creating the tutorials and have been watching them over and over.

 

A few months ago, I had my host delete my site entirely so I could redesign it. (I jumped ship from Mag... which was recommended last November.)

 

I'd rather be a year behind schedule and have a site I love!

post-1292894-0-03121700-1477059422_thumb.jpg

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

PrestaShop 1.6.1.8

I had this working perfectly when site was in maintenance mode.

 

My site is now live and the random letter reference numbers are back again. The setting in admin for "disable all overrides" is no. I suspect a lot of files were replaced by templatemonster when they were adjusting the template for me.

 

Is there anywhere else, besides debug mode, to prevent overrides from being over-ridden?

post-1292894-0-23181100-1481257872_thumb.png

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

PrestaShop 1.6.1.8

I had this working perfectly when site was in maintenance mode.

 

My site is now live and the random letter reference numbers are back again. The setting in admin for "disable all overrides" is no. I suspect a lot of files were replaced by templatemonster when they were adjusting the template for me.

 

Is there anywhere else, besides debug mode, to prevent overrides from being over-ridden?

That's the only place, are you sure the override is still in the folder? Clear the class index as well, just in case

Link to comment
Share on other sites

Hi, Nemo,

 

It's still in the folder. This is the only code in Order.php (when I first edited it there was a lot more code in it. I don't know what TM did).

 

Class Order extends OrderCore
{
public static function generateReference()
{
    return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC'));
}
public static function generateReference()
{
    $last_id = Db::getInstance()->getValue('
        SELECT MAX(id_order)
        FROM '._DB_PREFIX_.'orders');
    return str_pad((int)$last_id + 1, 9, '000002177', STR_PAD_LEFT);
 
}
 
}
 
end of the code. It is not using the numbering I created beginning with 2177. It started with 000000007.
 
I don't know what you mean about "clear the class index", so i searched and found this but it only says what I said in my question except to delete the file.
 
 
So how do I clear the class index, please?
Edited by pause4paws (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...