Author Topic: email order: customer's name + address on same row  (Read 2255 times)

4est

  • Beginner
  • *
  • Posts: 35
email order: customer's name + address on same row
« on: May 10, 2013, 10:05:54 am »
I'm using 2.0.20b   I used 2.0.18 and it was ok
Somehow there is a problem in the email generated. I get always the following format:

customer's email
Last_Name
First_Name customer's_address
post_code
city
....

The problem is that customer's first name is on the same row as his address

I haven't figured out what is the php code in components/com_virtuemart/views/invoice/tmpl that is generating this part of the email

Any idea how to fix?

Thanks

4est

  • Beginner
  • *
  • Posts: 35
Re: email order: customer's name + address on same row
« Reply #1 on: May 14, 2013, 11:03:57 am »
any ideeas?

does anyone know which is the file that generates that part of the order output?

Mathalis

  • Beginner
  • *
  • Posts: 25
    • Mathalis Web Studio
  • Skype Name: mathaliswebstudio
Re: email order: customer's name + address on same row
« Reply #2 on: May 14, 2013, 19:53:33 pm »
Hello,
Can you send a print screen of email ?

Thks

4est

  • Beginner
  • *
  • Posts: 35
Re: email order: customer's name + address on same row
« Reply #3 on: May 14, 2013, 21:32:52 pm »
Here it is


Mathalis

  • Beginner
  • *
  • Posts: 25
    • Mathalis Web Studio
  • Skype Name: mathaliswebstudio
Re: email order: customer's name + address on same row
« Reply #4 on: May 15, 2013, 15:57:08 pm »
Do you modify program file or request a modificaiton to anyone ?

4est

  • Beginner
  • *
  • Posts: 35
Re: email order: customer's name + address on same row
« Reply #5 on: May 15, 2013, 16:30:14 pm »
No, I did not.
But it might be related to the fact that I disabled some delimters from shopper fields, especially delimiter_userinfo

I say this because I got an order from a company, and the email is like this:
customer's email
Last_Name
First_Name companyname
companyid
customer's_address
post_code
city
....


So the problem should be related to customer first name, somehow a new line is not added after that.

4est

  • Beginner
  • *
  • Posts: 35
Re: email order: customer's name + address on same row
« Reply #6 on: May 21, 2013, 09:47:28 am »
no, delimiters have nothing to do with the problem.

I can't figure out what's wrong

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10401
  • VirtueMart Version: 3+
Re: email order: customer's name + address on same row
« Reply #7 on: May 21, 2013, 11:36:01 am »
mail_html_shopperadresses.php

You just have to format the output like you want.
I format mine to where I can just copy & paste it right into quickbooks.



 <?php

       foreach ($this->userfields['fields'] as $field) {
      if (!empty($field['value'])) {
      if ($field['name']=='virtuemart_country_id') continue;
    //    The "continue" skips the field
            if ($field['name']=='phone_1') {$field['value'] = ltrim($field['value'], '1');
            $field['value'] = str_replace( '-', '.', $field['value'] );}
            //   The statement above formats the phone number to remove the 1 in front & converts "-" to "."
            if ($field['name']=='virtuemart_state_id'){$stateId= shopfunctions::getStateIDByName ($field['value']);
         $field['value'] =shopfunctions::getStateByID ($stateId, 'state_2_code');}
         // The line above Replaces the state Name to State code (From   Florida   to FL)
         ?>
              <span class="values vm2<?php echo '-' . $field['name'] ?>" ><?php echo $this->escape($field['value']) ?></span>
              // RIGHT HERE below is what happens AFTER the field
              //  if you notice I add a <br/>   ONLY after (Last Name, Company, Phone,Email)  YOU CAN also do the opposite
         <?php if (($field['name'] == 'last_name') OR ($field['name'] =='company') OR ($field['name']=='phone_1') OR ($field['name']=='email') OR ($field['name']=='address_1') OR ($field['name']=='address_2')  ) { ?>
             <br class="clear" />
             <?php
         }
         if ($field['name']=='city'){echo ' ,';}
         // THIS is statement above adds a comma AFTER the city (So it Comes out   Tampa, FL 33614   etc.)
          }
      
       }
       ?>

[attachment cleanup by admin]
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

4est

  • Beginner
  • *
  • Posts: 35
Re: email order: customer's name + address on same row
« Reply #8 on: May 21, 2013, 11:42:45 am »
Thanks a lot for pointing me in the right direction. I will work on the file

4est

  • Beginner
  • *
  • Posts: 35
Re: email order: customer's name + address on same row
« Reply #9 on: May 21, 2013, 12:09:21 pm »
I SOLVED the problem:

I probably changed the shipper fields ORDER in virtuemart configuration, so last_name was listed BEFORE first_name
That is why a <br/> appeared at the wrong place

So problem solved, now I will look into maybe changing the format as you did too.

I just listed the solution, in case other users might have the same problem.