summaryrefslogtreecommitdiff
path: root/pages/flypage.html
blob: a958424cc4925adc68b9beff3e8a017187943571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@_TOP_@
    <div class="container p-4">
        <div class="container my-2">
            <img class="img-fluid" src="__IMAGE_DIR__/items/[item-field image]" alt="[item-description]">
        </div>
        <!-- Product heading -->
        <div class="container pl-3 pr-3">
            <h4>[item-description]</h4>
            <h5 class="text-primary">[item-price]</h5>
            <p class="text-muted text-monospace">[item-field prod_group] • [item-field category]</p>
        </div>[fly-list code="[data session arg]"]
        <form class="col" action="[area href="[if-item-field option_type][item-code][else]ord/checkout[/else][/if-item-field]"]" method="POST">
        <input type="hidden" name="mv_action" value="refresh">
        <input type="hidden" name="mv_order_item" value="[item-code]">
        <input type="hidden" name="mv_order_quantity" value="1">
        [form-session-id][edisplay show_var=0][if-item-field option_type][seti check_opt]
	&success=ord/checkout
	[query
	  list=1
          sql="select o_group,o_label from options where sku='[item-code]'"
	]mv_order_[sql-code]=mandatory [L]Need to select[/L] [sql-param o_label]
	[/query][/seti]
        <input type="hidden" name="mv_form_profile" value="check_opt">
        <!-- Product form control -->
        <div class=" container pl-3 pr-3">
          <div class="row">[perl options]
my $elements = '';
for my $option (@{$Tag->query({sql
		=> "SELECT o_group,o_label,o_value,o_widget FROM options WHERE sku='[item-code]' ORDER BY o_sort"})}) {
	my $o_label = $Tag->loc('', $option->[1]);
	$elements .= qq(
            <div class="form-group pr-2">
              <label for="mv_order_$option->[0]">$o_label</label>
              <select class="form-control" id="mv_order_$option->[0]" name="mv_order_$option->[0]">);
	my @csvs = split(/,/, $option->[2]);
	for my $csv (@csvs) {
		my $variant = '[item-code]';
		my @pair = split(/=/, $csv);
		my $label = $pair[1];
		my $default = '';
		if ($label =~ /\*/) {
			$default = $Tag->loc('', substr($label, 0, length($label) - 1));
		} else {
			$label = $Tag->loc('', $label);
		}
		$elements .= qq(
                <option value="$pair[0]")
		. ($default ? ' selected' : '') . '>'
		. ($default ? $default : $label)
		. '</option>';
	}
	$elements .= qq(
              </select>
            </div>);
	}
	return $elements;
	[/perl]
          </div>
        </div>[/if-item-field]
        <!-- Call to action button -->
        <div class="container my-4">
            <div class="d-grid gap-2">
                <button class="btn btn-outline-primary btn-lg btn-block d-flex justify-content-center align-content-between gap-2" href="[area ord/basket]" type="submit"><span class="material-icons-outlined">add</span>Add to cart</button>
                <button class="btn btn-primary btn-lg btn-block d-flex justify-content-center align-content-between gap-2" href="[area ord/checkout]" type="submit"><span class="material-icons-outlined">point_of_sale</span>[L]Checkout[/L]</button>
            </div>
        </div>
        </form>[/fly-list]
        <!-- Product description -->
        <div class="container">
            <p class="text-muted text-monospace">[L]Description[/L]</p>
            <p>[item-field comment]</p>
        </div>
    </div>__BOTTOM__