From f10d739db922dd2060ab76b4266eae4d50e9fcf7 Mon Sep 17 00:00:00 2001 From: Anatasof Wirapraja Date: Mon, 5 Jul 2021 20:29:35 +0700 Subject: add .cart classes and cart item on basket --- html/css/product.css | 51 ++++++++++++++++++++- pages/ord/basket.html | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+), 1 deletion(-) diff --git a/html/css/product.css b/html/css/product.css index ee0d69c..fbd709c 100644 --- a/html/css/product.css +++ b/html/css/product.css @@ -83,4 +83,53 @@ } } -.overflow-hidden { overflow: hidden; } \ No newline at end of file +.overflow-hidden { overflow: hidden; } + +/* + * Cart + */ + +.cart-header { + text-transform: uppercase; + letter-spacing: 0.2em; + font-weight: bold; + padding: 1.2rem 2rem; + background: #f8f9fa +} + +.cart-body { + padding: 0 2rem +} + +.cart-footer { + background: #f8f9fa; + padding: 0 2rem +} + +.cart-footer .cart-item { + padding-top: 1rem; + padding-bottom: 1rem +} + +.cart-item { + padding-top: 1.5rem; + padding-bottom: 1.5rem; + border-bottom: 1px solid #e9ecef +} + +.cart-item:last-of-type { + border-bottom: none +} + +.cart-item-img { + max-width: 80px +} + +.cart-title { + margin-left: 1rem +} + +.cart-remove { + color: #495057; + font-size: .7875rem +} \ No newline at end of file diff --git a/pages/ord/basket.html b/pages/ord/basket.html index 189711f..be0168f 100644 --- a/pages/ord/basket.html +++ b/pages/ord/basket.html @@ -17,6 +17,127 @@ + +
+
+
+
+ [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]
+
[subtotal]
+
+
+ +
+
+
+
+ [/item-list] + [/then] + [/if] + +
+
+
+ +
+
+
+
+ -- cgit v1.2.3