Skip to content

Commit 7bd30d7

Browse files
author
Leonix
committed
shop themes:
* “Back to shopping” link added to the in-cart checkout page. * Fixed empty shopping cart icon in Internet Explorer 11.
1 parent 9d83f39 commit 7bd30d7

File tree

23 files changed

+206
-68
lines changed

23 files changed

+206
-68
lines changed

themes/clear/cart.html

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ <h1>[`Shopping cart`]</h1>
1414
-->
1515

1616
<div class="content right">
17-
17+
1818
<form method="post">
19-
19+
2020
<div class="float-right mobile-only block">
2121
<input name="checkout" type="submit" value="[`Proceed to checkout`]" class="button large">
2222
</div>
23-
23+
2424
<h1>[`Shopping cart`]</h1>
25-
25+
2626
<!-- sixteen-column cart layout -->
2727
<div class="cart">
28-
28+
2929
{foreach $cart.items as $item}
30-
30+
3131
<!-- cart item -->
32-
<div class="row" data-id="{$item.id}">
32+
<div class="row" data-id="{$item.id}">
3333
<div class="col w1 item-thumb"><a href="{$wa->shop->productUrl($item.product)}" title="{$item.product.name|escape}">{$wa->shop->productImgHtml($item.product, '48x48', ['default' => "`$wa_theme_url`img/dummy48.png"])}</a>&nbsp;</div>
3434
<div class="col w9 item-name">
3535
<a href="{$wa->shop->productUrl($item.product)}" class="bold">{$item.product.name|escape}</a>
3636
{if isset($item.sku_name) && strlen($item.sku_name) && $item.sku_name != $item.product.name}{$item.sku_name|escape}{/if}
3737
</div>
3838
<div class="col w2 item-qty align-center nowrap"><span class="gray">&times;</span> <input type="text" name="quantity[{$item.id}]" value="{$item.quantity}" class="qty{if !empty($item.error)} error{/if}"></div>
39-
<div class="col w1 item-remove"><a class="delete" href="#" title="[`Remove from cart`]"><i class="icon16 remove"></i></a></div>
39+
<div class="col w1 item-remove"><a class="delete" href="#" title="[`Remove from cart`]"><i class="icon16 remove"></i></a></div>
4040
<div class="col w3 align-center item-total nowrap">{shop_currency_html($item.full_price, true)}</div>
4141

