[ic] Interchange on Mac OS X Panther Locale problem
Mark Bryant
mark at vwe.net
Tue Feb 24 17:12:53 EST 2004
At 20:53 24/02/2004, you wrote:
>Hi All,
>
>I am running Interchange 5.1 on Mac OS X 10.3.2 Panther With standard
>Apache, MySQL and recompiled unthreaded perl 5.8.3. Its not a production
>site just a test rig in fact its running on a G3 Lombard Powerbook and it
>works fine.
>
>But I am having a problem setting the locale for the UK I have set the
>locale to be en_GB in the catalog.cfg file and in the Admin interface
>under internationalisation.
>
>I have added a en_GB column to locale.txt in products directory
>
>I have attempted to set the default tax to VAT and 17.5 % in the tax admin
>area
>
>I have also tried to crib as much as I can from www.webmaint.net's
>excellent UK localisation documentation (thanks) and from the interchange
>documentation wiki.
>
>The result is that Tax does not work and I have lost the default dollar
>sign but the UK pound sign has not appeared.
>
>I don't think the problem is down to Mac OS X it is more likely to be I
>have missed some steps in the localisation.
>
>Can anyone give me some pointers please.
>
>Thanks,
>
>Hillary
Hi Hilary,
To get UK tax showing through in pages such as the fly page and components
like random, best sellers, etc after setting the tax in the admin UI, I
still had to put this usertag in my catalog.cfg and edit a few pages to
make them call/use it:
# per item tax calculations
UserTag addtax Order amount cat notax
UserTag addtax addAttr
UserTag addtax Routine <<EOR
sub {
my ($amount, $cat, $notax, $ref) = @_;
return currency( $amount, $ref->{noformat} ) if $notax;
my $cfield = $::Variable->{MV_COUNTRY_FIELD} || 'country';
my $country = $ref->{country} || $::Values->{$cfield};
return 0 if ! $country;
my $ctable = $ref->{country_table}
|| $::Variable->{MV_COUNTRY_TABLE}
|| 'country';
my $c_taxfield = $ref->{country_tax_field}
|| $::Variable->{MV_COUNTRY_TAX_FIELD}
|| 'tax';
my $type ||= $Tag->data($ctable, $c_taxfield, $country);
return currency( $amount, $ref->{noformat} ) if ! $type;
$type =~ s/^\s+//;
$type =~ s/\s+$//;
my $tax = Vend::Util::get_option_hash($type);
my $taxrate = defined $tax->{$cat} ? $tax->{$cat} : $tax->{default};
$taxrate =~ s/\s*%\s*$// and $taxrate /= 100;
$amount += $amount * $taxrate;
return currency( $amount, $ref->{noformat} );
}
EOR
I then edited the pages that were not showing the tax inclusive prices to
use this line instead of the default one
Our Price: <b>[item-price]</b>
becomes:
Our Price: <b>[addtax [item-price noformat=1][item-field
tax_category][item-field nontaxable]]</b>
The GBP pound sign should then appear along with the tax inclusive price.
I hope this helps solve your problem :)
Mark
Eros Shop
vwe internet ltd
PO BOX 1067
SLOUGH
SL1 7YA
UK
Shop - http://www.eros-shop.co.uk
EMail - info at eros-shop.co.uk
Tel - 0870 737 3369
Fax - 0870 737 4469
More information about the interchange-users
mailing list