News:

Support the VirtueMart project and become a member

Main Menu

email order: customer's name + address on same row

Started by 4est, May 10, 2013, 10:05:54 AM

Previous topic - Next topic

4est

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

any ideeas?

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

Mathalis

Hello,
Can you send a print screen of email ?

Thks


Mathalis

Do you modify program file or request a modificaiton to anyone ?

4est

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

no, delimiters have nothing to do with the problem.

I can't figure out what's wrong

PRO

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]

4est

Thanks a lot for pointing me in the right direction. I will work on the file

4est

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.