This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added order totals info to the thank-you page (VirtoCommerce/vc-platf…
- Loading branch information
1 parent
e48b6ef
commit 27ac950
Showing
4 changed files
with
136 additions
and
40 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
VirtoCommerce.Storefront/App_Data/Themes/default/assets/js/order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var storefrontApp = angular.module('storefrontApp'); | ||
storefrontApp.controller('orderController', ['$scope', '$window', 'orderService', function ($scope, $window, orderService) { | ||
getOrder($window.orderNumber); | ||
|
||
function getOrder(orderNumber) { | ||
orderService.getOrder(orderNumber).then(function (response) { | ||
if (response && response.data) { | ||
$scope.order = response.data; | ||
} | ||
}); | ||
} | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 115 additions & 40 deletions
155
VirtoCommerce.Storefront/App_Data/Themes/default/templates/thanks.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,116 @@ | ||
<h1>Thank you!</h1> | ||
<h4>{{ 'customer.order.title' | t: name: order.name }}</h4> | ||
<table class="full"> | ||
<thead> | ||
<tr> | ||
<th>{{ 'customer.order.product' | t }}</th> | ||
<th>{{ 'customer.order.sku' | t }}</th> | ||
<th>{{ 'customer.order.price' | t }}</th> | ||
<th class="text-center">{{ 'customer.order.quantity' | t }}</th> | ||
<th class="text-right">{{ 'customer.order.total' | t }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for line_item in order.line_items %} | ||
<tr id="{{ line_item.id }}"> | ||
<td> | ||
{{ line_item.title | link_to: line_item.product.url }} | ||
{% if line_item.fulfillment %} | ||
<div class="note"> | ||
{% assign date = line_item.fulfillment.created_at | date: format: 'month_day_year' %} | ||
{{ 'customer.order.fulfilled_on' | t: date: date }} | ||
{% if line_item.fulfillment.tracking_number %} | ||
<a href="{{ line_item.fulfillment.tracking_url }}">{{ line_item.fulfillment.tracking_company }} #{{ line_item.fulfillment.tracking_number}}</a> | ||
{% endif %} | ||
</div> | ||
<div ng-controller="orderController"> | ||
<h4>{{ 'customer.order.title' | t: name: order.name }}</h4> | ||
<table class="full"> | ||
<thead> | ||
<tr> | ||
<th>{{ 'customer.order.product' | t }}</th> | ||
<th>{{ 'customer.order.sku' | t }}</th> | ||
<th>{{ 'customer.order.price' | t }}</th> | ||
<th class="text-center">{{ 'customer.order.quantity' | t }}</th> | ||
<th class="text-right">{{ 'customer.order.total' | t }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr ng-repeat="lineItem in order.items"> | ||
<td> | ||
<a ng-href="{% raw %}{{ 'product/' + lineItem.productId }}{% endraw %}" ng-bind="lineItem.name"></a> | ||
<div class="note" ng-if="lineItem.fulfillment" ng-cloak> | ||
{% assign date = line_item.fulfillment.created_at | date: format: 'month_day_year' %} | ||
{{ 'customer.order.fulfilled_on' | t: date: date }} | ||
{% if line_item.fulfillment.tracking_number %} | ||
<a href="{{ line_item.fulfillment.tracking_url }}">{{ line_item.fulfillment.tracking_company }} #{{ line_item.fulfillment.tracking_number}}</a> | ||
{% endif %} | ||
</div> | ||
</td> | ||
<td ng-bind="lineItem.sku"></td> | ||
{% if settings.show_prices_with_taxes %} | ||
<td class="text-center"> | ||
<span ng-bind="lineItem.placedPriceWithTax.formattedAmount"></span><br /> | ||
<span style="color: #ccc; text-decoration: line-through;" ng-bind="lineItem.listPriceWithTax.formattedAmount"></span> | ||
</td> | ||
<td class="text-center" ng-bind="lineItem.quantity"></td> | ||
<td class="text-center"> | ||
<span ng-bind="lineItem.extendedPriceWithTax.formattedAmount"></span> | ||
</td> | ||
{% else %} | ||
<td class="text-center"> | ||
<span ng-bind="lineItem.placedPrice.formattedAmount"></span><br /> | ||
<span style="color: #ccc; text-decoration: line-through;" ng-bind="lineItem.listPrice.formattedAmount"></span> | ||
</td> | ||
<td class="text-center" ng-bind="lineItem.quantity"></td> | ||
<td class="text-center"> | ||
<span ng-bind="lineItem.extendedPrice.formattedAmount"></span> | ||
</td> | ||
{% endif %} | ||
</td> | ||
<td>{{ line_item.sku }}</td> | ||
{% if settings.show_prices_with_taxes %} | ||
<td>{{ line_item.price_with_tax | money }}</td> | ||
<td class="text-center">{{ line_item.quantity }}</td> | ||
<td class="text-right">{{ line_item.line_price_with_tax | money }}</td> | ||
{% else %} | ||
<td>{{ line_item.price | money }}</td> | ||
<td class="text-center">{{ line_item.quantity }}</td> | ||
<td class="text-right">{{ line_item.line_price | money }}</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<hr /> | ||
<div class="grid"> | ||
{% if settings.show_prices_with_taxes %} | ||
<div class="grid-item large--two-thirds"> </div> | ||
<div class="grid-item large--one-third text-right"> | ||
{{ 'checkout.subtotalWithTax' | t }} | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.subTotalWithTax.formattedAmount"></small> | ||
</span> | ||
</div> | ||
<div class="grid-item large--two-thirds"> </div> | ||
<div class="grid-item large--one-third text-right"> | ||
{{ 'checkout.shippingWithTax' | t }} | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.shippingTotalWithTax.formattedAmount"></small> | ||
</span> | ||
</div> | ||
<div class="grid-item large--two-thirds"> </div> | ||
<div class="grid-item large--one-third text-right"> | ||
{{ 'checkout.discount' | t }} | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.discountTotalWithTax.formattedAmount"></small> | ||
</span> | ||
</div> | ||
{% else %} | ||
<div class="grid-item large--two-thirds"> </div> | ||
<div class="grid-item large--one-third text-right"> | ||
{{ 'checkout.subtotal' | t }} | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.subTotal.formattedAmount"></small> | ||
</span> | ||
</div> | ||
<div class="grid-item large--two-thirds"> </div> | ||
<div class="grid-item large--one-third text-right"> | ||
{{ 'checkout.shipping' | t }} | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.shippingTotal.formattedAmount"></small> | ||
</span> | ||
</div> | ||
<div class="grid-item large--two-thirds"> </div> | ||
<div class="grid-item large--one-third text-right"> | ||
{{ 'checkout.discount' | t }} | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.discountTotal.formattedAmount"></small> | ||
</span> | ||
</div> | ||
{% endif %} | ||
<div class="grid-item large--two-thirds"> </div> | ||
<div class="grid-item large--one-third text-right"> | ||
Tax total | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.taxTotal.formattedAmount"></small> | ||
</span> | ||
</div> | ||
</div> | ||
<hr /> | ||
<div class="grid"> | ||
<div class="grid-item text-right"> | ||
<strong>Total</strong> | ||
<span class="h1 cart-subtotal--price"> | ||
<small ng-bind="order.total.formattedAmount"></small> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
window.orderNumber = '{{ order.name }}'; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters