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

Assign font family to input fields #2871

Merged
merged 9 commits into from
Dec 14, 2023
2 changes: 2 additions & 0 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,7 @@ details[open] > .share-button__fallback {
appearance: none;
background-color: rgb(var(--color-background));
color: rgb(var(--color-foreground));
font-family: var(--font-body-family);
kjellr marked this conversation as resolved.
Show resolved Hide resolved
kjellr marked this conversation as resolved.
Show resolved Hide resolved
font-size: 1.6rem;
width: 100%;
box-sizing: border-box;
Expand Down Expand Up @@ -1925,6 +1926,7 @@ input[type='checkbox'] {

.quantity__input {
color: currentColor;
font-family: var(--font-body-family);
kjellr marked this conversation as resolved.
Show resolved Hide resolved
font-size: 1.6rem;
font-weight: 500;
opacity: 0.85;
Expand Down
8 changes: 4 additions & 4 deletions assets/component-list-social.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
}

.list-social__item .icon {
height: 1.8rem;
width: 1.8rem;
height: 2.2rem;
width: 2.2rem;
}

.list-social__link {
align-items: center;
display: flex;
padding: 1.3rem;
padding: 1.1rem;
color: rgb(var(--color-foreground));
}

.utility-bar .list-social__link {
padding: 0 1.1rem;
padding: 0 0.8rem;
height: 3.8rem;
}

Expand Down
2 changes: 1 addition & 1 deletion assets/component-menu-drawer.css
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,5 @@ details[open].menu-opening > .menu-drawer__submenu {
}

.menu-drawer .list-social__link {
padding: 1.3rem 1.3rem;
padding: 1.1rem 1.1rem;
}
7 changes: 6 additions & 1 deletion assets/component-price.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@
}

.price--sold-out .price__badge-sold-out,
.price--on-sale .price__badge-sale {
.price--on-sale .price__badge-sale,
.volume-pricing--sale-badge .price__badge-sale {
display: inline-block;
}

.volume-pricing--sale-badge .price__badge-sale {
margin-left: 0.5rem;
}

.price--on-sale .price__sale {
display: initial;
flex-direction: row;
Expand Down
16 changes: 16 additions & 0 deletions assets/component-volume-pricing.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ volume-pricing show-more-button {
}

.product-form__input .price-per-item {
color: rgba(var(--color-foreground));
font-size: 1.4rem;
letter-spacing: 0.06rem;
}

.price-per-item dl {
margin: 0;
}

.price-per-item dd {
margin-left: 0;
}

.price-per-item__container .variant-item__old-price,
.price__regular .variant-item__old-price {
color: rgba(var(--color-foreground), 0.75);
font-size: 1.2rem;
letter-spacing: 0.07rem;
}
3 changes: 3 additions & 0 deletions assets/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ class VariantSelects extends HTMLElement {

if (pricePerItemSource && pricePerItemDestination) {
pricePerItemDestination.innerHTML = pricePerItemSource.innerHTML;
pricePerItemDestination.classList.toggle('visibility-hidden', pricePerItemSource.classList.contains('visibility-hidden'));
}

const price = document.getElementById(`price-${this.dataset.section}`);
Expand Down Expand Up @@ -1174,12 +1175,14 @@ class VariantSelects extends HTMLElement {
const price = document.getElementById(`price-${this.dataset.section}`);
const inventory = document.getElementById(`Inventory-${this.dataset.section}`);
const sku = document.getElementById(`Sku-${this.dataset.section}`);
const pricePerItem = document.getElementById(`Price-Per-Item-${this.dataset.section}`);

if (!addButton) return;
addButtonText.textContent = window.variantStrings.unavailable;
if (price) price.classList.add('visibility-hidden');
if (inventory) inventory.classList.add('visibility-hidden');
if (sku) sku.classList.add('visibility-hidden');
if (pricePerItem) pricePerItem.classList.add('visibility-hidden');
}

getVariantData() {
Expand Down
2 changes: 0 additions & 2 deletions assets/price-per-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ if (!customElements.get('price-per-item')) {
if (this.classList.contains('variant-item__price-per-item')) {
this.currentQtyForVolumePricing = this.getCartQuantity(updatedCartQuantity);
}

for (let pair of this.qtyPricePairs) {
if (this.currentQtyForVolumePricing >= pair[0]) {
const pricePerItemCurrent = document.querySelector(`price-per-item[id^="Price-Per-Item-${this.dataset.sectionId || this.dataset.variantId}"] .price-per-item span`);
Expand All @@ -97,7 +96,6 @@ if (!customElements.get('price-per-item')) {
this.qtyPricePairs.push([qty, price]);
});
}

this.qtyPricePairs.reverse();
}
}
Expand Down
17 changes: 16 additions & 1 deletion assets/quantity-popover.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
quantity-popover {
position: relative;
display: block;
}

quantity-popover volume-pricing li:nth-child(odd) {
Expand All @@ -22,12 +23,22 @@ quantity-popover volume-pricing li {
max-width: 36rem;
}

.quantity-popover__info .button-close,
.variant-remove-total quick-order-list-remove-all-button .button,
.quick-order-list-total__confirmation quick-order-list-remove-all-button .button,
quantity-popover quick-order-list-remove-button .button {
--shadow-opacity: 0;
--border-opacity: 0;
}

.quantity-popover__info-button {
display: flex;
align-items: center;
margin: 0 0.4rem 0 0;
min-width: 1.5rem;
min-height: 1.5rem;
--shadow-opacity: 0;
--border-opacity: 0;
}

.quantity-popover__info-button--icon-with-label {
Expand Down Expand Up @@ -79,6 +90,10 @@ quantity-popover volume-pricing li {
justify-content: flex-end;
}

.quantity-popover__info .volume-pricing-label~.button {
top: -0.2rem;
}

.quantity-popover__info .button .icon {
width: 1.5rem;
height: 1.5rem;
Expand Down Expand Up @@ -145,4 +160,4 @@ quantity-popover .quantity__rules .divider:nth-child(2)::before {
quantity-popover .quantity__button:not(:focus-visible):not(.focused),
quantity-popover .quantity__input:not(:focus-visible):not(.focused) {
background-color: initial;
}
}
8 changes: 8 additions & 0 deletions assets/quick-order-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class QuickOrderList extends HTMLElement {
}
this.quickOrderListId = 'quick-order-list'
this.variantItemStatusElement = document.getElementById('shopping-cart-variant-item-status');
const form = this.querySelector('form');

form.addEventListener('submit', this.onSubmit.bind(this));

const debouncedOnChange = debounce((event) => {
this.onChange(event);
}, ON_CHANGE_DEBOUNCE_TIMER);
Expand All @@ -76,6 +80,10 @@ class QuickOrderList extends HTMLElement {

cartUpdateUnsubscriber = undefined;

onSubmit(event) {
event.preventDefault();
}

connectedCallback() {
this.cartUpdateUnsubscriber = subscribe(PUB_SUB_EVENTS.cartUpdate, (event) => {
if (event.source === this.quickOrderListId) {
Expand Down
107 changes: 78 additions & 29 deletions sections/featured-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -282,35 +282,84 @@
assign current_qty_for_volume_pricing = cart_qty | plus: product.selected_or_first_available_variant.quantity_rule.increment
endif
-%}
<price-per-item
class="no-js-hidden"
id="Price-Per-Item-{{ section.id }}"
data-section-id="{{ section.id }}"
data-variant-id="{{ product.selected_or_first_available_variant.id }}"
>
{%- if product.quantity_price_breaks_configured? -%}
<div class="price-per-item">
{%- if current_qty_for_volume_pricing < volume_pricing_array.last.minimum_quantity -%}
{%- assign variant_price = product.selected_or_first_available_variant.price
| money_with_currency
-%}
<span class="price-per-item--current">
{{- 'products.product.volume_pricing.price_at_each' | t: price: variant_price -}}
</span>
{%- else -%}
{%- for price_break in volume_pricing_array -%}
{%- if current_qty_for_volume_pricing >= price_break.minimum_quantity -%}
{%- assign price_break_price = price_break.price | money_with_currency -%}
<span class="price-per-item--current">
{{- 'products.product.volume_pricing.price_at_each' | t: price: price_break_price -}}
</span>
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
</div>
{%- endif -%}
</price-per-item>
{%- if product.quantity_price_breaks_configured? -%}
<price-per-item
class="no-js-hidden"
id="Price-Per-Item-{{ section.id }}"
data-section-id="{{ section.id }}"
data-variant-id="{{ product.selected_or_first_available_variant.id }}"
>
{%- if product.selected_or_first_available_variant.quantity_price_breaks.size > 0 -%}
{%- assign variant_price_compare = product.selected_or_first_available_variant.compare_at_price -%}
<div class="price-per-item">
{%- if variant_price_compare -%}
<dl class="price-per-item--current">
<dt class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</dt>
<dd>
<s class="variant-item__old-price">
{{ variant_price_compare | money_with_currency }}
</s>
</dd>
</dl>
{%- endif -%}
{%- if current_qty_for_volume_pricing < volume_pricing_array.last.minimum_quantity -%}
{%- assign variant_price = product.selected_or_first_available_variant.price
| money_with_currency
-%}
<span class="price-per-item--current">
{{- 'products.product.volume_pricing.price_at_each' | t: price: variant_price -}}
</span>
{%- else -%}
{%- for price_break in volume_pricing_array -%}
{%- if current_qty_for_volume_pricing >= price_break.minimum_quantity -%}
{%- assign price_break_price = price_break.price | money_with_currency -%}
<span class="price-per-item--current">
{{-
'products.product.volume_pricing.price_at_each'
| t: price: price_break_price
-}}
</span>
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
</div>
{%- else -%}
{%- assign variant_price = product.selected_or_first_available_variant.price
| money_with_currency
-%}
{%- assign variant_price_compare = product.selected_or_first_available_variant.compare_at_price -%}
<div class="price-per-item">
{%- if variant_price_compare -%}
<dl class="price-per-item--current">
<dt class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</dt>
<dd>
<s class="variant-item__old-price">
{{ variant_price_compare | money_with_currency }}
</s>
</dd>
<dt class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</dt>
<dd>
<span class="price-per-item--current">
{{- 'products.product.volume_pricing.price_at_each' | t: price: variant_price -}}
</span>
</dd>
</dl>
{%- else -%}
<span class="price-per-item--current">
{{- 'products.product.volume_pricing.price_at_each' | t: price: variant_price -}}
</span>
{%- endif -%}
</div>
{%- endif -%}
</price-per-item>
{%- endif -%}
</div>
<div class="quantity__rules caption no-js-hidden">
{%- if product.selected_or_first_available_variant.quantity_rule.increment > 1 -%}
Expand Down
4 changes: 3 additions & 1 deletion sections/main-cart-items.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@
hidden
>
{%- if has_qty_rules == false -%}
<span class="volume-pricing-label caption">Volume pricing</span>
<span class="volume-pricing-label caption">
{{- 'products.product.volume_pricing.title' | t -}}
</span>
{%- endif -%}
<div class="quantity__rules caption no-js-hidden">
{%- if item.variant.quantity_rule.increment > 1 -%}
Expand Down
Loading