VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: 4est on May 10, 2013, 10:05:54 AM

Title: email order: customer's name + address on same row
Post by: 4est 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
Title: Re: email order: customer's name + address on same row
Post by: 4est 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?
Title: Re: email order: customer's name + address on same row
Post by: Mathalis on May 14, 2013, 19:53:33 PM
Hello,
Can you send a print screen of email ?

Thks
Title: Re: email order: customer's name + address on same row
Post by: 4est on May 14, 2013, 21:32:52 PM
Here it is

(http://s10.postimg.org/yzsl50n6t/Capture.jpg) (http://postimg.org/image/yzsl50n6t/)
Title: Re: email order: customer's name + address on same row
Post by: Mathalis on May 15, 2013, 15:57:08 PM
Do you modify program file or request a modificaiton to anyone ?
Title: Re: email order: customer's name + address on same row
Post by: 4est 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.
Title: Re: email order: customer's name + address on same row
Post by: 4est 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
Title: Re: email order: customer's name + address on same row
Post by: PRO 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]
Title: Re: email order: customer's name + address on same row
Post by: 4est on May 21, 2013, 11:42:45 AM
Thanks a lot for pointing me in the right direction. I will work on the file
Title: Re: email order: customer's name + address on same row
Post by: 4est 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.