Author Topic: show state_name , not state_id in the receipt after the order.  (Read 4453 times)

mbit

  • Jr. Member
  • **
  • Posts: 323
show state_name , not state_id in the receipt after the order.
« on: October 09, 2010, 20:18:26 pm »
I would like to know how to edit the mail that goes to the user after the confirmation of the order, to show the state name and not the state_id.

thanks,
c

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: show state_name , not state_id in the receipt after the order.
« Reply #1 on: October 10, 2010, 20:06:21 pm »
I have posted on this somewhere, have a search on posts from me.
There are a few places that this needs to be done.
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

mbit

  • Jr. Member
  • **
  • Posts: 323
Re: show state_name , not state_id in the receipt after the order.
« Reply #2 on: October 14, 2010, 17:09:18 pm »
I have posted on this somewhere, have a search on posts from me.
There are a few places that this needs to be done.
i cant find anything.  let me know if u remember how this is done

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: show state_name , not state_id in the receipt after the order.
« Reply #3 on: October 29, 2010, 13:42:29 pm »
G'day,

I thought I had posted about this change, but I can't find it either.
There are several places where this needs to be changed, one place is...
administrator/components/com_virtuemart/html/order.order_print.php

Look for
Code: [Select]
case 'state'and you need to make a change to the sql that is being processed. I added
Code: [Select]
if (strlen($dbt->f('state')) == 2)
{
  $sql = "select state_name from j_vm_state where country_id = ".$dbc->f('country_id')." and state_2_code = '".$dbt->f('state')."'";
} else
{
  $sql = "select state_name from j_vm_state where country_id = ".$dbc->f('country_id')." and state_3_code = '".$dbt->f('state')."'";
}

There are other places where this change needs to be made. What this does is get the full name from the DB rather than using the state code which is great in the US and useless in nearly the rest of the world.
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

mbit

  • Jr. Member
  • **
  • Posts: 323
Re: show state_name , not state_id in the receipt after the order.
« Reply #4 on: November 02, 2010, 12:53:31 pm »
my administrator/components/com_virtuemart/html/order.order_print.php has to case 'state' :/
any other ideas?

mbit

  • Jr. Member
  • **
  • Posts: 323
Re: show state_name , not state_id in the receipt after the order.
« Reply #5 on: January 12, 2011, 12:15:11 pm »
the field - >  state_2_code    from the jos_vm_state  is being printed instead of state_name. I tried to copy the state_name in the state_2_code but it accepts only 2 characters. no way so far to print the state_name...
if i delete the  field and recreated but instead of char make it varchar will it work or will that create some issues??