Monday, December 20, 2010

virtuemart: Enable Billing information in Order Review page

Quick script to paste into the virtuemart checkout confirmation page to show the billing information under the shipping info.

Step 1:
Search for "if(NO_SHIPTO=='')" in your components/com_virutemart/themes/YOURTHEME/templates/checkout/get_final_confirmation.tpl.php

Step 2:
and find the last line that reads
echo "</td></tr>";


Step 3:
Just after that last line paste the below contents.

$db->query("SELECT * FROM #__{vm}_user_info WHERE user_id=".strip_tags($db->f("user_id"))." and address_type='BT'");
    $db->next_record();
 
    
    echo '<tr><td valign="top"><strong>'.$VM_LANG->_('PHPSHOP_ORDER_PRINT_CUST_BILLING_LBL') . ":</strong></td>";
    echo '<td>';
    echo vmFormatAddress( array('name' => $db->f("first_name")." ".$db->f("last_name"),
                                        'address_1' => $db->f("address_1"),
                                        'address_2' => $db->f("address_2"),
                                        'state' => $db->f("state"),
                                        'zip' => $db->f("zip"),
                                        'city' => $db->f("city"),
                                        'country' => $db->f('country')
                                    ), true );
    
    echo "</td></tr>";



Stumble Upon CodePyro

4 comments:

Anonymous said...

Is it possible to show more user data, e.g. costum user fields there?

Anonymous said...

AWESOME! I've been looking for this ALL OVER. Many thanks. Testing it right now. Will check back either way! .... Okay just did it, works PERFECT!!!

Josh Tischer :: CodePyro said...

to add custom user fields or company name just output the data just above the vmFormatAddress function.

likea so
if($db->f("company"))
echo $db->f("company")."
";

I tried adding company field to the vmFormatAddress and gave up after about 30mins of no-worky

lin liyi said...

To measure a man taste, watches are undoubtedly one of the rolex replica watches best rulers. In addition to the wedding ring, watches may be the most acceptable accessories for men. Choose a audemars piguet replica delicate watch, for a successful man is understandable. In terms of the real love of the table, there is a close to the rolex replica sale totem worship of the kind of love, the man stability, fortitude, punctuality, in the movement of time can hublot replica sale be reflected in the fine. They know how to dress appropriately, highlights the individual temperament, to create hublot replica suitable image on different occasions.

Post a Comment