shop problem

shop problem

Thursday 20 July 2006 5:34:34 am - 3 replies

Author Message

Stuart Fenton

Thursday 20 July 2006 10:48:41 am

I came across the same problem. Ez Needs to look up the country of the user in order to calculate VAT however the default shop account handler does not process the "country" field.

Edit this file or create one specific to your application

kernel/classes/shopaccounthandlers/ezdefaultshopaccounthandler.php

Jump to the bottom of the file and look for the function called
"accountInformation".

Change the code from this:

        return array( 'first_name' => $dataMap['first_name']->content(),
                      'last_name' => $dataMap['last_name']->content(),
                      'email' => $user->attribute( "email" )
                      );

To this:

        return array( 'first_name' => $dataMap['first_name']->content(),
                      'last_name' => $dataMap['last_name']->content(),
                      'email' => $user->attribute( "email" ),
                      'country' => $dataMap['country']->content(),
                      );

This will fix it for you.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Martin Ulrich

Thursday 20 July 2006 11:52:00 am

Thanks very much !!
spent a lot of time, now it is solved :-))))))))

had never done by myself. you help me understand it

in advance I edit

\design\standard\templates\shop\accounthandlers\html\default.tpl

an now all other fields are there

thank you again

Sebastian

:-)

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Stuart Fenton

Thursday 20 July 2006 12:25:03 pm

Actually the code needs a little adjusting as the country type is an array instead of a string and although it works in the basket it breaks in the confirm order and the orderview.

Here is the entire accountInformation function.

    function accountInformation( $order )
    {
        $user =& $order->user();
        $userObject =& $user->attribute( "contentobject" );
        $dataMap =& $userObject->dataMap();
        $country = $dataMap['country']->content();
		
        return array( 'first_name' => $dataMap['first_name']->content(),
                      'last_name' => $dataMap['last_name']->content(),
                      'email' => $user->attribute( "email" ),
                      'country' => $country['value']
                      );
    }

Regrads
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.