=head1 NAME
icupgrade - Interchange Upgrade Guide
=head1 DESCRIPTION
=head1 Introduction
This document contains, in rough form, notes on upgrading from
Minivend 3 to Minivend 4, and Minivend 4 to Interchange.
=head1 Interchange 4.8 Deprecated Features
This document describes features of Interchange 4.8 that have been
deprecated. Any use of these features should be discontinued. In most
cases we have provided an alternative mechanism to accomplish the same
results. These deprecated features may be removed at some point in the
future. You should change to the new mechanism to avoid breakage.
=head2 Deprecated Features Previous to Interchange 4
This section needs some serious work.
=over 4
=item cart/page from path
interchange.PL 308,313
if($path =~ s:/(.*)::) {
$cart = $1;
if($cart =~ s:/(.*)::) {
$page = $1;
}
}
=item mv_orderpage
interchange.PL 321,323
$CGI::values{mv_nextpage} = $CGI::values{mv_orderpage}
|| find_special_page('order')
if ! $CGI::values{mv_nextpage};
=item $decode
interchange.PL 493
HTML::Entities::decode($value) if $decode;
=item mv_orderpage
interchange.PL 854,855
$CGI::values{mv_nextpage} = $CGI::values{mv_orderpage}
if $CGI::values{mv_orderpage};
=item ROUTINES and LANG
interchange.PL 1552,1579
ROUTINES: {
last ROUTINES
unless index($Vend::FinalPath, '/process/') == 0;
while (
$Vend::FinalPath =~
s{/process/(locale|language|currency)/([^/]*)/}
{/process/}
)
{
$::Scratch->{"mv_$1"} = $2;
}
$Vend::FinalPath =~ s:/process/page/:/:;
}
my $locale;
if($locale = $::Scratch->{mv_language}) {
$Global::Variable->{LANG}
= $::Variable->{LANG} = $locale;
}
if ($Vend::Cfg->{Locale}
and $locale = $::Scratch->{mv_locale}
and defined $Vend::Cfg->{Locale_repository}->{$locale}
)
{
$Global::Variable->{LANG}
= $::Variable->{LANG}
= $::Scratch->{mv_language}
= $locale
if ! $::Scratch->{mv_language};
Vend::Util::setlocale( $locale,
($::Scratch->{mv_currency} || undef),
{ persist => 1 }
);
}
=item list_compat
lib/Vend/Interpolate.pm 2808
list_compat($opt->{prefix}, \$text);
lib/Vend/Interpolate.pm 3538
list_compat($opt->{prefix}, \$text);
lib/Vend/Interpolate.pm 3874
list_compat($opt->{prefix}, \$page);
=item find_sort
lib/Vend/Interpolate.pm 3270,3271
$text =~ /^\s*\[sort\s+.*/si
and $opt->{sort} = find_sort(\$text);
=item mv_order_report
lib/Vend/Order.pm 867,868
$body = readin($::Values->{mv_order_report})
if $::Values->{mv_order_report};
=item mv_error_$var
lib/Vend/Order.pm 1030
$::Values->{"mv_error_$var"} = $message;
=back
=head2 Interchange 4 Deprecated Features
=over 4
=item Vend::Util::send_mail Vend::Order::send_mail send_mail
The send_mail routine has been replaced by the Vend::Mail::send
routine.
=back
=head1 Upgrading from Minivend 4.0 to Interchange 4.6
if [item-price] suddenly turns 0, check PriceField in the catalog.cfg
=head2 minivend.cfg
=over 4
=item *
Remove references to MiniMate.
=item *
Add this line to minivend.cfg:
#include lib/UI/ui.cfg
=back
Make sure the files catalog_before.cfg and catalog_after.cfg are
there, or add their contents to etc/your_cat_name.before and
etc/your_cat_name.after to it only for some catalogs.
=head2 Access Manager
You need to get the minimate.asc file renamed to access.asc and add
the following fields to the first line:
groups
last_login
name
password
Remove these catalog.cfg lines:
Variable MINIMATE_META mv_metadata
Variable MINIMATE_TABLE minimate
Database minimate minimate.asc TAB
Add this one:
Database affiliate affiliate.txt TAB
Authentication for admin users is now done from a separate table than
customers, and passwords are encrypted.
=head2 Database Editing
Update the mv_metadata.asc file as appropriate.
=head2 Order Manager
Some things that are needed for the order manager:
=over 4
=item *
Add these fields to transactions:
affiliate approx. char(32)
=back
archived char(1)
campaign approx. char(32)
comments blob/text
complete char(1)
deleted char(1)
order_wday char(10)
order_ymd char(8)
po_number approx. char(32)
=over 4
=item *
Add these fields to transactions:
affiliate approx. char(32)
=back
campaign approx. char(32)
=over 4
=item *
Remove this field from userdb:
mv_credit_card_info
=back
=over 4
=item *
Add these fields to userdb:
inactive char(1)
=back
credit_limit char(14) or decimal(12,2)
dealer char(3)
=over 4
=item *
Create the directory 'logs'.
=item *
Create the directory 'orders' if it doesn't already exist.
=item *
Update your order routes to those in the Interchange distribution.
Note that the route log_entry is necessary if you want to enter orders
from the Interchange UI.
=item *
Update the etc/log_transaction file.
=item *
Add the etc/log_entry file.
=item *
Add this to catalog.cfg:
## Don't want people setting their credit_limit directly
=back
UserDB default scratch "credit_limit dealer"
=head2 Affiliates
Add a tab-delimited affiliate table:
affiliate name campaigns join_date url timeout active password
You can find a recommended database configuration in
foundation/dbconf/*/affiliate.*.
=head2 Page Editor
Add the directories 'templates' and 'backup'. Copy the contents of the
Interchange simple/templates to templates.
=head2 Item Editor
Add a merchandising table with the following fields:
Database merchandising merchandising.txt __SQLDSN__
Database merchandising DEFAULT_TYPE text
sku char(32)
featured char(32)
banner_text
banner_image
blurb_begin
blurb_end
timed_promotion char(16)
start_date char(24)
finish_date char(24)
upsell_to
cross_sell
cross_category char(64)
others_bought
times_ordered
Index the fields with char(*) types. You can find the recommended
database configuration in foundation/dbconf/*/merchandising.*
=head2 Preferences Editor (KNAR)
Create the tab-delimited file variable.txt with these fields:
code Variable pref_group
Add this as the *first* line of catalog.cfg:
VariableDatabase variable
=head2 Route Editor
Create the file route.txt with these fields:
code
report
receipt
encrypt_program
encrypt
pgp_key
pgp_cc_key
cyber_mode
credit_card
profile
inline_profile
email
attach
counter
increment
continue
partial
supplant
track
errors_to
Add this line in catalog.cfg:
RouteDatabase route
=head2 Transactions database
The back office UI should work fine for editing database tables.
Obviously the things which are specific to the order transaction setup
will break unless you have the right fields, but even these can be
controlled by configuring the UI.
Add a new field to transaction.txt called 'archived'.
=head1 Upgrading from Minivend 3 to Minivend 4
There were big changes from Minivend 3 to Minivend 4, some of which
were incompatible.
Many things were removed as redundant, deprecated, or just plain
crufty:
=head2 Nested [loop]s
MV3 used a different scheme for creating nested loop lists:
[loop with="-a"* arg="item item item" search="se=whatever"]
allowed you to refer to the nested values with a [loop-code-a]
construct. In Minivend 4, the form is:
[loop prefix=size list="Small Medium Large"]
[loop prefix=color list="Red White Blue"]
[color-code]-[size-code]
[/loop]
[/loop]
=head2 All frame features removed
Frames are now managed by the user in HTML.
=head2 Tags removed
buttonbar
Replace with Variable defined in catalog.cfg. buttonbar was previously
used as an SSI-like command for catalog-wide standardized features
like navigation bars. In the 3.x catalog.cfg the ButtonBars parameter
defines a list of html snippets, like
ButtonBars header.html footer.html copyright.html
So [buttonbar 0] substitutes 'header.html', [buttonbar 1] substitutes
'footer.html', etc.
In 4.x catalog.cfg, define variables, like
Variable HEADER