From 4cbdf79389e33a696466b259b16be74cc204bbae Mon Sep 17 00:00:00 2001 From: junedkazi Date: Thu, 16 Mar 2017 12:20:22 -0700 Subject: [PATCH] Load amp social JS only when share icons are enabled. --- CHANGELOG.md | 2 ++ .../components/amp/products/product-view.html | 14 ++++++++------ templates/pages/amp/product.html | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea2919c59..a301ba2ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Draft - `stencil.conf.js` was refactored to support webpack2 builds [961](https://github.com/bigcommerce/cornerstone/pull/961) +- Load amp social share JS only when we have share icons enabled. [#968](https://github.com/bigcommerce/cornerstone/pull/968) + ## 1.6.2 (2017-03-15) - Fix a bug that was not updating price and weight when an option is selected [#963](https://github.com/bigcommerce/cornerstone/pull/963) diff --git a/templates/components/amp/products/product-view.html b/templates/components/amp/products/product-view.html index adfe3e8210..461bc428b6 100644 --- a/templates/components/amp/products/product-view.html +++ b/templates/components/amp/products/product-view.html @@ -65,11 +65,13 @@

Description

{{#if settings.show_product_reviews}} {{> components/amp/products/reviews reviews=product.reviews product=product urls=urls}} {{/if}} -
-

Share

- -
+ {{#if settings.add_this.buttons}} +
+

Share

+ +
+ {{/if}} diff --git a/templates/pages/amp/product.html b/templates/pages/amp/product.html index 1a6bbfc3cc..27d79a8c7d 100644 --- a/templates/pages/amp/product.html +++ b/templates/pages/amp/product.html @@ -13,9 +13,11 @@ {{#partial "amp-scripts"}} - + {{#if settings.add_this.buttons}} + + {{/if}} {{#if product.options}} - + {{/if}} {{#if product.videos}}