VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: lol2x on March 02, 2013, 12:02:13 PM

Title: Checkout template position of customer info.
Post by: lol2x on March 02, 2013, 12:02:13 PM
Hi guys, is it possible to change the positioning of customer info in checkout page? I mean:
(http://i.imgur.com/qtFRIJV.png)

Regards
Title: Re: Checkout template position of customer info.
Post by: GJC Web Design on March 02, 2013, 13:28:00 PM
The customer info is returned as an array from the user model  and looped thru to display in the order that it is.
You would need to sort the array somehow or manually echo out static fields from the array

[title] => Array
        (
            [name] => title
            [value] => Mr
            [title] => Title
            [type] => select
            [required] => 0
            [hidden] =>
            [formcode] =>

            [description] =>
        )

    [first_name] => Array
        (
            [name] => first_name
            [value] => Test
            [title] => First Name
            [type] => text
            [required] => 1
            [hidden] =>
            [formcode] => 
            [description] =>
        )

    [middle_name] => Array
        (
            [name] => middle_name
            [value] =>
            [title] => Middle Name
            [type] => text
            [required] => 0
            [hidden] =>
            [formcode] => 
            [description] =>
        )

etc etc
Title: Re: Checkout template position of customer info.
Post by: lol2x on March 02, 2013, 14:10:20 PM
in which file i need to do that?
Title: Re: Checkout template position of customer info.
Post by: GJC Web Design on March 02, 2013, 14:13:41 PM
I would over-ride it but its

components/com_virtuemart/views/cart/tmpl/default_pricelist.php
Title: Re: Checkout template position of customer info.
Post by: lol2x on March 02, 2013, 14:53:57 PM
but in this file i dont have any arrays to sort :/ what's wrong ?
Title: Re: Checkout template position of customer info.
Post by: GJC Web Design on March 02, 2013, 14:55:51 PM
what is this?

$this->cart->BTaddress['fields']

Title: Re: Checkout template position of customer info.
Post by: lol2x on March 02, 2013, 15:41:28 PM
yup there is
<?php

foreach ($this->cart->BTaddress['fields'] as $item) {
if (!empty($item['value'])) {
if ($item['name'] === 'agreed') {
$item['value'] = ($item['value'] === 0) ? JText::('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO') : JText::('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');
}
?>
<!-- span class="titles"><?php echo $item['title'?></span -->
<span class="values vm2<?php echo '-' $item['name'?>"><?php echo $this->escape ($item['value']) ?></span>
<?php if ($item['name'] != 'title' and $item['name'] != 'first_name' and $item['name'] != 'middle_name' and $item['name'] != 'zip') { ?>
<br class="clear"/>
<?php
}
}
?>


so where should i place the code you gave me?
Title: Re: Checkout template position of customer info.
Post by: GJC Web Design on March 02, 2013, 15:44:33 PM
I didn't give you any code - I suggested how you would go about solving your question - you need to do a bit of research yourself...
its now a basic php array manipulation - google is your friend..