4242
{if !empty($item.services)}
@@ -81,14 +81,18 @@ <h4>{sprintf('[`Customers who bought %s also bought`]', $item.product.name|escap
8181
</div>
8282
{if !empty($item.error)}<script>alert({json_encode($item.error)});</script>{/if}
8383
{/foreach}
84-
84+
8585
<!-- discount coupon -->
8686
<div class="row no-border" {if !shopDiscounts::isEnabled('coupons') && !$discount}style="display:none"{/if}>
8787
<div class="col w10 cart-coupon no-border">
8888
{if shopDiscounts::isEnabled('coupons')}
8989
[`Discount coupon (if you have one)`]:
9090
<input type="text" name="coupon_code" value="{$coupon_code|escape}"> <input type="submit" value="[`Apply`]">
9191
{/if}
92+
93+
{if $coupon_code && empty($coupon_discount) && empty($coupon_free_shipping)}
94+
<div class="error-message">[`Invalid coupon code`]</div>
95+
{/if}
9296
</div>
9397
<div class="col w2 align-center">[`Discount`]</div>
9498
<div class="col w3 align-center cart-discount nowrap">&minus; {shop_currency_html($discount, true)}</div>
@@ -110,14 +114,14 @@ <h4>{sprintf('[`Customers who bought %s also bought`]', $item.product.name|escap
110114
<div class="col w1">&nbsp;</div>
111115
</div>
112116
{/if}
113-
117+
114118
<!-- TOTAL -->
115119
<div class="row large no-border">
116120
<div class="col w12 no-border non-mobile-only">[`Total`]</div>
117121
<div class="col w3 cart-total align-center total bold nowrap">{shop_currency_html($cart.total, true)}</div>
118122
<div class="col w1">&nbsp;</div>
119123
</div>
120-
124+
121125
<!-- checkout -->
122126
<div class="row no-border">
123127
<div class="col w12 no-border non-mobile-only">
@@ -131,17 +135,17 @@ <h4>{sprintf('[`Customers who bought %s also bought`]', $item.product.name|escap
131135
</div>
132136
<div class="col w1">&nbsp;</div>
133137
</div>
134-
135-
136-
138+
139+
140+
137141
</div>
138142

139143
<!-- plugin hook: 'frontend_cart' -->
140144
{* @event frontend_cart.%plugin_id% *}
141-
{foreach $frontend_cart as $_}{$_}{/foreach}
145+
{foreach $frontend_cart as $_}{$_}{/foreach}
142146

143147
</form>
144-
148+
145149
</div>
146150

147151
{/if}

themes/clear/css/clear.shop.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.error-message {
2+
color: #f00;
3+
}
14
.sidebar {
25
padding-top: 15px;
36
}

themes/clear/css/order.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ input[type="submit"] {
157157
border-radius: 5px;
158158
background: #fff;
159159
}
160+
.s-checkout-order-page .s-back-link {
161+
text-align: right;
162+
}
163+
.s-checkout-order-page .s-order-section > .s-section-footer {
164+
padding: 18px 20px 17px 20px;
165+
}
160166
.s-checkout-order-page .s-order-section > .s-section-header {
161167
border: solid #ccc;
162168
border-width: 1px 1px 0;

themes/clear/order.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#cart { display: none; }
55
.s-cart-empty-wrapper { padding: 100px 0; text-align: center; }
66
.s-cart-empty-wrapper .s-image-wrapper { margin: 0 0 20px; }
7-
.s-cart-empty-wrapper .s-image-wrapper img { vertical-align: top; width: 100%; max-height: 160px; }
7+
.s-cart-empty-wrapper .s-image-wrapper img { vertical-align: top; max-width: 100%; max-height: 160px; }
88
.s-cart-empty-wrapper .s-description { margin: 20px 0 0; }
99
.s-cart-empty-wrapper .s-actions-wrapper { margin: 30px 0 0; color: #006bd8; }
1010
</style>
@@ -42,6 +42,22 @@ <h2 class="s-header">{$config.cart.block_name|default:"[`Shopping cart`]"|escape
4242
"wrapper" => "#js-order-cart"
4343
])}
4444
</div>
45+
<div class="s-section-footer">
46+
<div class="s-back-link">
47+
{$_url = $wa->getUrl('shop/frontend/')}
48+
{$_refer_url = waRequest::server('HTTP_REFERER')}
49+
{if !empty($_refer_url)}
50+
{$_refer_host = $_refer_url|parse_url:$smarty.const.PHP_URL_HOST}
51+
{$_current_url = $wa->currentUrl(true)}
52+
{$_current_host = $_current_url|parse_url:$smarty.const.PHP_URL_HOST}
53+
54+
{if $_refer_host === $_current_host}
55+
{$_url = $_refer_url}
56+
{/if}
57+
{/if}
58+
<a href="{$_url|escape}">&larr; [`Back to shopping`]</a>
59+
</div>
60+
</div>
4561
</section>
4662

4763
</div>

themes/clear/theme.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE theme PUBLIC "wa-app-theme" "http://www.webasyst.com/wa-content/xml/wa-app-theme.dtd">
3-
<theme id="clear" system="0" vendor="webasyst" author="Webasyst" app="shop" parent_theme_id="site:clear" version="1.2.0">
3+
<theme id="clear" system="0" vendor="webasyst" author="Webasyst" app="shop" parent_theme_id="site:clear" version="1.2.1">
44
<name locale="en_US">Clear</name>
55
<name locale="ru_RU">Clear</name>
66
<files>

themes/custom/cart.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ <h3>[`Better together`]</h3>
1919

2020
<!-- general welcome text -->
2121
<div class="content right300px">
22-
22+
2323
<h1>[`Shopping cart`]</h1>
24-
24+
2525
<form method="post">
2626
<table class="table cart">
2727
<!-- products -->
@@ -59,14 +59,18 @@ <h1>[`Shopping cart`]</h1>
5959
<td><a class="delete" href="#" title="[`Remove from cart`]"><i class="icon16 remove"></i></a></td>
6060
</tr>
6161
{/foreach}
62-
62+
6363
<!-- discount coupon -->
6464
<tr class="no-border" {if !shopDiscounts::isEnabled('coupons') && !$discount}style="display:none"{/if}>
6565
<td colspan="2" class="no-border">
6666
{if shopDiscounts::isEnabled('coupons')}
6767
[`Discount coupon (if you have one)`]:
6868
<input type="text" name="coupon_code" value="{$coupon_code|escape}"> <input type="submit" value="[`Apply`]">
6969
{/if}
70+
71+
{if $coupon_code && empty($coupon_discount) && empty($coupon_free_shipping)}
72+
<div class="error-message">[`Invalid coupon code`]</div>
73+
{/if}
7074
</td>
7175
<td class="align-center">[`Discount`]</td>
7276
<td class="align-center cart-discount nowrap">&minus; {shop_currency_html($discount, true)}</td>
@@ -88,14 +92,14 @@ <h1>[`Shopping cart`]</h1>
8892
<td>&nbsp;</td>
8993
</tr>
9094
{/if}
91-
95+
9296
<!-- TOTAL -->
9397
<tr class="large no-border">
9498
<td colspan="3">[`Total`]</td>
9599
<td class="cart-total align-center total bold nowrap">{shop_currency_html($cart.total, true)}</td>
96100
<td>&nbsp;</td>
97101
</tr>
98-
102+
99103
<!-- checkout -->
100104
<tr class="no-border">
101105
<td colspan="3">
@@ -109,17 +113,17 @@ <h1>[`Shopping cart`]</h1>
109113
</td>
110114
<td>&nbsp;</td>
111115
</tr>
112-
113-
114-
116+
117+
118+
115119
</table>
116120

117121
<!-- plugin hook: 'frontend_cart' -->
118122
{* @event frontend_cart.%plugin_id% *}
119-
{foreach $frontend_cart as $_}{$_}{/foreach}
123+
{foreach $frontend_cart as $_}{$_}{/foreach}
120124

121125
</form>
122-
126+
123127
</div>
124128

125129
{/if}

themes/custom/css/custom.shop.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.error-message {
2+
color: #f00;
3+
}
14
.sidebar {
25
padding-top: 44px;
36
}

themes/custom/css/order.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ input[type="submit"] {
157157
border-radius: 5px;
158158
background: #fff;
159159
}
160+
.s-checkout-order-page .s-back-link {
161+
text-align: right;
162+
}
163+
.s-checkout-order-page .s-order-section > .s-section-footer {
164+
padding: 18px 20px 17px 20px;
165+
}
160166
.s-checkout-order-page .s-order-section > .s-section-header {
161167
border: solid #ccc;
162168
border-width: 1px 1px 0;

themes/custom/order.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#cart { display: none; }
55
.s-cart-empty-wrapper { padding: 100px 0; text-align: center; }
66
.s-cart-empty-wrapper .s-image-wrapper { margin: 0 0 20px; }
7-
.s-cart-empty-wrapper .s-image-wrapper img { vertical-align: top; width: 100%; max-height: 160px; }
7+
.s-cart-empty-wrapper .s-image-wrapper img { vertical-align: top; max-width: 100%; max-height: 160px; }
88
.s-cart-empty-wrapper .s-description { margin: 20px 0 0; }
99
.s-cart-empty-wrapper .s-actions-wrapper { margin: 30px 0 0; color: #006bd8; }
1010
</style>
@@ -42,6 +42,22 @@ <h2 class="s-header">{$config.cart.block_name|default:"[`Shopping cart`]"|escape
4242
"wrapper" => "#js-order-cart"
4343
])}
4444
</div>
45+
<div class="s-section-footer">
46+
<div class="s-back-link">
47+
{$_url = $wa->getUrl('shop/frontend/')}
48+
{$_refer_url = waRequest::server('HTTP_REFERER')}
49+
{if !empty($_refer_url)}
50+
{$_refer_host = $_refer_url|parse_url:$smarty.const.PHP_URL_HOST}
51+
{$_current_url = $wa->currentUrl(true)}
52+
{$_current_host = $_current_url|parse_url:$smarty.const.PHP_URL_HOST}
53+
54+
{if $_refer_host === $_current_host}
55+
{$_url = $_refer_url}
56+
{/if}
57+
{/if}
58+
<a href="{$_url|escape}">&larr; [`Back to shopping`]</a>
59+
</div>
60+
</div>
4561
</section>
4662

4763
</div>

themes/custom/theme.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE theme PUBLIC "wa-app-theme" "http://www.webasyst.com/wa-content/xml/wa-app-theme.dtd">
3-
<theme id="custom" system="0" vendor="webasyst" author="Webasyst" app="shop" parent_theme_id="site:custom" version="1.2.0">
3+
<theme id="custom" system="0" vendor="webasyst" author="Webasyst" app="shop" parent_theme_id="site:custom" version="1.2.1">
44
<name locale="en_US">CUSTOM</name>
55
<name locale="ru_RU">CUSTOM</name>
66
<files>

0 commit comments

Comments
 (0)