diff options
-rw-r--r-- | catalog.cfg | 6 | ||||
-rw-r--r-- | config/pikul.tag | 82 | ||||
-rw-r--r-- | config/pikul_cost.tag | 5 | ||||
-rw-r--r-- | config/pikul_order.tag | 1 | ||||
-rw-r--r-- | html/css/product.css | 139 | ||||
-rw-r--r-- | pages/member/account.html | 65 | ||||
-rw-r--r-- | pages/member/order-detail.html | 156 | ||||
-rw-r--r-- | pages/member/service.html | 65 | ||||
-rw-r--r-- | pages/ord/checkout.html | 62 |
9 files changed, 554 insertions, 27 deletions
diff --git a/catalog.cfg b/catalog.cfg index c368116..e8668fa 100644 --- a/catalog.cfg +++ b/catalog.cfg @@ -757,5 +757,7 @@ SearchProfile include/profiles/searchprofiles Jobs log __LOGDIR__/jobs.log Jobs base_directory etc/jobs -Variable PIKUL_ANTERAJA 0 -Variable PIKUL_SICEPAT 1 +Variable PIKUL 0 +Variable PIKUL_ANTERAJA 1 +Variable PIKUL_SICEPAT 2 +Variable PIKUL_END 3 diff --git a/config/pikul.tag b/config/pikul.tag new file mode 100644 index 0000000..0164851 --- /dev/null +++ b/config/pikul.tag @@ -0,0 +1,82 @@ +UserTag pikul Order widget extra +UserTag pikul Routine <<EOR +sub { + my ($widget, $extra) = @_; + my $district = $Tag->value('address2'); + my $city = $Tag->value('city'); + my $province = $Tag->value('state'); + my $weight = 0.0; + for my $item (@{$Carts->{main}}) { + $weight += $Tag->data('products', 'weight', $item->{code}) * $item->{quantity}; + } + my (@origins, @destinations, @code_prefixes, @name_prefixes); + use Pikul; + for (my $company = $::Variable->{PIKUL}; $company < $::Variable->{PIKUL_END}; $company++) { + if ($company == $::Variable->{PIKUL}) { + $origins[$company] = undef; + $destinations[$company] = undef; + $code_prefixes[$company] = undef; + $name_prefixes[$company] = undef; + } elsif ($company == $::Variable->{PIKUL_ANTERAJA}) { + my $access_key_id = $::Variable->{ANTERAJA_ACCESS_KEY_ID} + || $Global::Variable->{ANTERAJA_ACCESS_KEY_ID}; + my $secret_access_key = $::Variable->{ANTERAJA_SECRET_ACCESS_KEY} + || $Global::Variable->{ANTERAJA_SECRET_ACCESS_KEY}; + my $base_path = $::Variable->{ANTERAJA_BASE_PATH} + || $Global::Variable->{ANTERAJA_BASE_PATH}; + if (!$access_key_id || !$secret_access_key || !$base_path) { + $origins[$company] = undef; + $destinations[$company] = undef; + $code_prefixes[$company] = undef; + $name_prefixes[$company] = undef; + next; + } + Pikul::init($company, [ + $access_key_id, + $secret_access_key, + $base_path + ]); + $origins[$company] = $::Variable->{ANTERAJA_ORIGIN} + || $Global::Variable->{ANTERAJA_ORIGIN}; + $destinations[$company] = $Tag->query({sql => "SELECT code FROM anteraja WHERE \ + district='$district' AND city='$city' AND province='$province'", + wantarray => 1})->[0]->[0] || ''; + $code_prefixes[$company] = 'anteraja_'; + $name_prefixes[$company] = 'Anteraja '; + } elsif ($company == $::Variable->{PIKUL_SICEPAT}) { + my $api_key = $::Variable->{SICEPAT_API_KEY} + || $Global::Variable->{SICEPAT_API_KEY}; + if (!$api_key) { + $origins[$company] = undef; + $destinations[$company] = undef; + $code_prefixes[$company] = undef; + $name_prefixes[$company] = undef; + next; + } + Pikul::init($company, [ + $api_key + ]); + $origins[$company] = $::Variable->{SICEPAT_ORIGIN} + || $Global::Variable->{SICEPAT_ORIGIN}; + $destinations[$company] = $Tag->query({sql => "SELECT code FROM sicepat_destination\ + WHERE district='$district' AND city='$city' AND \ + province='$province'", wantarray => 1})->[0]->[0] || ''; + $code_prefixes[$company] = 'sicepat_'; + $name_prefixes[$company] = 'SiCepat '; + } + } + my $elements = Pikul::html( + \@origins, + \@destinations, + $weight, + $widget, + $extra, + 'mv_shipmode', + $Tag->value('mv_shipmode'), + \@code_prefixes, + \@name_prefixes + ); + Pikul::cleanup(); + return $elements; +} +EOR diff --git a/config/pikul_cost.tag b/config/pikul_cost.tag index ceec7c6..199e503 100644 --- a/config/pikul_cost.tag +++ b/config/pikul_cost.tag @@ -21,14 +21,15 @@ sub { use Pikul; Pikul::init($company, \@provisions); my $cost = Pikul::cost( + $company, + $service, $origin, $Tag->query({ sql => "SELECT code FROM $table WHERE district='$district' AND \ city='$city' AND province='$province'", wantarray => 1 })->[0]->[0] || '', - $weight, - $service); + $weight); Pikul::cleanup(); return $cost; } diff --git a/config/pikul_order.tag b/config/pikul_order.tag index e684837..35845f6 100644 --- a/config/pikul_order.tag +++ b/config/pikul_order.tag @@ -42,6 +42,7 @@ sub { use Pikul; Pikul::init($company, \@provisions); my $tracking_number = Pikul::order( + $company, $order_number, $service, $::Variable->{COMPANY}, diff --git a/html/css/product.css b/html/css/product.css index fbd709c..a4fb555 100644 --- a/html/css/product.css +++ b/html/css/product.css @@ -132,4 +132,141 @@ .cart-remove { color: #495057; font-size: .7875rem -}
\ No newline at end of file +} + + +/* +* Card +*/ +.card { + position: relative; + display: flex; + flex-direction: column; + min-width: 0; + word-wrap: break-word; + background-color: #fff; + background-clip: border-box; + border: 0 solid rgba(17, 17, 17, .125); +} +.card>hr { + margin-right: 0; + margin-left: 0; +} +.card-body { + flex: 1 1 auto; + min-height: 1px; + padding: 1.5rem; +} +.card-title { + margin-bottom: .75rem; +} +.card-subtitle { + margin-top: -.375rem; + margin-bottom: 0; +} +.card-text:last-child { + margin-bottom: 0; +} +.card-link:hover { + text-decoration: none; +} +.card-link+.card-link { + margin-left: 1.5rem; +} +.card-header { + padding: .75rem 1.5rem; + margin-bottom: 0; + background-color: rgba(17, 17, 17, .03); + border-bottom: 0 solid rgba(17, 17, 17, .125); +} +.card-header+.list-group .list-group-item:first-child { + border-top: 0; +} +.card-footer { + padding: .75rem 1.5rem; + background-color: rgba(17, 17, 17, .03); + border-top: 0 solid rgba(17, 17, 17, .125); +} +.card-header-tabs { + margin-right: -.75rem; + margin-bottom: -.75rem; + margin-left: -.75rem; + border-bottom: 0; +} +.card-header-pills { + margin-right: -.75rem; + margin-left: -.75rem; +} +.card-img-overlay { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: 1.5rem; +} +.card-img, .card-img-bottom, .card-img-top { + flex-shrink: 0; + width: 100%} +.card-deck .card { + margin-bottom: 1rem; +} +@media (min-width:576px) { + .card-deck { + display: flex; + flex-flow: row wrap; + margin-right: -1rem; + margin-left: -1rem; +} +.card-deck .card { + flex: 1 0 0%; + margin-right: 1rem; + margin-bottom: 0; + margin-left: 1rem; +} +} +.card-group>.card { + margin-bottom: 1rem; +} +@media (min-width:576px) { + .card-group { + display: flex; + flex-flow: row wrap; +} +.card-group>.card { + flex: 1 0 0%; + margin-bottom: 0; +} +.card-group>.card+.card { + margin-left: 0; + border-left: 0; +} +} +.card-columns .card { + margin-bottom: .75rem; +} +@media (min-width:576px) { + .card-columns { + -moz-column-count: 3; + column-count: 3; + -moz-column-gap: 1.25rem; + column-gap: 1.25rem; + orphans: 1; + widows: 1; +} +.card-columns .card { + display: inline-block; + width: 100%} +} +.accordion>.card { + overflow: hidden; +} +.accordion>.card:not(:last-of-type) { + border-bottom: 0; +} +.accordion>.card>.card-header { + margin-bottom: 0; +} +/* +* End Card +*/
\ No newline at end of file diff --git a/pages/member/account.html b/pages/member/account.html new file mode 100644 index 0000000..9f5fe43 --- /dev/null +++ b/pages/member/account.html @@ -0,0 +1,65 @@ +@_TOP_@ +<!-- BEGIN CONTENT --> +<div class="container p-4"> + <!-- Hero Section--> + <div class="py-2"> + <h1>[L]Account[/L]</h1> + [if session logged_in] + [edisplay show_label=1 show_var=0 keep=1] + </div> + <!-- End Hero section--> + <!-- Orders Section--> + <section> + <div class="block-header"> + <h4 class="d-flex justify-content-between">Orders</h4> + </div> + <div class="container"> + <div> + <table class="table table-borderless table-hover table-responsive-md"> + <thead class="bg-light"> + <tr> + <th class="py-4 text-uppercase text-sm">Order #</th> + <th class="py-4 text-uppercase text-sm">Date</th> + <th class="py-4 text-uppercase text-sm">Total</th> + <th class="py-4 text-uppercase text-sm">Status</th> + <th class="py-4 text-uppercase text-sm">Action</th> + </tr> + </thead> + <tbody> + <tr> + <th class="py-4 align-middle">#12345</th> + <td class="py-4 align-middle">22/6/2017</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-light text-dark">Being prepared</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + <tr> + <th class="py-4 align-middle"># 1734</th> + <td class="py-4 align-middle">7/5/2017</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-warning text-dark">Action needed</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + <tr> + <th class="py-4 align-middle"># 1730</th> + <td class="py-4 align-middle">30/9/2016</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-success">Received</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + <tr> + <th class="py-4 align-middle"># 1705</th> + <td class="py-4 align-middle">22/6/2016</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-danger">Cancelled</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + </tbody> + </table> + </div> + </div> + </section> + <!-- Orders Section --> +</div> + +__BOTTOM__
\ No newline at end of file diff --git a/pages/member/order-detail.html b/pages/member/order-detail.html new file mode 100644 index 0000000..01d55cf --- /dev/null +++ b/pages/member/order-detail.html @@ -0,0 +1,156 @@ +@_TOP_@ +<!-- BEGIN CONTENT --> +<div class="container p-4"> + <!-- Hero Section--> + <div class="py-2"> + <h1>[L]Order #1234[/L]</h1> + [if session logged_in] + [else] + [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 --> + + <!-- Order Info --> + <div class="card card-sm"> + <div class="card-body bg-dark text-light"> + <div class="row"> + <div class="col-6 col-lg-6"> + + <!-- Heading --> + <h6 class="heading-xxxs text-muted">Waybill number:</h6> + + <!-- Text --> + <p class="mb-lg-0 font-size-sm font-weight-bold"> + 673290789 + </p> + + </div> + <div class="col-6 col-lg-6"> + + <!-- Heading --> + <h6 class="heading-xxxs text-muted">Shipped date:</h6> + + <!-- Text --> + <p class="mb-lg-0 font-size-sm font-weight-bold"> + <time datetime="2019-10-01"> + 01 Oct, 2019 + </time> + </p> + </div> + <div class="col-6 col-lg-6"> + + <!-- Heading --> + <h6 class="heading-xxxs text-muted">Status:</h6> + + <!-- Text --> + <span class="badge bg-warning"> + In Transit + </span> + </div> + <div class="col-6 col-lg-6"> + + <!-- Heading --> + <h6 class="heading-xxxs text-muted">Order Amount:</h6> + + <!-- Text --> + <p class="mb-0 font-size-sm font-weight-bold"> + $259.00 + </p> + </div> + </div> + </div> + </div> + <!-- Order Info --> + <!-- Tracking Info --> + <div class="card card-sm"> + <div class="card-body bg-light"> + <div class="row"> + <!-- Log lines --> + <!-- Status --> + <div class="col-6 col-lg-6"> + <span class="badge rounded-pill bg-secondary">Order created</span> + <p class="mb-lg-0 font-size-sm text-muted"> + Kamis, 3 Jun 2021 11:07 WIB + </p> + </div> + <!-- Comment --> + <div class="col-6 col-lg-6"> + <h6 class="heading-xxxs text-muted">Order created by buyer.</h6> + <p class="mb-lg-0 font-size-sm text-muted"> + Order created and waiting for payment + </p> + </div> + <!-- End of log lines --> + <!-- Log lines --> + <!-- Status --> + <div class="col-6 col-lg-6"> + <span class="badge rounded-pill bg-secondary">Order paid</span> + <p class="mb-lg-0 font-size-sm text-muted"> + Kamis, 3 Jun 2021 11:07 WIB + </p> + </div> + <!-- Comment --> + <div class="col-6 col-lg-6"> + <h6 class="heading-xxxs text-muted">Order paid by buyer.</h6> + <p class="mb-lg-0 font-size-sm text-muted"> + Payment completed and order is being prepared by seller. + </p> + </div> + <!-- End of log lines --> + <!-- Log lines --> + <!-- Status --> + <div class="col-6 col-lg-6"> + <span class="badge rounded-pill bg-secondary">Waiting to be shipped</span> + <p class="mb-lg-0 font-size-sm text-muted"> + Kamis, 3 Jun 2021 11:07 WIB + </p> + </div> + <!-- Comment --> + <div class="col-6 col-lg-6"> + <h6 class="heading-xxxs text-muted">Request to pick up</h6> + <p class="mb-lg-0 font-size-sm text-muted"> + Order is ready to be picked up by [courier name]. Order will be picked up before Sabtu, 3 Okt, pukul 08:50 + </p> + </div> + <!-- End of log lines --> + <!-- Log lines --> + <!-- Status --> + <div class="col-6 col-lg-6"> + <span class="badge rounded-pill bg-secondary">In transit</span> + <p class="mb-lg-0 font-size-sm text-muted"> + Kamis, 3 Jun 2021 11:07 WIB + </p> + </div> + <!-- Comment --> + <div class="col-6 col-lg-6"> + <h6 class="heading-xxxs text-muted">In transit</h6> + <p class="mb-lg-0 font-size-sm text-muted"> + Pesanan Anda dalam proses pengiriman oleh kurir. + </p> + </div> + <!-- End of log lines --> + <!-- Log lines --> + <!-- Status --> + <div class="col-6 col-lg-6"> + <span class="badge rounded-pill bg-secondary">In transit</span> + <p class="mb-lg-0 font-size-sm text-muted"> + Kamis, 3 Jun 2021 11:07 WIB + </p> + </div> + <!-- Comment --> + <div class="col-6 col-lg-6"> + <h6 class="heading-xxxs text-muted">In transit</h6> + <p class="mb-lg-0 font-size-sm text-muted"> + Pesanan Anda dalam proses pengiriman oleh kurir. + </p> + </div> + <!-- End of log lines --> + </div> + </div> + </div> + <!-- End Tracking Info --> +</div> +<!-- END CONTENT --> +__BOTTOM__
\ No newline at end of file diff --git a/pages/member/service.html b/pages/member/service.html new file mode 100644 index 0000000..3bd72d1 --- /dev/null +++ b/pages/member/service.html @@ -0,0 +1,65 @@ +@_TOP_@ +<!-- BEGIN CONTENT --> +<div class="container p-4"> + <!-- Hero Section--> + <div class="py-2"> + <h1>[L]Your Account[/L]</h1> + [if session logged_in] + [edisplay show_label=1 show_var=0 keep=1] + </div> + <!-- End Hero section--> + <!-- Orders Section--> + <section> + <div class="block-header"> + <h4 class="d-flex justify-content-between">Orders</h4> + </div> + <div class="container"> + <div> + <table class="table table-borderless table-hover table-responsive-md"> + <thead class="bg-light"> + <tr> + <th class="py-4 text-uppercase text-sm">Order #</th> + <th class="py-4 text-uppercase text-sm">Date</th> + <th class="py-4 text-uppercase text-sm">Total</th> + <th class="py-4 text-uppercase text-sm">Status</th> + <th class="py-4 text-uppercase text-sm">Action</th> + </tr> + </thead> + <tbody> + <tr> + <th class="py-4 align-middle">#12345</th> + <td class="py-4 align-middle">22/6/2017</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-light text-dark">Being prepared</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + <tr> + <th class="py-4 align-middle"># 1734</th> + <td class="py-4 align-middle">7/5/2017</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-warning text-dark">Action needed</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + <tr> + <th class="py-4 align-middle"># 1730</th> + <td class="py-4 align-middle">30/9/2016</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-success">Received</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + <tr> + <th class="py-4 align-middle"># 1705</th> + <td class="py-4 align-middle">22/6/2016</td> + <td class="py-4 align-middle">Rp150.000,00</td> + <td class="py-4 align-middle"><span class="badge p-2 text-uppercase bg-danger">Cancelled</span></td> + <td class="py-4 align-middle"><a class="btn btn-outline-dark btn-sm" href="customer-order.html">View</a></td> + </tr> + </tbody> + </table> + </div> + </div> + </section> + <!-- Orders Section --> +</div> + +__BOTTOM__
\ No newline at end of file diff --git a/pages/ord/checkout.html b/pages/ord/checkout.html index 247c28a..ca18e66 100644 --- a/pages/ord/checkout.html +++ b/pages/ord/checkout.html @@ -70,7 +70,11 @@ <div class="block-header"> <h4 class="d-flex justify-content-between align-items-center">Shipping</h4> </div> - [include include/checkout/shipping_address] + <div class="container my-4"> + <div class="block-body"> + [include include/checkout/shipping_address] + </div> + </div> </div> <!-- End of Shipping Address --> <!-- Billing Address --> @@ -83,39 +87,53 @@ <!-- Delivery option--> <div class="container my-4"> <div class="block-body"> - <div class="row"> - <div class="form-group col-md-6 d-flex align-items-center"> - [shipping widget="radio" extra='id="ship_widget" onchange="this.form.submit()"'] - <label class="ml-3" for="ship_widget"> - <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 class="form-group form-floating"> + [pikul widget="select" extra='id="ship_widget" aria-label= "Shipping method" class="form-control form-select" onchange="this.form.submit()"'] + <label for="ship_widget">Shipping method</label> </div> + <!-- Shipping duration --> + <!--div class="form-floating"> + <select class="form-select mb-3" aria-label="Shipping duration" id="shippingDurationSelect"> + <option selected value="1">Next Day (1 hari)</option> + <option value="2">Reguler (2-3 hari)</option> + <option value="3">Kargo (2-4 hari)</option> + </select> + <label for="shippingDurationSelect">Shipping duration</label> + </div--> + <!-- Shipping duration --> + <!-- Shipping provider --> + <!--div class="form-floating"> + <select class="form-select mb-3" aria-label="Shipping provider" id="shippingProviderSelect"> + <option selected value="1">AnterAja</option> + <option value="2">Sicepat</option> + <option value="3">JNE</option> + </select> + <label for="shippingProviderSelect">Shipping provider</label> + </div--> + <!-- Shipping provider --> </div> </div> <!-- End of delivery option --> </div> <!-- End of Delivery Method --> <!-- Payment Method --> - <div> + <div class="container my-4"> <div class="block-header"> <h4 class="d-flex justify-content-between align-items-center">Payment method</h4> </div> - <div class="block-body"> - <!-- 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="bank_transfer" 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 __BANK__ __BANK_ACCOUNT_NUMBER__ a/n __BANK_ACCOUNT_HOLDER_NAME__.[/L]</span> - </label> + <div class="container my-4"> + <div class="block-body"> + <!-- Payment Option--> + <div class="form-group form-floating"> + <select class="form-select" id="payment-method-1" aria-label="Payment method" name="mv_order_profile"> + <option selected value="bank_transfer">Manual Bank Transfer</option> + <option value="QRIS">QRIS</option> + <option value="COD">Cash on delivery</option> + </select> + <label for="payment-method-1">Payment method</label> </div> + <!-- /Payment Option--> </div> - <!-- /Payment Option--> </div> </div> <!-- End of Payment Method --> |