Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order number


songbird

Recommended Posts

Hi everyone!!

 

I need to add 4 letters to the front of the order number that is generated by the site when an order is checked out.

 

For example: instead of it being 234, it needs to FFSA234

 

Help please??????

 

Thanks

 

Sam

Link to comment
Share on other sites

not sure if you can use letters but to change it to a higher number you can do it this way:

In phpmyadmin (SQL Tab) run the following command:

 

alter table orders auto_increment=2000

 

just change the 2000 to what number you want it to be--but I am sure you cant use letters with this command--maybe someone else will help you with that..I dont know how

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

  • 2 weeks later...

if it can't go other way just put text in php code wherever you need it, if those four letters are always the same.

Link to comment
Share on other sites

awesome idea Mike!!! thank you!!!

 

any idea what pages make that up please?

Order numbers are to be integers as far as they have to go into data base as they have to be incremented which is not possible with varchars.

 

So you can prepend a four character value at all pages where ever you find order number.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

thanks Satish!!

 

any idea what pages those would be?

 

 

The Pages where this is to be functionality wise:

1)Email sent to Admin and user.

2)All Admin reports

 

 

code wise you can jsut check BY find.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

It is possible to use varchar for order numbers and as non sequential. I have done it with a random order number mod which I created. Problem is problems. I could get the randomly generated order numbers into the database with each order ... but nothing but headaches after that .. because I then found myself going through thousands of lines of code trying to fix glitches and changing (int)$oID variables everywhere.

 

Just not meant to be unless you want to spend the rest of your life coding.

 

Another thing you can do is run this sql statement and it will put an option in your admin store settings to enter an invoice number sort of prefix. Put anything you like ... numbers or letters.

 

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Invoice Number Prefix', INVOICE_PREFIX', 'FFSA', 'The invoice number prefix aadded before an order number. Note they will all be the same.', '1', '180', now());

 

Then in your admin orders.php and invoice.php etc. to echo the results you can add something like this:

 

<?php echo TEXT_INVOICE_NUMBER . ' ' . INVOICE_PREFIX . $HTTP_GET_VARS['order_id']; ?>

 

Now it will show up as example ... Invoice Number: FFSA1000

 

One more thing about even this simple solution is that you have to add the INVOICE_PREFIX to every file that displays the Invoice Number to avoid confusion and keep your shop conformity.

 

I just ditched all efforts and stuck with the default generated numbers. And as rabbitseffort suggested ... easy to just up the invoices numerical output by altering the auto increment to start at something higher like 1000 or 10000 for example.

 

Anyway hope that gives you some input.

 

Cheers!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...