Author Topic: Order number reformulation  (Read 47327 times)

sobers_2002

  • Beginner
  • *
  • Posts: 44
Re: Order number reformulation
« Reply #15 on: September 14, 2008, 14:03:13 pm »
the sum of above posts work like expected... I'll post a better looking and explained post (with hopefully cleaner way of doing things) soon!

sobers_2002

  • Beginner
  • *
  • Posts: 44
Re: Order number reformulation
« Reply #16 on: September 15, 2008, 11:53:51 am »
okay, bad news... there is a problem with the way things go on paypal. The order_id and order_number aren't working like supposed to and there is a problem with payments .. leading to orders not getting confirmed

kywolf

  • Beginner
  • *
  • Posts: 37
Re: Order number reformulation
« Reply #17 on: October 03, 2008, 20:39:12 pm »
With a little tweaking this works...for the e-mail that is sent to the user.  It actually displays that order number on the users 'Account Maintenance' page also.

The problem is that it does not match up anything in the admin section.  The Order Number is the admin section still shows 00000XX.  I've tried updating order.order_list.php but I cannot get the back-end to match the changes made in the above emails.

Has anyone solved the other half of this equation - meaning updating the admin section of vm's order numbers?

sobers_2002

  • Beginner
  • *
  • Posts: 44
Re: Order number reformulation
« Reply #18 on: October 05, 2008, 12:09:42 pm »
@kywolf, good to know it works for you. The paypal issue that I was worried about was actually not a problem. It was a sandbox paypal issue which was causing it.

Anyways, I was working on other stuff for a while so I'll see on how to get it displayed in admin section.

saxmachine05

  • Beginner
  • *
  • Posts: 6
    • Saxxom!! Your Online Marketing Pal!
Re: Order number reformulation
« Reply #19 on: January 16, 2009, 08:53:50 am »
kywolf, this should work for you.

7) go to C:\wamp\www\toouch\administrator\components\com_virtuemart\html\ order.order_list.php
replace
Code:
$list  = "SELECT #__{vm}_orders.order_id,order_status, #__{vm}_orders.cdate,#__{vm}_orders.mdate,order_total,order_currency,#__{vm}_orders.user_id,";

with
Code:
$list  = "SELECT #__{vm}_orders.order_id,order_status,order_number, #__{vm}_orders.cdate,#__{vm}_orders.mdate,order_total,order_currency,#__{vm}_orders.user_id,";

replace
Code:
$q  .= "(#__{vm}_orders.order_id LIKE '%$keyword%' ";

with
Code:
$q  .= "(#__{vm}_orders.order_number LIKE '%$keyword%' ";


replace
Code:
$tmp_cell = "<a href=\"" . $sess->url($url) . "\">".sprintf("%08d", $db->f("order_id"))."</a><br />";

with
Code:
$tmp_cell = "<a href=\"" . $sess->url($url) . "\">".$db->f("order_number")."</a><br />";




8) Go to C:\wamp\www\toouch\administrator\components\com_virtuemart\html\ order.order_print.php
replace
Code:
<td><?php printf("%08d", $db->f("order_id"));?></td>

with
Code:
<td><?php printf($db->f("order_number"));?> </td>


kywolf

  • Beginner
  • *
  • Posts: 37
Re: Order number reformulation
« Reply #20 on: February 12, 2009, 22:25:53 pm »
@saxmachine05 - thanks for posting that info - worked perfectly

I finally had a chance to go back through the instructions in this post and after all the changes, my order numbers are finally customized to my site instead of the random digits.

Thanks to everyone who posted!

saxmachine05

  • Beginner
  • *
  • Posts: 6
    • Saxxom!! Your Online Marketing Pal!
Re: Order number reformulation
« Reply #21 on: August 29, 2009, 10:57:53 am »
@kywolf, you are most welcomed :)
Guys, I've been working out the ebay checkout system where you can actually invite your ebay customer to check out the won ebay item on your Virtuemart website.

More news is updated on this thread https://forum.virtuemart.net/index.php?topic=45662.new;topicseen#new

Stay tuned :)

jarozz

  • Beginner
  • *
  • Posts: 1
Re: Order number reformulation
« Reply #22 on: February 06, 2010, 20:12:36 pm »
everythig is working fine, just when changing status of order, email to customer contains old numbering - 00000xx
can you help me check this ?
thank you.

josenova

  • Beginner
  • *
  • Posts: 47
Re: Order number reformulation
« Reply #23 on: April 21, 2010, 22:55:08 pm »
maybe I missed something, but now on the account maintenance there is no order number displayed at all. When you click on order details tho, the correct order number is displayed.

What did I miss?

stinga

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 872
    • Squangle ltd
Re: Order number reformulation
« Reply #24 on: April 22, 2010, 00:30:04 am »
Why on earth would you want to munge the order number? I can't see any reason for it other than creating work for the sake of it, now you have made the change you are going to have to repeat the change on every upgrade
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

josenova

  • Beginner
  • *
  • Posts: 47
Re: Order number reformulation
« Reply #25 on: April 22, 2010, 09:42:42 am »
hmmm that was helpful

stunami

  • Beginner
  • *
  • Posts: 12
Re: Order number reformulation
« Reply #26 on: May 23, 2010, 02:46:40 am »
I make this change to every site I develop because order I prefer not to show customers how many orders an online shop has taken. Order numbers involving the date are also arguably more meaningful than the default numbering system.

cheers, stu
ps. These changes work with 1.1.4

Eugen S.

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 255
  • Hire me for individual customization work => info
    • Virtuemart Themes
Re: Order number reformulation
« Reply #27 on: August 08, 2010, 14:07:28 pm »
this is probalbly the best topic in the forum.

Many thanks to sobers_2002.


I want to make a supplement. If somebody want a order number like:

Your_Name order_number - date

for example Nike 234 - 08.08.2010

use the following code to replace in the first step

function get_order_number() {
      global $auth;

      /* Generated a unique order number */

      $str = session_id();
      $str .= (string)time();
      $date = date('d.m.Y');
      
      $db =& JFactory::getDBO();
      $query = "   SELECT order_id
                FROM #__vm_orders ";
      $db->setQuery($query);
      $column= $db->loadResultArray();
       $anzahl = count($column) + 1;
   
      $order_number = "Nike ".$anzahl." - ".$date ;
               
      return substr($order_number, 0, 32);
   }
Send me a pm ;-)

Roger Lightening

  • Jr. Member
  • **
  • Posts: 70
    • VisAbility: Joomla website developers
Re: Order number reformulation
« Reply #28 on: August 11, 2010, 09:04:43 am »
Thanks for your help sobers_2002!

ronz

  • Beginner
  • *
  • Posts: 2
Re: Order number reformulation
« Reply #29 on: January 23, 2011, 00:31:23 am »
and at line 559 change
Code:

$listfields = 'cdate,order_total,order_status,order_id,order_number,order_currency';

to
Code:

$listfields = 'cdate,order_total,order_status,order_id,order_currency';

The new version of VM has the following code instead:
$listfields = 'o.order_id,o.cdate,order_total,o.order_status,order_currency';

What should I change to then? I tried change to o.order_number but no luck...Anyone can help?