Jump to content

[FREE MODULE] Numeric order reference


Daresh

Recommended Posts

  • 2 weeks later...

Hello, thank you for the module, it works great, but it messes up my Email order confirmation template.
it looks kind a messy in sent e-mail.

What is the name of the template so I could change it. I looked all available templates but couldn't find this one.
 

Any ideas?

Thank you very much
R

 

 

gmail-preview.jpg

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

  • 4 weeks later...

I had a problem with this module. It happened after I had moved my shop to another server (both PHP 8.1).

On the new server you could pay for an order. But the cart was never converted into an order. Instead the software hang and got a timeout after you paid.

On analysis it turned out that the problem was in the function validateOrder() in /classes/module/PaymentModule.php.

It turned out that the following code had become an eternal loop:

            do {
                $reference = Order::generateReference();
            } while (Order::getByReference($reference)->count());

Order::generateReference(); always returned the number of the last order.

This was with Thirty Bees 1.4.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 2 weeks later...
  • 1 month later...
  • 2 months later...
  • 4 weeks later...
  • 4 weeks later...

It simply generates an unique order reference. Even for multistore order ID's can't duplicate, because it's one database table. The multistore feature does not apply to this module.

Link to comment
Share on other sites

  • 1 month later...

I looked into the module code and noticed some inconsistency... 

I don't know if this has any impact on the operation of the module, but I don't think there should be _RANDOM twice, but _ZEROS.

    public function install()
    {
        if (Shop::isFeatureActive()) {
            Shop::setContext(Shop::CONTEXT_ALL);
        }
        return parent::install() &&
            Configuration::updateValue('GMNUMERIC_RANDOM', true) &&
            Configuration::updateValue('GMNUMERIC_RANDOM', true) &&  <<<<-----------
            Configuration::updateValue('GMNUMERIC_PREFIX', '');
    }

    public function uninstall()
    {
        Configuration::deleteByName('GMNUMERIC_RANDOM');
        Configuration::deleteByName('GMNUMERIC_ZEROS'); <<<<-----------
        Configuration::deleteByName('GMNUMERIC_PREFIX');
        return parent::uninstall();
    }

 

Link to comment
Share on other sites

  • 2 months later...

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...