Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/themefisher/Hargo-hugo-ecommerce-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbartmika <bart@mikasoftware.com>2020-09-24 20:54:14 +0300
committerbartmika <bart@mikasoftware.com>2020-09-24 20:54:14 +0300
commit90b411c3bf3a00f63371af15a699221145d5c50b (patch)
treeef848a47b5645cf23f3c1d4d5cde070ddaf1b4c5 /layouts
parent1dd433f4b8af583e9cb2f3f1cc70f6aa19bc9d1b (diff)
(1) Upgraded `snipcart` to version 3.0.21 (2) Fixed bug with dollar sign `$` causing error on submission with snipcart v3 (3) Made the dollar sign `$` in front of the number instead of the side of the number (4) Made the snipcart public api key settable from the `config.toml` file, previously it was hard-coded (4) Fixed issue with `description` not showing up when adding a product to cart in snipcart.
Diffstat (limited to 'layouts')
-rw-r--r--layouts/index.html8
-rw-r--r--layouts/partials/footer.html10
-rw-r--r--layouts/partials/head.html7
-rw-r--r--layouts/products/list.html8
-rw-r--r--layouts/products/single.html8
5 files changed, 23 insertions, 18 deletions
diff --git a/layouts/index.html b/layouts/index.html
index e3c719f..5c9c873 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -178,12 +178,12 @@
<a href="{{ .Permalink }}" class="h4">{{ .Title }}</a>
<p>{{ .Params.Description }}</p>
<div class="mb-4">
- <span class="lead text-primary">{{ .Params.Price }}</span>
- <s>{{ .Params.PriceBefore }}</s>
+ <span class="lead text-primary">${{ .Params.Price }}</span>
+ <s>${{ .Params.PriceBefore }}</s>
</div>
<button class="snipcart-add-item btn btn-sm btn-outline-primary" data-item-id="{{ .Params.ProductID }}"
data-item-name="{{ .Title }}" {{ range first 1 .Params.Images }} data-item-image="{{ .image | absURL }}"
- {{ end }} data-item-price="{{ .Params.Price }}" data-item-url="{{ .Permalink }}">
+ {{ end }} data-item-price="{{ .Params.Price }}" data-item-url="{{ .Permalink }}" data-item-description="{{ .Description }}">
Add to cart
</button>
</div>
@@ -237,4 +237,4 @@
{{ partial "cta.html" . }}
{{ end }}
-{{ end }} \ No newline at end of file
+{{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index ae6e433..3e116d7 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -57,13 +57,15 @@
{{ end }}
<!-- snipcart -->
-<script type="text/javascript" id="snipcart" src="https://cdn.snipcart.com/scripts/2.0/snipcart.js"
- data-api-key="M2E5YjA3NjMtYzRiYS00YzVjLWEyYWYtNDY5ZDI0OWZhYjg5"></script>
+{{ with site.Params.snipcartApiKey }}
+<script type="text/javascript" id="snipcart" src="https://cdn.snipcart.com/themes/v3.0.21/default/snipcart.js"
+ data-api-key="{{ site.Params.snipcartApiKey }}"></script>
<script>
Snipcart.execute('registerLocale', 'en', {
- powered_by: "Themefisher"
+ powered_by: "Enlazaa"
});
</script>
+{{ end }}
{{ "<!-- Main Script -->" | safeHTML }}
{{ $script := resources.Get "js/script.js" | minify}}
@@ -127,4 +129,4 @@
s.parentNode.insertBefore(rw, s);
}(document, new Date(), "script", "rating-widget.com/"));
</script>
-{{ end }} \ No newline at end of file
+{{ end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 92d25b9..551cc54 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -12,7 +12,10 @@
{{ range site.Params.plugins.css }}
<link rel="stylesheet" href="{{ .link | absURL }}">
{{ end }}
- <link id="snipcart-theme" type="text/css" href="https://cdn.snipcart.com/themes/2.0/base/snipcart.min.css" rel="stylesheet">
+ <link rel="preconnect" href="https://app.snipcart.com">
+ <link rel="preconnect" href="https://cdn.snipcart.com">
+ <link id="snipcart-theme" type="text/css" href="https://cdn.snipcart.com/themes/v3.0.21/default/snipcart.css" rel="stylesheet">
+ <script async src="https://cdn.snipcart.com/themes/v3.0.21/default/snipcart.js"></script>
{{ "<!-- Main Stylesheet -->" | safeHTML }}
{{ $styles := resources.Get "scss/style.scss" | toCSS | minify }}
@@ -22,4 +25,4 @@
<link rel="shortcut icon" href="{{ `images/favicon.png` | absURL }} " type="image/x-icon">
<link rel="icon" href="{{ `images/favicon.png` | absURL }} " type="image/x-icon">
-</head> \ No newline at end of file
+</head>
diff --git a/layouts/products/list.html b/layouts/products/list.html
index 9409d79..586d894 100644
--- a/layouts/products/list.html
+++ b/layouts/products/list.html
@@ -17,12 +17,12 @@
<a href="{{ .Permalink }}" class="h4">{{ .Title }}</a>
<p>{{ .Params.Description }}</p>
<div class="mb-4">
- <span class="lead text-primary">{{ .Params.Price }}</span>
- <s>{{ .Params.PriceBefore }}</s>
+ <span class="lead text-primary">${{ .Params.Price }}</span>
+ <s>${{ .Params.PriceBefore }}</s>
</div>
<button class="snipcart-add-item btn btn-sm btn-outline-primary" data-item-id="{{ .Params.ProductID }}"
data-item-name="{{ .Title }}" {{ range first 1 .Params.Images }} data-item-image="{{ .image | absURL }}"
- {{ end }} data-item-price="{{ .Params.Price }}" data-item-url="{{ .Permalink }}">
+ {{ end }} data-item-price="{{ .Params.Price }}" data-item-url="{{ .Permalink }}" data-item-description="{{ .Description }}">
Add to cart
</button>
</div>
@@ -35,4 +35,4 @@
{{ partial "cta.html" . }}
-{{ end }} \ No newline at end of file
+{{ end }}
diff --git a/layouts/products/single.html b/layouts/products/single.html
index 95d64eb..745070c 100644
--- a/layouts/products/single.html
+++ b/layouts/products/single.html
@@ -22,14 +22,14 @@
<div class="rw-ui-container"></div>
{{ end }}
<div class="my-4">
- <span class="lead text-primary font-weight-medium">{{ .Params.Price }}</span>
- <s>{{ .Params.PriceBefore }}</s>
+ <span class="lead text-primary font-weight-medium">${{ .Params.Price }}</span>
+ <s>${{ .Params.PriceBefore }}</s>
</div>
<h5>Short Description</h5>
<p>{{ .Params.ShortDescription | markdownify }}</p>
<button class="snipcart-add-item btn btn-primary" data-item-id="{{ .Params.ProductID }}"
data-item-name="{{ .Title }}" {{ range first 1 .Params.Images }} data-item-image="{{ .image | absURL }}"
- {{ end }} data-item-price="{{ .Params.Price }}" data-item-url="{{ .Permalink }}">
+ {{ end }} data-item-price="{{ .Params.Price }}" data-item-url="{{ .Permalink }}" data-item-description="{{ .Description }}">
Add to cart
</button>
</div>
@@ -59,4 +59,4 @@
{{ partial "cta.html" . }}
-{{ end }} \ No newline at end of file
+{{ end }}