Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Remove "Show product on mobile" settings and update the product column #308

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/product-column.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
@media screen and (max-width: 768px) {
.product-home-container .product-block .product-name {
font-size: 24px;
font-size: 25px;
}
}
.product-home-container .product-block .product-price {
Expand All @@ -48,7 +48,7 @@
.product-home-container .product-block .product-compare-price {
color: #8D8D8D;
font-weight: 400;
font-size: 17px;
font-size: 19px;
line-height: 23px;
}
.product-home-container .product-block .product-description {
Expand Down
36 changes: 10 additions & 26 deletions sections/product-column.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,15 @@
.product_customization-{{ id }} {
background-color: {{ section.settings.background_color.hex }};
}

@media screen and (max-width: 768px) {
.product_customization-{{ id }} {
display: {% if section.settings.show_product %}block{% else %}none{% endif %};
}
}
{%- endstyle -%}

<section class='product_customization-{{ id }}'>
{%- assign selected_product = section.settings.product %}

{%- if product %}
{%- assign selected_product = product %}
{%- endif %}
{%- assign selected_product = section.settings.product %}

{%- if selected_product %}
{%- if selected_product %}
<section class='product_customization-{{ id }}'>
{%- render 'product-home', product_id: selected_product.id, product: selected_product, block_settings: section.settings-%}
{%- endif %}
</section>
</section>
{%- endif %}

{%- schema -%}
{
Expand All @@ -40,6 +30,11 @@
"id": "product",
"type": "product"
},
{
"label": "Product description",
"id": "product_description",
"type": "richtext"
},
{
"type": "checkbox",
"id": "show_compare_at_price",
Expand All @@ -51,12 +46,6 @@
"id": "background_color",
"label": "Background color"
},
{
"type": "checkbox",
"id": "show_product",
"label": "Show product on mobile",
"default": true
},
{
"type": "range",
"id": "padding_top",
Expand Down Expand Up @@ -131,11 +120,6 @@
"label": "Price",
"limit": 1,
"type": "product_price"
},
{
"label": "Description",
"limit": 1,
"type": "product_description"
}
]
}
Expand Down
7 changes: 3 additions & 4 deletions snippets/product-home.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@
</h3>
{% endif %}
</div>
{%- when 'product_description' -%}
<section class='product-description '>{{ product.description }}</section>
{%- endcase -%}
{%- endfor -%}
{%- endcase -%}
{%- endfor -%}
<p class='product-description'>{{ section.settings.product_description }}</p>
<a href='{{ product.url }}' class='yc-btn buy-btn'>إتمام الشراء</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions styles/product-column.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
line-height: 36px;

@media screen and (max-width: 768px) {
font-size: 24px;
font-size: 25px;
}
}

Expand All @@ -49,7 +49,7 @@
.product-compare-price {
color: #8D8D8D;
font-weight: 400;
font-size: 17px;
font-size: 19px;
line-height: 23px;
}

Expand Down