summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-04 18:52:14 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-04 18:52:14 +0800
commita79348ff0a8af6d59696ee31fd7a293707989a84 (patch)
treef91c37373f1bb7474207055d600e4d2424ddbd8d /pages
Separated web code
Diffstat (limited to 'pages')
-rw-r--r--pages/flypage.html77
-rw-r--r--pages/ord/basket.html158
-rw-r--r--pages/ord/checkout.html138
-rw-r--r--pages/results.html92
4 files changed, 465 insertions, 0 deletions
diff --git a/pages/flypage.html b/pages/flypage.html
new file mode 100644
index 0000000..094e5f3
--- /dev/null
+++ b/pages/flypage.html
@@ -0,0 +1,77 @@
+@_TOP_@
+ <div class="container pt-5">
+ <div class="container p-3">
+ <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 p-3">
+ <div class="row">
+ <div class="col p-2">
+ <button class="btn btn-outline-primary btn-lg btn-block" href="[area ord/basket]" type="submit">+ Keranjang</button>
+ </div>
+ <div class="col p-2">
+ <button class="btn btn-primary btn-lg btn-block" href="[area ord/checkout]" type="submit">[L]Checkout[/L]</button>
+ </div>
+ </div>
+ </div>
+ </form>[/fly-list]
+ <!-- Product description -->
+ <div class="container p-3">
+ <p class="text-muted text-monospace">[L]Description[/L]</p>
+ <p>[item-field comment]</p>
+ </div>
+ </div>__BOTTOM__
diff --git a/pages/ord/basket.html b/pages/ord/basket.html
new file mode 100644
index 0000000..4778d6a
--- /dev/null
+++ b/pages/ord/basket.html
@@ -0,0 +1,158 @@
+[tmp page_title]__COMPANY__ -- [L]Shopping Cart[/L][/tmp]
+
+@_TOP_@
+<!-- BEGIN CONTENT -->
+<div class="container p-4">
+ <!-- Hero Section-->
+ <div class="py-5">
+ <div class="text-start">
+ <h1>[L]Shopping Cart[/L]</h1>
+ </div>
+ </div>
+ <!-- End of Hero section -->
+ <div class="container g-5">
+ <div class="container">
+ <div>
+ [edisplay]
+
+ [calc]
+ my $cname = $Config->{CookieName} || 'MV_SESSION_ID';
+ $Scratch->{have_cookie} = $Tag->read_cookie($cname)
+ and delete $Scratch->{tried};
+ return;
+ [/calc]
+ [if scratch have_cookie]
+ [elsif scratch tried]
+ [L CART_MSG1]You must have cookies set to leave the basket. Check out now or forever lose your shopping cart.[/L]
+ [/elsif]
+ [else]
+ [set tried]1[/set]
+ [bounce href="[area ord/basket]"]
+ [/else]
+ [/if]
+
+ <form action="[process secure=1]" method=POST name="basket" class="form-horizontal" id="form">
+ [form-session-id]
+ <input type="hidden" name="mv_doit" value="refresh">
+ <input type="hidden" name="mv_orderpage" value="ord/basket">
+ <input type="hidden" name="mv_nextpage" value="index">
+ <input type="hidden" name="mv_nlines" value="[nitems lines=1]">
+
+ <div class="container">
+ <div class="container font-weight-bold text-center p-4">
+ <div class="row">
+ <div class="col-md-5">[L]Description[/L]</div>
+ <div class="col-md-7 d-none d-md-block">
+ <div class="row">
+ <div class="col-md-3">[L]Price[/L]</div>
+ <div class="col-md-4">[L]Quantity[/L]</div>
+ <div class="col-md-3">[L]Total[/L]</div>
+ <div class="col-md-2"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+
+ [if items]
+ [then]
+ [item-list]
+
+ [item-calc]
+ #Log("Checking master item $master");
+ $row_class = ++$count % 2 ? 'cartnorm' : 'cartalt';
+ my $item = '[item-increment]';
+ my $up = q{[item-data merchandising upsell_to]};
+ my $cr = q{[item-data merchandising cross_sell]};
+ $upsell_remove{'[item-code]'} = 1;
+ $cross_remove{'[item-code]'} = 1;
+ my %seen = ( '' => 1 );
+
+ $Scratch->{upsell} .= " $up" if $up;
+ $Scratch->{cross_codes} .= " $cr" if $cr;
+ my @up = split /\s+/, $Scratch->{upsell};
+ my @cr = split /\s+/, $Scratch->{cross_codes};
+ @up = grep ( (!$seen{$_}++ && ! $upsell_remove{$_}), @up);
+ @cr = grep ( (!$seen{$_}++ && ! $cross_remove{$_}), @cr);
+ $Scratch->{upsell} = join " ", @up;
+ $Scratch->{cross_codes} = join " ", @cr;
+ return;
+ [/item-calc]
+
+ <!-- Product-->
+ <div class="container pb-4">
+ <div class="card p-4">
+ <div class="row d-flex align-items-center text-left text-md-center">
+ <div class="col-12 col-md-5"><a class="cart-remove close mt-3 d-md-none" href="#"><i class="fa fa-times"></i></a>
+ <div class="d-flex align-items-center"><a href="[area href="[item-sku]"]">[image src="[item-field image]" imagesubdir=items makesize="80x80" extra='class="cart-item-img" alt=""']</a>
+ <div class="text-left"><a href="[area href="[item-sku]"]"><strong>[item-description]</strong></a><br><span class="text-muted text-sm">Size: Large</span><br><span class="text-muted text-sm">Colour: Green</span>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-md-7 mt-4 mt-md-0">
+ <div class="row align-items-center">
+ <div class="col-md-3">
+ <div class="row">
+ <div class="col-6 d-md-none text-muted">[L]Price[/L]</div>
+ <div class="col-6 col-md-12 text-right text-md-center">[item-discount-price]</div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="row align-items-center">
+ <div class="d-md-none col-7 col-sm-9 text-muted">[L]Quantity[/L]</div>
+ <div class="col-5 col-sm-3 col-md-12">
+ <div class="d-flex align-items-center">
+ <div class="btn btn-items btn-items-decrease" onclick="document.getElementById('[item-quantity-name]').value--; document.getElementById('form').submit()">-</div>
+ <input class="form-control text-center border-0 border-md input-items" type="text" value="[item-quantity]" name="[item-quantity-name]" id="[item-quantity-name]" onchange="this.form.submit()">
+ <div class="btn btn-items btn-items-increase" onclick="document.getElementById('[item-quantity-name]').value++; document.getElementById('form').submit()">+</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-3">
+ <div class="row">
+ <div class="col-6 d-md-none text-muted">[L]Total price[/L]</div>
+ <div class="col-6 col-md-12 text-right text-md-center">[item-discount-subtotal]</div>
+ </div>
+ </div>
+ <div class="col-2 d-none d-md-block text-center">
+ <a class="cart-remove" href="#" onclick="document.getElementById('[item-quantity-name]').value = 0; document.getElementById('form').submit()"><span class="material-icons-outlined">close</span>
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ [/item-list]
+ [/then]
+ [/if]
+ <!-- End of product -->
+ </div>
+ </div>
+ <div class="card bg-light border-dark">
+ <div class="card-header ">
+ <h6 class="text-uppercase mb-0">[L]Order Summary[/L]</h6>
+ </div>
+ <div class="card-body">
+ <div class="card-text">
+ <span>[L]Subtotal[/L]</span><span class="float-right">[subtotal]</span>
+ </div>
+ </div>
+ <div class="card-footer">
+ <strong><span>Total</span><span class="float-right">[total-cost]</span></strong>
+ </div>
+ </div>
+ <div class="mt-4">
+ <div class="d-flex justify-content-between flex-column flex-lg-row">
+ <a class="btn btn-lg btn-link text-muted" href="[area index]">[L]Continue Shopping[/L]</a>
+ <a class="btn btn-lg btn-primary" href="[area ord/checkout]">[L]Proceed to checkout[/L]</a>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+</div>
+<!-- END CONTENT -->
+@_BOTTOM_@ \ No newline at end of file
diff --git a/pages/ord/checkout.html b/pages/ord/checkout.html
new file mode 100644
index 0000000..53963ae
--- /dev/null
+++ b/pages/ord/checkout.html
@@ -0,0 +1,138 @@
+[tmp page_title]__COMPANY__ -- [L]Checkout[/L][/tmp]
+[tmp display_class]noleft[/tmp]
+[tmpn onepage]1[/tmpn]
+
+[include include/checkout/initialization]
+
+@_TOP_@
+ <!-- BEGIN CONTENT -->
+ <div class="container p-4">
+ <!-- Hero Section-->
+ <div class="py-5">
+ <h2>[L]Checkout form[/L]</h2>
+ [if session logged_in]
+ <p class="lead">[L]Please verify the information below and click the <b>'Place Order'</b> button to process your order.[/L]</p>
+ [include include/checkout/login_form][/else][/if][if !variable NO_TAX_POPUP]
+ [include include/checkout/tax_popup][/if]
+ [edisplay show_label=1 show_var=0 keep=1]
+ </div>
+ <!-- End Hero section-->
+ <div class="g-5">
+
+ <form action="[area href=@@MV_PAGE@@ secure=1]" method="POST" name="checkout">
+ [form-session-id]
+ <input type="hidden" name="mv_action" value="refresh"/>
+ <div>
+ <h4 class="d-flex justify-content-between align-items-center mb-3">[L]Order review[/L]</h4>
+ <ul class="list-group mb-3">
+ <!-- Product Item -->
+ [if items][then][item-list][item-calc]
+ #Log("Checking master item $master");
+ $row_class = ++$count % 2 ? 'cartnorm' : 'cartalt';
+ my $item = '[item-increment]';
+ my $up = q{[item-data merchandising upsell_to]};
+ my $cr = q{[item-data merchandising cross_sell]};
+ $upsell_remove{'[item-code]'} = 1;
+ $cross_remove{'[item-code]'} = 1;
+ my %seen = ( '' => 1 );
+ $Scratch->{upsell} .= " $up" if $up;
+ $Scratch->{cross_codes} .= " $cr" if $cr;
+ my @up = split /\s+/, $Scratch->{upsell};
+ my @cr = split /\s+/, $Scratch->{cross_codes};
+ @up = grep ( (!$seen{$_}++ && ! $upsell_remove{$_}), @up);
+ @cr = grep ( (!$seen{$_}++ && ! $cross_remove{$_}), @cr);
+ $Scratch->{upsell} = join " ", @up;
+ $Scratch->{cross_codes} = join " ", @cr;
+ return;
+ [/item-calc]
+ <li class="list-group-item d-flex justify-content-between lh-sm">
+ <div>
+ <a href="[area href="[item-sku]"]"><h6 class="my-0">[item-description]</h6></a>
+ <small class="text-muted">[item-discount-price]</small>
+ <small class="text-muted">x [item-quantity]</small>
+ </div>
+ <span class="text-muted">[item-discount-subtotal]</</span>
+ </li>
+ [/item-list]
+ <!-- End of Product Item -->
+ <li class="list-group-item d-flex justify-content-between">
+ <span>Subtotal</span>
+ <strong>[subtotal]</strong>
+ </li>
+ [/then][/if]
+ </ul>
+ </div>
+ <!-- Shipping Address -->
+ <div>
+ <h4 class="mb-3">Shipping</h4>
+ [include include/checkout/shipping_address]
+ </div>
+ <!-- End of Shipping Address -->
+ <!-- Billing Address -->
+ [include include/checkout/billing_address]
+ <!-- End of Billing Address -->
+ <!-- Delivery Method -->
+ <div>
+ <h4>Delivery method</h4>
+ <!-- Delivery option-->
+ <div class="row">
+ <div class="form-group col-md-6 d-flex align-items-center">
+ <input type="radio" name="mv_shipmode" id="option0" value="cpa" checked/>
+ <label class="ml-3" for="option0">
+ <strong class="d-block text-uppercase mb-2">[shipping-desc]</strong>
+ <span class="text-muted text-sm">
+ [L]Get it right on next day - fastest option possible.[/L]
+ </span>
+ </label>
+ </div>
+ </div>
+ <!-- End of delivery option -->
+ </div>
+ <!-- End of Delivery Method -->
+ <!-- Payment Method -->
+ <div>
+ <h4 class="mb-3">Payment method</h4>
+ <!-- Payment Option-->
+ <div class="row">
+ <div class="form-group col-md-6 d-flex align-items-center">
+ <input type="radio" name="mv_order_profile" value="purchase_order" id="payment-method-1" checked/>
+ <label class="ml-3" for="payment-method-1">
+ <strong class="d-block text-uppercase mb-2">[L]Manual Transfer[/L]</strong>
+ <span class="text-muted text-sm">[L]Please make payments by using the bank transfer method to BCA 12345678 a/n ABCDEFG.[/L]</span>
+ </label>
+ </div>
+ </div>
+ <!-- /Payment Option-->
+ </div>
+ <!-- End of Payment Method -->
+ <!-- Order summary -->
+ <div>
+ <h4 class="mb-3">Order Summary</h4>
+ <div>
+ <p class="text-sm">Shipping and additional costs are calculated based on values you have entered.</p>
+ <ul class="order-summary mb-0 list-unstyled">
+ <li class="order-summary-item"><span>[L]Subtotal[/L]</span><span>[subtotal]</span></li>
+ <li class="order-summary-item"><span>[L]Shipping[/L]</span><span>[shipping]</span></li>
+ <li class="order-summary-item border-0"><span>[L]Total[/L]</span><strong class="order-summary-total">[total-cost]</strong></li>
+ </ul>
+ </div>
+ </div>
+
+ <!-- End of Order Summary -->
+ <div class="d-grid gap-2 d-md-block mb-5">[if items]
+ &nbsp;&nbsp;
+ [button
+ text="[L]Place Order[/L]"
+ wait-text="-- [L]Wait[/L] --"
+ class="btn btn-primary btn-lg btn-block"
+ ] mv_todo=submit
+ [/button][else]
+ <b>[L]No items in your shopping cart![/L]</b>[/else][/if]
+ </div>
+ </form>
+
+ </div>
+ [tmp clear_errors][error all=1 comment="Clear errors"][/tmp]
+ </div>
+ <!-- END CONTENT -->
+__BOTTOM__
diff --git a/pages/results.html b/pages/results.html
new file mode 100644
index 0000000..aea3ff7
--- /dev/null
+++ b/pages/results.html
@@ -0,0 +1,92 @@
+@_TOP_@
+
+ <!-- Catalog Content -->
+ <div class="container pt-5">
+ <div class="row text-center text-lg-left pt-2">[search-region][on-match][tmp meta_header][calcn]
+ return unless $Values->{more_link};
+ (my $more_page = $Session->{last_url}) =~ s|^/.*/([^\..]+)(?:\.html)?|$1|;
+ if ($more_page =~ /^(Next|Prev)/) {
+ $Tag->tag({ op => 'header' }, qq{Cache-control: no-cache\nCache-control: no-store\nPragma: no-cache\nExpires: 0\nContent-type: text/html});
+ }
+ ## $mc set above.
+ my $ml = $Values->{mv_matchlimit} || '';
+ my $fm = $Values->{mv_first_match} || '';
+ my ($canon, $rel_prev, $rel_next);
+ #Debug("more_page=$more_page, ml=$ml, fm=$fm, mc=$mc");
+ my ($prev, $next);
+ REL: {
+ last REL if $mc < $ml;
+ if ($fm == 0 || $fm == 1) { # first page
+ $rel_next = $Values->{more_link} . '/2';
+ } elsif (($mc - $fm - $ml) <= 0) { # last page
+ $prev = sprintf("%.0f", (($fm+$ml) / $ml) - 1);
+ $rel_prev = $Values->{more_link} . '/' . ($prev ? $prev : '1');
+ } else { # page 2 to second-to-last
+ $prev = sprintf("%.0f", ($fm / $ml));
+ $next = $prev + 2;
+ $rel_prev = $Values->{more_link} . "/$prev";
+ $rel_next = $Values->{more_link} . "/$next";
+ }
+ }
+ CANON: {
+ last CANON if $more_page !~ /^1|(Next|Prev)/;
+ if ($more_page eq '1') {
+ $canon = '';
+ } else {
+ $canon = sprintf("%.0f", ($fm+$ml) / $ml);
+ $canon = '' if $canon == 1;
+ }
+ $canon = $Values->{more_link} . ($canon ? "/$canon" : '');
+ }
+ my @out;
+ my $url = ($Variable->{SAMPLEURL} . $Variable->{CGI_URL}) || '';
+ my $ext = $Scratch->{mv_add_dot_html} ? '.html' : '';
+ $url !~ /\/$/ and $url .= '/';
+ push @out, qq{<link rel="prev" href="$url$rel_prev$ext">} if $rel_prev;
+ push @out, qq{<link rel="next" href="$url$rel_next$ext">} if $rel_next;
+ $Tag->tmp('rel_next', 1) if $rel_next;
+ push @out, qq{<link rel="canonical" href="$url$canon$ext">} if $canon;
+ if ($prev || $next) { $Scratch->{page_title} = $Scratch->{page_title} . ' - Page ' . (($prev || $next)+1) };
+ return "\t" . join "\n\t", @out;
+ [/calcn][/tmp][/on-match][tmp bw_more][more-list][first-anchor][/first-anchor][last-anchor][/last-anchor][link-template]<li><a href="[area href=|[value more_link]/$ANCHOR$|]">$ANCHOR$</a></li>[/link-template]
+ <nav>
+ <ul class="pagination">
+ {PREV_LINK}{MORE_LIST}[if scratch rel_next]{NEXT_LINK}[/if]
+ </ul>
+ </nav>
+ [/more-list][/tmp][calc]
+ my $more = $Scratch->{bw_more};
+ $more and $more =~ s,<strong>,<li class="active"><a href="#">,;
+ $more and $more =~ s,</strong> *,</a></li>,g;
+ $Scratch->{bw_more} = $more;
+ return $Values->{more_link} ? $more : undef;
+ [/calc][search-list]
+ <div class="col-lg-4 col-md-4">
+ <a href="[area [item-code]]" class="d-block h-100">
+ <img src="__IMAGE_DIR__/thumb/[item-field thumb]" class="img-fluid img-thumbnail" alt="[item-description]" title="[item-code]">
+ </a>
+ </div>[/search-list][no-match]
+ <div>[comment]
+ Don't show the search string if it was empty, since it looks weird
+ and the user will see the error below anyway.
+ [/comment][tmp matchstring][value-extended name=mv_searchspec joiner=" | " filter=encode_entities][/tmp][if scratch matchstring]
+ [msg arg.0="[scratch matchstring]"]Sorry, no matches for <B>%s</B>.[/msg]
+ [/if][if value mv_search_error]
+ <B>
+ [L]Errors[/L]:
+ <BR>[value-extended name=mv_search_error joiner="<BR>" filter=encode_entities]
+ </B>
+ [/if]
+ </div>
+ [/no-match][if value more_link][scratch bw_more][else][more-list]
+ <div class=morelist>
+ [msg arg.0="[matches]" arg.1="[match-count]"]Matches %s of %s found.[/msg]
+ [link-template]<a href="$URL$" target="_top" class="morelink">$ANCHOR$</a>[/link-template]
+ <BR>[more]<BR>
+ </div>
+ [/more-list]
+ [/else]
+ [/if][/search-region]
+ </div>
+ </div>
+ <!-- .End of Catalog Content -->__BOTTOM__