{% doc %} @prompt Make a new shop page section to show products, in AJAX pagination method, with sorting option on top, Make it dynamic (so we can change the color scheme and the options), For the styling (for typography, color scheme, etc) use the same one that has been set on theme options (make it as dynamic), also an setting to show or hide sold out products, why no product image showing? make sure to get the product images, the image still not showing, and the img source is now "[object Object]", Make sure to get each products featured image, adjustment : 1. Get All Products 2. Fix the product price and Make sure to get each products data just like the one that has been set on the shopify backend., Why is no product showing now?, adjustment : 1. can we get all product, since right now it's only showing sold out products., adjusment : 1. option to : change how many column 2. Styling have option to choose between Inherit (choose color scheme) or manually {% enddoc %} {% assign ai_gen_id = block.id | replace: '_', '' | downcase %} {% style %} .ai-product-listing-{{ ai_gen_id }} { {% if block.settings.styling_mode == 'inherit' %} background-color: rgb(from {{ settings.color_schemes[block.settings.color_scheme].settings.background }} r g b / 1); color: {{ settings.color_schemes[block.settings.color_scheme].settings.foreground }}; {% else %} background-color: {{ block.settings.custom_background_color }}; color: {{ block.settings.custom_text_color }}; {% endif %} padding: {{ block.settings.section_padding_top }}px 0 {{ block.settings.section_padding_bottom }}px; } .ai-product-listing-container-{{ ai_gen_id }} { max-width: 1200px; margin: 0 auto; padding: 0 20px; } .ai-product-listing-header-{{ ai_gen_id }} { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 20px; } .ai-shop-product-title-{{ ai_gen_id }} { font-weight: 400 !important; } .ai-product-listing-title-{{ ai_gen_id }} { font-family: {{ settings.type_heading_font.family }}, {{ settings.type_heading_font.fallback_families }}; font-size: {{ block.settings.heading_size }}px; {% if block.settings.styling_mode == 'inherit' %} color: {{ settings.color_schemes[block.settings.color_scheme].settings.foreground_heading }}; {% else %} color: {{ block.settings.custom_heading_color }}; {% endif %} margin: 0; text-transform: {% if settings.type_case_h2 == 'uppercase' %}uppercase{% else %}none{% endif %}; letter-spacing: {% if settings.type_letter_spacing_h2 == 'heading-tight' %}-0.02em{% elsif settings.type_letter_spacing_h2 == 'heading-loose' %}0.05em{% else %}0{% endif %}; } .ai-product-listing-controls-{{ ai_gen_id }} { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; } .ai-product-listing-sort-{{ ai_gen_id }}, .ai-product-listing-per-page-{{ ai_gen_id }} { padding: 8px 12px; {% if block.settings.styling_mode == 'inherit' %} border: {{ settings.input_border_width }}px solid {{ settings.color_schemes[block.settings.color_scheme].settings.border }}; background-color: {{ settings.color_schemes[block.settings.color_scheme].settings.input_background }}; color: {{ settings.color_schemes[block.settings.color_scheme].settings.input_text_color }}; {% else %} border: 1px solid {{ block.settings.custom_border_color }}; background-color: {{ block.settings.custom_input_background }}; color: {{ block.settings.custom_input_text }}; {% endif %} border-radius: {{ settings.inputs_border_radius }}px; font-family: {{ settings.type_body_font.family }}, {{ settings.type_body_font.fallback_families }}; font-size: {{ settings.type_size_paragraph }}px; } .ai-product-listing-grid-{{ ai_gen_id }} { display: grid; grid-template-columns: repeat({{ block.settings.columns_desktop }}, 1fr); gap: {{ block.settings.grid_gap }}px; margin-bottom: 40px; } .ai-product-card-{{ ai_gen_id }} { {% if block.settings.styling_mode == 'inherit' %} background-color: {{ settings.color_schemes[block.settings.color_scheme].settings.background }}; border: 1px solid {{ settings.color_schemes[block.settings.color_scheme].settings.border }}; {% else %} background-color: {{ block.settings.custom_card_background }}; border: 1px solid {{ block.settings.custom_card_border }}; {% endif %} border-radius: {{ settings.product_corner_radius }}px; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; } .ai-product-card-{{ ai_gen_id }}:hover { {% if settings.card_hover_effect == 'lift' %} transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); {% elsif settings.card_hover_effect == 'scale' %} transform: scale(1.02); {% elsif settings.card_hover_effect == 'subtle-zoom' %} transform: scale(1.01); {% endif %} } .ai-product-image-{{ ai_gen_id }} { width: 100%; height: {{ block.settings.image_height }}px; object-fit: cover; display: block; } .ai-product-info-{{ ai_gen_id }} { padding: 15px; } .ai-product-title-{{ ai_gen_id }} a { font-family: {{ settings.type_subheading_font.family }}, {{ settings.type_subheading_font.fallback_families }}; font-weight: {{ settings.type_subheading_font.weight }}; font-size: {{ settings.type_size_h5 }}px; {% if block.settings.styling_mode == 'inherit' %} color: {{ settings.color_schemes[block.settings.color_scheme].settings.foreground_heading }}; {% else %} color: {{ block.settings.custom_product_title_color }}; {% endif %} margin: 0 0 8px 0; line-height: 1.3; } .ai-product-price-{{ ai_gen_id }} { font-family: {{ settings.type_body_font.family }}, {{ settings.type_body_font.fallback_families }}; font-size: {{ settings.type_size_paragraph }}px; {% if block.settings.styling_mode == 'inherit' %} color: {{ settings.color_schemes[block.settings.color_scheme].settings.foreground }}; {% else %} color: {{ block.settings.custom_product_price_color }}; {% endif %} margin: 0; } .ai-product-price-compare-{{ ai_gen_id }} { text-decoration: line-through; opacity: 0.7; margin-right: 8px; } .ai-product-badge-{{ ai_gen_id }} { position: absolute; top: 10px; right: 10px; {% if block.settings.styling_mode == 'inherit' %} background-color: {{ settings.color_schemes[settings.badge_sold_out_color_scheme].settings.background }}; color: {{ settings.color_schemes[settings.badge_sold_out_color_scheme].settings.foreground }}; {% else %} background-color: {{ block.settings.custom_badge_background }}; color: {{ block.settings.custom_badge_text }}; {% endif %} padding: 4px 8px; border-radius: {{ settings.badge_corner_radius }}px; font-size: 12px; font-weight: 600; text-transform: {% if settings.badge_text_transform == 'uppercase' %}uppercase{% else %}none{% endif %}; } .ai-product-image-container-{{ ai_gen_id }} { position: relative; } .ai-pagination-{{ ai_gen_id }} { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 40px; } .ai-pagination-button-{{ ai_gen_id }} { padding: 8px 16px; {% if block.settings.styling_mode == 'inherit' %} border: {{ settings.primary_button_border_width }}px solid {{ settings.color_schemes[block.settings.color_scheme].settings.primary_button_border }}; background-color: {{ settings.color_schemes[block.settings.color_scheme].settings.primary_button_background }}; color: {{ settings.color_schemes[block.settings.color_scheme].settings.primary_button_text }}; {% else %} border: 1px solid {{ block.settings.custom_button_border }}; background-color: {{ block.settings.custom_button_background }}; color: {{ block.settings.custom_button_text }}; {% endif %} border-radius: {{ settings.button_border_radius_primary }}px; text-decoration: none; font-family: {{ settings.type_body_font.family }}, {{ settings.type_body_font.fallback_families }}; font-size: {{ settings.type_size_paragraph }}px; cursor: pointer; transition: all 0.3s ease; } .ai-pagination-button-{{ ai_gen_id }}:hover { {% if block.settings.styling_mode == 'inherit' %} background-color: {{ settings.color_schemes[block.settings.color_scheme].settings.primary_button_hover_background }}; color: {{ settings.color_schemes[block.settings.color_scheme].settings.primary_button_hover_text }}; border-color: {{ settings.color_schemes[block.settings.color_scheme].settings.primary_button_hover_border }}; {% else %} background-color: {{ block.settings.custom_button_hover_background }}; color: {{ block.settings.custom_button_hover_text }}; border-color: {{ block.settings.custom_button_hover_border }}; {% endif %} } .ai-pagination-button-{{ ai_gen_id }}.active { {% if block.settings.styling_mode == 'inherit' %} background-color: {{ settings.color_schemes[block.settings.color_scheme].settings.foreground_heading }}; color: {{ settings.color_schemes[block.settings.color_scheme].settings.background }}; {% else %} background-color: {{ block.settings.custom_button_active_background }}; color: {{ block.settings.custom_button_active_text }}; {% endif %} } .ai-pagination-button-{{ ai_gen_id }}:disabled { opacity: 0.5; cursor: not-allowed; } .ai-loading-{{ ai_gen_id }} { text-align: center; padding: 40px; font-family: {{ settings.type_body_font.family }}, {{ settings.type_body_font.fallback_families }}; {% if block.settings.styling_mode == 'inherit' %} color: {{ settings.color_schemes[block.settings.color_scheme].settings.foreground }}; {% else %} color: {{ block.settings.custom_text_color }}; {% endif %} } .ai-no-products-{{ ai_gen_id }} { text-align: center; padding: 60px 20px; font-family: {{ settings.type_body_font.family }}, {{ settings.type_body_font.fallback_families }}; {% if block.settings.styling_mode == 'inherit' %} color: {{ settings.color_schemes[block.settings.color_scheme].settings.foreground }}; {% else %} color: {{ block.settings.custom_text_color }}; {% endif %} } .ai-debug-panel-{{ ai_gen_id }} { background-color: #f0f0f0; border: 1px solid #ccc; border-radius: 4px; padding: 15px; margin-bottom: 20px; font-family: monospace; font-size: 12px; color: #333; } @media screen and (max-width: 768px) { .ai-product-listing-header-{{ ai_gen_id }} { flex-direction: column; align-items: stretch; } .ai-product-listing-controls-{{ ai_gen_id }} { justify-content: center; } .ai-product-listing-grid-{{ ai_gen_id }} { grid-template-columns: repeat({{ block.settings.columns_mobile }}, 1fr); gap: 15px; } .ai-product-card-{{ ai_gen_id }} { min-width: 0; } .ai-product-info-{{ ai_gen_id }} { padding: 10px; } .ai-product-title-{{ ai_gen_id }} { font-size: 14px; } .ai-pagination-{{ ai_gen_id }} { flex-wrap: wrap; } } {% endstyle %}
{% if block.settings.heading != blank %}

