Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STENCIL-3527: Adding toggle for weight and dimensions on product pages. #1092

Merged
merged 1 commit into from
Oct 12, 2017

Conversation

cristycarpenter
Copy link
Contributor

@cristycarpenter cristycarpenter commented Oct 3, 2017

What?

Adds toggle settings to the theme editor for displaying (or not displaying) weight and dimensions on product pages.

Tickets / Documentation

This is a feature request from customers as documented here:

Screenshots (if appropriate)

screenshot

Video of working changes: https://www.screencast.com/t/juQ8DUTeG3F8

config.json Outdated
@@ -382,6 +384,8 @@
"show_accept_paypal": false,
"show_accept_visa": false,
"show_product_details_tabs": true,
"show_product_weight": true,
"show_product_dimensions": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed. This only needs to be added once to the global settings on line 72 and 73

I noticed that there are several cases like this :(. It only needs to be added to the variations if the values are different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and GTK!

config.json Outdated
@@ -654,6 +658,8 @@
"show_accept_paypal": false,
"show_accept_visa": false,
"show_product_details_tabs": true,
"show_product_weight": true,
"show_product_dimensions": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed :)

lang/en.json Outdated
"depth": "Depth:",
"measurement": {
"metric": "cm",
"imperial": "in"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indented now.

@@ -76,10 +76,39 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
<dt class="productView-info-name">{{lang 'products.availability'}}</dt>
<dd class="productView-info-value">{{product.availability}}</dd>
{{/if}}
{{#if product.weight}}
{{#if theme_settings.show_product_weight}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you still need to check for product.weight. You can use all helper

{{#all product.weight theme_settings.show_product_weight}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to weight as well as dimensions since dimensions are optional. Thanks for catching these!

<dt class="productView-info-name">{{lang 'products.weight'}}</dt>
<dd class="productView-info-value" data-product-weight>{{product.weight}}</dd>
{{/if}}
{{/all}}
{{#all product.width product.height. product.depth theme_settings.show_product_dimensions}}
Copy link
Contributor

@mcampa mcampa Oct 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an extra dot in product.height. 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♀️ ✔️

config.json Outdated
@@ -69,6 +69,8 @@
"show_accept_paypal": false,
"show_accept_visa": false,
"show_product_details_tabs": true,
"show_product_weight": true,
"show_product_dimensions": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we never displayed this info before we should default it to false. We don't want people calling support that new data started showing up on their product details page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I had thought about that but forgot to implement. Good news is I am better at squashing ;)

@aleachjr
Copy link

aleachjr commented Oct 4, 2017

What is the performance impact here? We have heard from merchants it is very slow using theme editor with a bunch of theme options to change. This seems it would slow down theme editor even more. Do we know either way?

@mcampa
Copy link
Contributor

mcampa commented Oct 4, 2017

This is just adding two more fields, so the impact should be marginal.
I agree with you that TE has performance issues, and we have to invest on fix it.

@junedkazi junedkazi merged commit 27b5f21 into bigcommerce:master Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants