Forums / Setup & design / shop problem

shop problem

Author Message

Martin Ulrich

Thursday 20 July 2006 5:34:34 am

I set in shopaccount.ini

[AccountSettings]
# Handler=ezuser
Handler=ezdefault

Put product in basket, go checkout.

then after login the following error passes:

<i>Error checking out

* Unable to calculate VAT percentage because your country is unknown. You can either fill country manually in your account information (if you are a registered user) or contact site administrator.</i>

"fill country manually " doesnt help.

I use 3.8.1

;-(

greetings

_______________________

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

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

[email protected]
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

[email protected]
http://www.grandmore.com