Skip to content

Commit

Permalink
spraypaint
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Schock committed Jan 11, 2017
1 parent 6a7fa40 commit e9f4208
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 74 deletions.
1 change: 0 additions & 1 deletion assets/scss/layouts/products/_productSwatch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// -----------------------------------------------------------------------------

// do some math

$value_of_swatch_size : stencilString("swatch_option_size");
$position_of_x : str-index($value_of_swatch_size, "x");
$first_value : str-slice($value_of_swatch_size, 0, $position_of_x - 1);
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"searchpage_products_per_page": 12,
"show_product_quick_view": true,
"show_powered_by": true,
"shop_by_brand_show_footer": false,
"shop_by_brand_show_footer": true,
"show_copyright_footer": true,
"show_accept_amex": false,
"show_accept_discover": false,
Expand Down
24 changes: 16 additions & 8 deletions templates/components/cart/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ <h4 class="cart-item-name"><a href="{{url}}">{{name}}</a></h4>
</td>
<td class="cart-item-block cart-item-info">
<span class="cart-item-label">{{lang 'cart.checkout.price'}}</span>
<span class="cart-item-value {{#if price_discounted}}price--discounted{{/if}}">{{price.formatted}}</span>
{{#if price_discounted}}
<span class="cart-item-value">{{price_discounted.formatted}}</span>
{{/if}}
{{#or ../customer (if ../theme_settings.restrict_to_login '!==' true)}}
<span class="cart-item-value {{#if price_discounted}}price--discounted{{/if}}">{{price.formatted}}</span>
{{#if price_discounted}}
<span class="cart-item-value">{{price_discounted.formatted}}</span>
{{/if}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</td>

<td class="cart-item-block cart-item-info cart-item-quantity">
Expand Down Expand Up @@ -119,10 +123,14 @@ <h4 class="cart-item-name"><a href="{{url}}">{{name}}</a></h4>

<td class="cart-item-block cart-item-info">
<span class="cart-item-label">{{lang 'cart.checkout.total'}}</span>
<strong class="cart-item-value {{#if total_discounted}}price--discounted{{/if}}">{{total.formatted}}</strong>
{{#if total_discounted}}
<strong class="cart-item-value">{{total_discounted.formatted}}</strong>
{{/if}}
{{#or ../customer (if ../theme_settings.restrict_to_login '!==' true)}}
<strong class="cart-item-value {{#if total_discounted}}price--discounted{{/if}}">{{total.formatted}}</strong>
{{#if total_discounted}}
<strong class="cart-item-value">{{total_discounted.formatted}}</strong>
{{/if}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
{{# if can_modify}}
<a class="cart-remove icon" data-cart-itemid="{{id}}" href="#" data-confirm-delete="{{lang 'cart.confirm_delete'}}">
<svg><use xlink:href="#icon-close"></use></svg>
Expand Down
12 changes: 10 additions & 2 deletions templates/components/cart/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ <h2 class="modal-header-title">
{{lang 'cart.added_to_cart.order_subtotal'}}

<strong class="previewCartCheckout-price">
{{cart.sub_total.formatted}}
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
{{cart.sub_total.formatted}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</strong>
</div>

Expand Down Expand Up @@ -66,7 +70,11 @@ <h4 class="productView-title">
</div>

<div class="productView-price">
{{quantity}} &times; {{price.formatted}}
{{#or ../customer (if ../theme_settings.restrict_to_login '!==' true)}}
{{quantity}} &times; {{price.formatted}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</div>

{{#each configurable_fields}}
Expand Down
12 changes: 10 additions & 2 deletions templates/components/cart/totals.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
<strong>{{lang 'cart.checkout.subtotal'}}:</strong>
</div>
<div class="cart-total-value">
<span>{{cart.sub_total.formatted}}</span>
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
<span>{{cart.sub_total.formatted}}</span>
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</div>
</li>
{{#if cart.gift_wrapping_cost.amount}}
Expand Down Expand Up @@ -91,7 +95,11 @@
<strong>{{lang 'cart.checkout.grand_total'}}:</strong>
</div>
<div class="cart-total-value cart-total-grandTotal">
<span>{{cart.grand_total.formatted}}</span>
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
<span>{{cart.grand_total.formatted}}</span>
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</div>
</li>
</ul>
6 changes: 5 additions & 1 deletion templates/components/common/cart-preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ <h6 class="previewCartItem-name">
{{#if quantity '>' 1}}
{{quantity}} &times;
{{/if}}
{{price.formatted}}
{{#or ../customer (if ../theme_settings.restrict_to_login '!==' true)}}
{{price.formatted}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</span>
</div>
</li>
Expand Down
1 change: 1 addition & 0 deletions templates/components/common/login-for-pricing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p translate>Log in for pricing</p>
42 changes: 9 additions & 33 deletions templates/components/products/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,7 @@
{{lang 'products.compare'}} <input type="checkbox" name="products[]" value="{{id}}" id="compare-{{id}}" data-compare-id="{{id}}">
</label>
{{/if}}
{{#if theme_settings.restrict_to_login}}
{{#if customer}}
{{#if show_cart_action}}
{{#if has_options}}
<a href="{{url}}" class="button button--small card-figcaption-button" data-product-id="{{id}}">{{lang 'products.choose_options'}}</a>
{{/if}}
{{#if pre_order}}
<a href="{{url}}" class="button button--small card-figcaption-button">{{lang 'products.pre_order'}}</a>
{{/if}}
{{#if add_to_cart_url }}
<a href="{{add_to_cart_url}}" class="button button--small card-figcaption-button">{{lang 'products.add_to_cart'}}</a>
{{/if}}
{{#if out_of_stock_message }}
<a href="{{url}}" class="button button--small card-figcaption-button" data-product-id="{{id}}">{{out_of_stock_message}}</a>
{{/if}}
{{/if}}
{{/if}}
{{else}}
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
{{#if show_cart_action}}
{{#if has_options}}
<a href="{{url}}" class="button button--small card-figcaption-button" data-product-id="{{id}}">{{lang 'products.choose_options'}}</a>
Expand All @@ -63,7 +46,7 @@
<a href="{{url}}" class="button button--small card-figcaption-button" data-product-id="{{id}}">{{out_of_stock_message}}</a>
{{/if}}
{{/if}}
{{/if}}
{{/or}}
</div>
</figcaption>
</figure>
Expand All @@ -81,20 +64,13 @@
<h4 class="card-title">
<a href="{{url}}">{{name}}</a>
</h4>
{{#if theme_settings.restrict_to_login}}
{{#if customer}}
<div class="card-text" data-test-info-type="price">
{{> components/products/price price=price customer=../../customer}}
</div>

<div class="card-text" data-test-info-type="price">
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
{{> components/products/price price=price customer=customer}}
{{else}}
<div class="card-text" data-test-info-type="price">
<p translate>Log in for pricing</p>
</div>
{{/if}}
{{else}}
<div class="card-text" data-test-info-type="price">
{{> components/products/price price=price customer=../../customer}}
</div>
{{/if}}
{{> components/common/login-for-pricing}}
{{/or}}
</div>
</div>
</article>
2 changes: 1 addition & 1 deletion templates/components/products/carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
>
{{#each products}}
<div class="productCarousel-slide">
{{> components/products/card theme_settings=../theme_settings}}
{{> components/products/card theme_settings=../theme_settings customer=../customer}}
</div>
{{/each}}
</section>
32 changes: 9 additions & 23 deletions templates/components/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,13 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
<span>{{product.call_for_price}}</span>
</p>
{{/if}}
{{#if theme_settings.restrict_to_login}}
{{#all customer product.price}}
<div class="productView-price">
{{> components/products/price price=product.price schema_org=schema}}
</div>
{{else}}
<div class="productView-price">
<p translate>Log in for pricing</p>
</div>
{{/all}}
{{else if product.price}}
<div class="productView-price">
<div class="productView-price">
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
{{> components/products/price price=product.price schema_org=schema}}
</div>
{{/if}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</div>
<div class="productView-rating"{{#if schema}} itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"{{/if}}>
{{#if settings.show_product_rating}}
{{#if product.num_reviews '>' 0}}
Expand Down Expand Up @@ -282,19 +274,13 @@ <h2 class="modal-header-title">{{lang 'products.bulk_pricing.modal_title'}}</h2>
</div>
<p class="alertBox-column alertBox-message"></p>
</div>
{{#all theme_settings.restrict_to_login customer}}
<div class="form-action">
<input id="form-action-addToCart" data-wait-message="{{lang 'products.adding_to_cart'}}" class="button button--primary" type="submit"
value="{{#if product.pre_order}}{{lang 'products.pre_order'}}{{else}}{{lang 'products.add_to_cart'}}{{/if}}">
</div>
{{{snippet 'product_addtocart'}}}
{{else}}
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
<div class="form-action">
<input id="form-action-addToCart" data-wait-message="{{lang 'products.adding_to_cart'}}" class="button button--primary" type="submit"
value="{{#if product.pre_order}}{{lang 'products.pre_order'}}{{else}}{{lang 'products.add_to_cart'}}{{/if}}">
</div>
{{{snippet 'product_addtocart'}}}
{{/all}}
{{{snippet 'product_addtocart'}}}
{{/or}}
{{/if}}
{{#if product.out_of_stock}}
{{#if product.out_of_stock_message}}
Expand Down
2 changes: 1 addition & 1 deletion templates/components/products/top.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h2 class="page-heading">{{lang 'products.top' }}</h2>
<ul class="productGrid productGrid--maxCol{{ columns }}" data-product-type="top_sellers">
{{#each products}}
<li class="product">
{{>components/products/card theme_settings=../theme_settings}}
{{>components/products/card theme_settings=../theme_settings customer=../customer}}
</li>
{{/each}}
</ul>
Expand Down
6 changes: 5 additions & 1 deletion templates/pages/compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ <h1 class="page-heading">{{lang 'compare.header' products=comparisons.length}}</
<h4 class="card-title">
<a href="{{url}}">{{ name }}</a>
</h4>
{{> components/products/price price=price}}
{{#or ../customer (if ../theme_settings.restrict_to_login '!==' true)}}
{{> components/products/price price=price}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</div>
</article>
</th>
Expand Down

0 comments on commit e9f4208

Please sign in to comment.