Browse Source

Layout fixes, fix old price position

Vova Tkach 5 years ago
parent
commit
fc2ab85cc3

+ 1 - 1
assets/template/shop_category_html_file.go

@@ -31,7 +31,7 @@ var VarShopCategoryHtmlFile = []byte(`{{template "header.html" .}}
 						{{if le .Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}
 						<a href="{{.Permalink}}" class="btn btn-success">View</a>
 						<span class="price{{if gt .PriceOld 0.00}} price_red{{end}}">{{.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</span>
-						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{end}}
+						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{else}}<span class="price price_old">&nbsp;</span>{{end}}
 					</div>
 				</div>
 			{{end}}

+ 1 - 1
assets/template/shop_html_file.go

@@ -31,7 +31,7 @@ var VarShopHtmlFile = []byte(`{{template "header.html" .}}
 						{{if le .Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}
 						<a href="{{.Permalink}}" class="btn btn-success">View</a>
 						<span class="price{{if gt .PriceOld 0.00}} price_red{{end}}">{{.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</span>
-						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{end}}
+						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{else}}<span class="price price_old">&nbsp;</span>{{end}}
 					</div>
 				</div>
 			{{end}}

+ 2 - 2
assets/template/shop_product_html_file.go

@@ -56,7 +56,7 @@ var VarShopProductHtmlFile = []byte(`{{template "header.html" .}}
 						{{end}}
 						<div class="card mt-3{{if not $.Data.Shop.Product.HaveVariations}} mt-sm-3 mt-md-0 mt-lg-0{{end}}">
 							<div class="card-body">
-								<h3>{{if le $.Data.Shop.Product.Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}</h3>
+								{{if le $.Data.Shop.Product.Quantity 0}}<h3><span class="badge badge-primary">Out of stock</span></h3>{{end}}
 								{{if gt $.Data.Shop.Product.PriceOld 0.00}}<h3 class="price_old mb-0 mr-4"><strike>{{$.Data.Shop.Product.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></h3>{{end}}
 								<h3 class="price{{if gt $.Data.Shop.Product.PriceOld 0.00}} price_red{{end}} mb-0 mr-4">{{$.Data.Shop.Product.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</h3><button class="btn btn-success btn-buy" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{$.Data.Shop.Product.Id}});return false;"{{if le $.Data.Shop.Product.Quantity 0}} disabled{{end}}>Buy</button>
 							</div>
@@ -126,7 +126,7 @@ var VarShopProductHtmlFile = []byte(`{{template "header.html" .}}
 							</div>
 							<div class="card mt-3">
 								<div class="card-body">
-									<h3>{{if le $.Data.Shop.Product.Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}</h3>
+									{{if le $.Data.Shop.Product.Quantity 0}}<h3><span class="badge badge-primary">Out of stock</span></h3>{{end}}
 									{{if gt $.Data.Shop.Product.PriceOld 0.00}}<h3 class="price_old mb-0 mr-4"><strike>{{$.Data.Shop.Product.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></h3>{{end}}
 									<h3 class="price{{if gt $.Data.Shop.Product.PriceOld 0.00}} price_red{{end}} mb-0 mr-4">{{$.Data.Shop.Product.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</h3><button class="btn btn-success btn-buy" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{$.Data.Shop.Product.Id}});return false;"{{if le $.Data.Shop.Product.Quantity 0}} disabled{{end}}>Buy</button>
 								</div>

+ 1 - 1
hosts/localhost/template/shop-category.html

@@ -29,7 +29,7 @@
 						{{if le .Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}
 						<a href="{{.Permalink}}" class="btn btn-success">View</a>
 						<span class="price{{if gt .PriceOld 0.00}} price_red{{end}}">{{.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</span>
-						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{end}}
+						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{else}}<span class="price price_old">&nbsp;</span>{{end}}
 					</div>
 				</div>
 			{{end}}

+ 2 - 2
hosts/localhost/template/shop-product.html

@@ -54,7 +54,7 @@
 						{{end}}
 						<div class="card mt-3{{if not $.Data.Shop.Product.HaveVariations}} mt-sm-3 mt-md-0 mt-lg-0{{end}}">
 							<div class="card-body">
-								<h3>{{if le $.Data.Shop.Product.Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}</h3>
+								{{if le $.Data.Shop.Product.Quantity 0}}<h3><span class="badge badge-primary">Out of stock</span></h3>{{end}}
 								{{if gt $.Data.Shop.Product.PriceOld 0.00}}<h3 class="price_old mb-0 mr-4"><strike>{{$.Data.Shop.Product.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></h3>{{end}}
 								<h3 class="price{{if gt $.Data.Shop.Product.PriceOld 0.00}} price_red{{end}} mb-0 mr-4">{{$.Data.Shop.Product.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</h3><button class="btn btn-success btn-buy" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{$.Data.Shop.Product.Id}});return false;"{{if le $.Data.Shop.Product.Quantity 0}} disabled{{end}}>Buy</button>
 							</div>
@@ -124,7 +124,7 @@
 							</div>
 							<div class="card mt-3">
 								<div class="card-body">
-									<h3>{{if le $.Data.Shop.Product.Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}</h3>
+									{{if le $.Data.Shop.Product.Quantity 0}}<h3><span class="badge badge-primary">Out of stock</span></h3>{{end}}
 									{{if gt $.Data.Shop.Product.PriceOld 0.00}}<h3 class="price_old mb-0 mr-4"><strike>{{$.Data.Shop.Product.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></h3>{{end}}
 									<h3 class="price{{if gt $.Data.Shop.Product.PriceOld 0.00}} price_red{{end}} mb-0 mr-4">{{$.Data.Shop.Product.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</h3><button class="btn btn-success btn-buy" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{$.Data.Shop.Product.Id}});return false;"{{if le $.Data.Shop.Product.Quantity 0}} disabled{{end}}>Buy</button>
 								</div>

+ 1 - 1
hosts/localhost/template/shop.html

@@ -29,7 +29,7 @@
 						{{if le .Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}
 						<a href="{{.Permalink}}" class="btn btn-success">View</a>
 						<span class="price{{if gt .PriceOld 0.00}} price_red{{end}}">{{.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</span>
-						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{end}}
+						{{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{else}}<span class="price price_old">&nbsp;</span>{{end}}
 					</div>
 				</div>
 			{{end}}