{{ block.settings.heading }}

{% endif %}
Loading products...
{% schema %} { "name": "Product listing", "settings": [ { "type": "header", "content": "Content" }, { "type": "text", "id": "heading", "label": "Heading", "default": "All Products" }, { "type": "collection", "id": "collection", "label": "Collection", "info": "Leave empty to show all products" }, { "type": "checkbox", "id": "show_sold_out", "label": "Show sold out products", "default": false }, { "type": "header", "content": "Layout" }, { "type": "range", "id": "products_per_page", "min": 6, "max": 48, "step": 6, "label": "Products per page", "default": 12 }, { "type": "range", "id": "columns_desktop", "min": 2, "max": 6, "step": 1, "label": "Columns on desktop", "default": 4 }, { "type": "select", "id": "columns_mobile", "label": "Columns on mobile", "options": [ { "value": "1", "label": "1" }, { "value": "2", "label": "2" } ], "default": "2" }, { "type": "range", "id": "grid_gap", "min": 10, "max": 40, "step": 5, "unit": "px", "label": "Grid gap", "default": 20 }, { "type": "range", "id": "image_height", "min": 200, "max": 400, "step": 20, "unit": "px", "label": "Image height", "default": 280 }, { "type": "header", "content": "Style" }, { "type": "select", "id": "styling_mode", "label": "Styling mode", "options": [ { "value": "inherit", "label": "Inherit from theme" }, { "value": "custom", "label": "Custom colors" } ], "default": "inherit" }, { "type": "color_scheme", "id": "color_scheme", "label": "Color scheme", "default": "scheme-1", "info": "Used when styling mode is set to inherit" }, { "type": "range", "id": "heading_size", "min": 20, "max": 60, "step": 2, "unit": "px", "label": "Heading size", "default": 32 }, { "type": "range", "id": "section_padding_top", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "Top padding", "default": 40 }, { "type": "range", "id": "section_padding_bottom", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "Bottom padding", "default": 40 }, { "type": "header", "content": "Custom colors" }, { "type": "color", "id": "custom_background_color", "label": "Background color", "default": "#ffffff" }, { "type": "color", "id": "custom_text_color", "label": "Text color", "default": "#000000" }, { "type": "color", "id": "custom_heading_color", "label": "Heading color", "default": "#000000" }, { "type": "color", "id": "custom_border_color", "label": "Border color", "default": "#e6e6e6" }, { "type": "color", "id": "custom_card_background", "label": "Card background", "default": "#ffffff" }, { "type": "color", "id": "custom_card_border", "label": "Card border", "default": "#e6e6e6" }, { "type": "color", "id": "custom_product_title_color", "label": "Product title color", "default": "#000000" }, { "type": "color", "id": "custom_product_price_color", "label": "Product price color", "default": "#000000" }, { "type": "color", "id": "custom_input_background", "label": "Input background", "default": "#ffffff" }, { "type": "color", "id": "custom_input_text", "label": "Input text color", "default": "#000000" }, { "type": "color", "id": "custom_button_background", "label": "Button background", "default": "#000000" }, { "type": "color", "id": "custom_button_text", "label": "Button text", "default": "#ffffff" }, { "type": "color", "id": "custom_button_border", "label": "Button border", "default": "#000000" }, { "type": "color", "id": "custom_button_hover_background", "label": "Button hover background", "default": "#333333" }, { "type": "color", "id": "custom_button_hover_text", "label": "Button hover text", "default": "#ffffff" }, { "type": "color", "id": "custom_button_hover_border", "label": "Button hover border", "default": "#333333" }, { "type": "color", "id": "custom_button_active_background", "label": "Active button background", "default": "#000000" }, { "type": "color", "id": "custom_button_active_text", "label": "Active button text", "default": "#ffffff" }, { "type": "color", "id": "custom_badge_background", "label": "Badge background", "default": "#ff0000" }, { "type": "color", "id": "custom_badge_text", "label": "Badge text", "default": "#ffffff" }, { "type": "header", "content": "Debug" }, { "type": "checkbox", "id": "show_debug", "label": "Show debug information", "default": false, "info": "Enable to see detailed loading information in browser console and debug panel" } ], "presets": [ { "name": "Product listing" } ] } {% endschema %}