From a79348ff0a8af6d59696ee31fd7a293707989a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 4 Jul 2021 18:52:14 +0800 Subject: Separated web code --- pages/flypage.html | 77 +++++++++++++++++++++++ pages/ord/basket.html | 158 ++++++++++++++++++++++++++++++++++++++++++++++++ pages/ord/checkout.html | 138 ++++++++++++++++++++++++++++++++++++++++++ pages/results.html | 92 ++++++++++++++++++++++++++++ 4 files changed, 465 insertions(+) create mode 100644 pages/flypage.html create mode 100644 pages/ord/basket.html create mode 100644 pages/ord/checkout.html create mode 100644 pages/results.html (limited to 'pages') 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_@ +
+
+ [item-description] +
+ +
+

[item-description]

+
[item-price]
+

[item-field prod_group] • [item-field category]

+
[fly-list code="[data session arg]"] +
+ + + + [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] + + +
+
[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( +
+ + +
); + } + return $elements; + [/perl] +
+
[/if-item-field] + +
+
+
+ +
+
+ +
+
+
+
[/fly-list] + +
+

[L]Description[/L]

+

[item-field comment]

+
+
__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_@ + +
+ +
+
+

[L]Shopping Cart[/L]

+
+
+ +
+
+
+ [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-session-id] + + + + + +
+
+
+
[L]Description[/L]
+
+
+
[L]Price[/L]
+
[L]Quantity[/L]
+
[L]Total[/L]
+
+
+
+
+
+
+ + [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] + + +
+
+
+ +
+
+
+
+
[L]Price[/L]
+
[item-discount-price]
+
+
+
+
+
[L]Quantity[/L]
+
+
+
-
+ +
+
+
+
+
+
+
+
+
[L]Total price[/L]
+
[item-discount-subtotal]
+
+
+ +
+
+
+
+
+ [/item-list] + [/then] + [/if] + +
+
+
+
+
[L]Order Summary[/L]
+
+
+
+ [L]Subtotal[/L][subtotal] +
+
+ +
+ +
+
+
+
+
+ +@_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_@ + +
+ +
+

[L]Checkout form[/L]

+ [if session logged_in] +

[L]Please verify the information below and click the 'Place Order' button to process your order.[/L]

+ [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] +
+ +
+ +
+ [form-session-id] + +
+

[L]Order review[/L]

+
    + + [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] +
  • +
    +
    [item-description]
    + [item-discount-price] + x [item-quantity] +
    + [item-discount-subtotal] +
  • + [/item-list] + +
  • + Subtotal + [subtotal] +
  • + [/then][/if] +
+
+ +
+

Shipping

+ [include include/checkout/shipping_address] +
+ + + [include include/checkout/billing_address] + + +
+

Delivery method

+ +
+
+ + +
+
+ +
+ + +
+

Payment method

+ +
+
+ + +
+
+ +
+ + +
+

Order Summary

+
+

Shipping and additional costs are calculated based on values you have entered.

+
    +
  • [L]Subtotal[/L][subtotal]
  • +
  • [L]Shipping[/L][shipping]
  • +
  • [L]Total[/L][total-cost]
  • +
+
+
+ + +
[if items] +    + [button + text="[L]Place Order[/L]" + wait-text="-- [L]Wait[/L] --" + class="btn btn-primary btn-lg btn-block" + ] mv_todo=submit + [/button][else] + [L]No items in your shopping cart![/L][/else][/if] +
+
+ +
+ [tmp clear_errors][error all=1 comment="Clear errors"][/tmp] +
+ +__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_@ + + +
+
[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{} if $rel_prev; + push @out, qq{} if $rel_next; + $Tag->tmp('rel_next', 1) if $rel_next; + push @out, qq{} 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]
  • $ANCHOR$
  • [/link-template] + + [/more-list][/tmp][calc] + my $more = $Scratch->{bw_more}; + $more and $more =~ s,,
  • ,; + $more and $more =~ s, *,
  • ,g; + $Scratch->{bw_more} = $more; + return $Values->{more_link} ? $more : undef; + [/calc][search-list] +
    + + [item-description] + +
    [/search-list][no-match] +
    [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 %s.[/msg] + [/if][if value mv_search_error] + + [L]Errors[/L]: +
    [value-extended name=mv_search_error joiner="
    " filter=encode_entities] +
    + [/if] +
    + [/no-match][if value more_link][scratch bw_more][else][more-list] +
    + [msg arg.0="[matches]" arg.1="[match-count]"]Matches %s of %s found.[/msg] + [link-template]$ANCHOR$[/link-template] +
    [more]
    +
    + [/more-list] + [/else] + [/if][/search-region] +
    +
    + __BOTTOM__ -- cgit v1.2.3