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

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

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

eZ debug

Timing: Jan 19 2025 11:48:35
Script start
Timing: Jan 19 2025 11:48:35
Module start 'layout'
Timing: Jan 19 2025 11:48:35
Module start 'content'
Timing: Jan 19 2025 11:48:36
Module end 'content'
Timing: Jan 19 2025 11:48:36
Script end

Main resources:

Total runtime1.4504 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 589.0313152.6094
Module start 'layout' 0.00850.0039 741.640639.4141
Module start 'content' 0.01241.4364 781.0547554.1484
Module end 'content' 1.44890.0015 1,335.203112.1953
Script end 1.4504  1,347.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2439160.0002
Check MTime0.00140.0965160.0001
Mysql Total
Database connection0.00150.106910.0015
Mysqli_queries1.383695.3959600.0231
Looping result0.00070.0468580.0000
Template Total1.405796.920.7028
Template load0.00240.165720.0012
Template processing1.403296.748820.7016
Template load and register function0.00040.025010.0004
states
state_id_array0.00250.174610.0025
state_identifier_array0.00440.301920.0022
Override
Cache load0.00200.1395460.0000
Sytem overhead
Fetch class attribute can translate value0.00080.053520.0004
Fetch class attribute name0.00160.111450.0003
XML
Image XML parsing0.00080.053720.0004
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00170.1142160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs