Name

order — produce an order link

ATTRIBUTES

Attribute Pos. Req. Default Description
[ code | item | sku ] Yes Yes Item SKU
quantity Yes Quantity to order.
base Ordered list of particular product files to search. If unspecified, all tables defined as ProductFiles will be searched.
cart cart name
[ mv_sku | variant ]
form
page
area
arg
interpolate     0 interpolate output?
hide     0 Hide the tag return value?

DESCRIPTION

[order] displays an URL which adds an item to the shopping cart upon following the link. The next page is determined by order SpecialPage.

BEHAVIOR

This tag does not appear to be affected by, or affect, the rest of Interchange.

EXAMPLES

Example:

<a href="[order code="IC2008" quantity=10 area=1]">Buy 10 Interchange T-Shirts</a>

NOTES

AVAILABILITY

order is available in Interchange versions:

4.6.0-5.7.0 (git-head)

SOURCE

Interchange 5.7.0:

Source: code/SystemTag/order.coretag
Lines: 58


# Copyright 2002-2007 Interchange Development Group and others
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# 
# $Id: order.coretag,v 1.7 2007-03-30 23:40:49 pajamian Exp $

UserTag order               Order        code quantity
UserTag order               attrAlias    item code
UserTag order               attrAlias    sku code
UserTag order               attrAlias    table base
UserTag order               attrAlias    database base
UserTag order               attrAlias    db base
UserTag order               attrAlias    mv_ib base
UserTag order               attrAlias    href page
UserTag order               attrAlias    variant mv_sku
UserTag order               addAttr
UserTag order               PosNumber    2
UserTag order               Version      $Revision: 1.7 $
UserTag order               Routine      <<EOR
# Returns an href to place an order for the product PRODUCT_CODE.
# If AlwaysSecure is set, goes by the page accessed, otherwise 
# if a secure order has been started (with a call to at least
# one secure_vendUrl), then it will be given the secure URL
sub {
  my($code,$quantity,$opt) = @_;
$opt = {} unless $opt;
my @parms = (
        "mv_action=refresh",
        );

push(@parms, "mv_order_item=$code");
push(@parms, "mv_order_mv_ib=$opt->{base}")
  if($opt->{base});

push(@parms, "mv_cartname=$opt->{cart}")
  if($opt->{cart});

push(@parms, "mv_order_quantity=$quantity")
  if($quantity);

push @parms, "mv_sku=$opt->{mv_sku}" if $opt->{mv_sku};

$opt->{form} .= "\n" . join "\n", @parms;

$opt->{page} = find_special_page('order')
  unless $opt->{page};

if ($opt->{area}) {
  return tag_area($opt->{page}, $opt->{arg}, $opt);
}
else {
  return tag_page($opt->{page}, $opt->{arg}, $opt);
}
}
EOR

AUTHORS

Interchange Development Group

SEE ALSO

page(7ic), area(7ic)

DocBook! Interchange!