use BSE::Util::Secure qw(make_secret);
use BSE::Template;
-our $VERSION = "1.052";
+our $VERSION = "1.053";
=head1 NAME
require BSE::TB::OrderItemOptions;
my @option_descs = $product->option_descs($cfg, $item->{options});
my $display_order = 1;
- for my $option (@option_descs) {
+ for my $option (grep $_->{value} ne '', @option_descs) {
my $optionitem = BSE::TB::OrderItemOptions->make
(
order_item_id => $dbitem->{id},
my @options;
my @option_descs = $product->option_descs($req->cfg);
my @option_names = map $_->{name}, @option_descs;
+ my $allow_missing_options = $req->cfg->entry("shop", "allow_missing_options", 0);
my @not_def;
my $cgi = $req->cgi;
for my $name (@option_names) {
my $value = $cgi->param($name);
- push @options, $value;
unless (defined $value) {
- push @not_def, $name;
+ if ($allow_missing_options) {
+ $value = "";
+ }
+ else {
+ push @not_def, $name;
+ }
}
+ push @options, $value;
}
if (@not_def) {
$$error = "Some product options (@not_def) not supplied";
is true, add the comma separated fields listed here to the required
checkout fields list. Default: none.
+=item allow_missing_options
+
+If true, products with missing options can be added to the cart and
+purchased. Default: false.
+
=back
=head2 [shipping]