Name

CartTriggerQuantity — specify whether quantity changes to cart items will cause CartTrigger subroutines to execute

SYNOPSIS

No | Yes

DESCRIPTION

The directive specifies whether quantity changes on existing cart items will cause specified CartTrigger subroutines to execute.

Note, however, that a quantity change to zero will result in item deletion, and will consequently cause CartTriggers to execute regardless of CartTriggerQuantity's value.

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Setting CartTriggerQuantity

CartTriggerQuantity yes

NOTES

It must be noted that the Interchange cart subsystem is based on arrayrefs of hashrefs (all Perl programming terms) — there is no object encapsulation for limiting or monitoring program access to the contents of any cart. Consequently, direct manipulation of the cart from within Perl will not cause these triggers to fire. The triggers only fire when the cart contents are modified through the standard Interchange CGI-based variable processing. Therefore, it is assumed (for the moment, at least) that any programmer sufficiently comfortable or confident to manipulate cart contents directly can also be given the responsibility of deciding whether or not it is appropriate to invoke cart triggers along the way.

AVAILABILITY

CartTriggerQuantity is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 715

['CartTriggerQuantity',  'yesno',     'no'],

Source: lib/Vend/Config.pm
Line 5414 (context shows lines 5414-5426)

sub parse_yesno {
my($var, $value) = @_;
$_ = $value;
if (m/^y/i || m/^t/i || m/^1/ || m/^on/i) {
  return 1;
}
elsif (m/^n/i || m/^f/i || m/^0/ || m/^of/i) {
  return 0;
}
else {
  config_error("Use 'yes' or 'no' for the $var directive\n");
}
}

AUTHORS

Interchange Development Group

SEE ALSO

CartTrigger(7ic), ItemAction(7ic)

DocBook! Interchange!