ANB
April 3, 2020, 3:20am
1
まだ、コードのカスタマイズは始めたばかりで、作業中に問題が起きました。
どなたか、アドバイスをいただけないでしょうか。
{% include 'product-price', variant: current_variant, show_vendor: section.settings.show_vendor %}
の後ろの行にコードの貼り付けをし、その後反映がされなかったため取り消した後、商品詳細ページに以下の問題が起きました。
①税込み表示と配送料が同じ列になった。
liquid上の修正場所がわからない。
②セール表示の時の価格の出方が変わった。
③自分のいじった場所の下のコードを初期設定と比べてみたら
{%- if current_variant.available == false %} product-form–variant-sold-out {%- endif -%}
がなくなっていました。
このコードは必須コードなのか、カスタマイズ(コード以外の)で選択されたものなのでしょうか?
初歩的な質問で恐縮ですが、まだ勉強中のため、教えていただけたら助かります。
よろしくお願いいたします。
とりあえず今の情報だけだと限定的過ぎて原因究明しずらいように感じます。
前後のコードをすべてを表示したほうが解決が早いかと。
あとはincludeされている方の product-price のliquidもあったほうがいいでしょうね。
ANB
April 7, 2020, 10:30am
3
WEBUILDさん ありがとうございます。
とりあえずschema前を全部コピペしました。またincludしているほうの product-price のliquidとはオリジナルのテーマリキッドでしょうか?
特にオリジナルでカスタマイズはてないです。(操作ミスでコードを消している可能性はありまがす)
よろしくお願いいたします。
現状<div class=“product-template__container page-width”
id=“ProductSection-{{ section.id }}”
data-section-id=“{{ section.id }}”
data-section-type=“product”
data-enable-history-state=“true”
data-ajax-enabled=“{{ settings.enable_ajax }}”
{% comment %}
Get first variant, or deep linked one
{% endcomment %}
{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign product_image_zoom_size = ‘1024x1024’ -%}
{%- assign product_image_scale = ‘2’ -%}
{%- assign enable_zoom = section.settings.enable_zoom -%}
{%- assign compare_at_price = current_variant.compare_at_price -%}
{%- assign price = current_variant.price -%}
{% case section.settings.image_size %}
{% when ‘small’ %}
{%- assign product_image_width = ‘medium-up–one-third’ -%}
{%- assign product_description_width = ‘medium-up–two-thirds’ -%}
{%- assign product_thumbnail_width = ‘medium-up–one-third’ -%}
{%- assign height = 345 -%}
{% when ‘medium’ %}
{%- assign product_image_width = ‘medium-up–one-half’ -%}
{%- assign product_description_width = ‘medium-up–one-half’ -%}
{%- assign product_thumbnail_width = ‘medium-up–one-quarter’ -%}
{%- assign height = 530 -%}
{% when ‘large’ %}
{%- assign product_image_width = ‘medium-up–two-thirds’ -%}
{%- assign product_description_width = ‘medium-up–one-third’ -%}
{%- assign product_thumbnail_width = ‘medium-up–one-fifth’ -%}
{%- assign height = 720 -%}
{% when ‘full’ %}
{%- assign product_image_width = ‘’ -%}
{%- assign product_description_width = ‘’ -%}
{%- assign product_thumbnail_width = ‘medium-up–one-eighth’ -%}
{%- assign height = 1090 -%}
{%- assign enable_zoom = false -%}
{% endcase %}
{%- assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image -%}
{% for image in product.images %}
{% capture img_id %}FeaturedImage-{{ section.id }}-{{ image.id }}{% endcapture %}
{% capture img_class %}product-featured-img{% endcapture %}
{% capture zoom_img_id %}FeaturedImageZoom-{{ section.id }}-{{ image.id }}{% endcapture %}
{% capture img_wrapper_id %}{{ zoom_img_id }}-wrapper{% endcapture %}
{% comment ls-rpl %}{%- assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}{% endcomment %}{%- capture LS_IMG_URL -%}{%- render "ls-img-url", image: image, img_url: '1x1' -%}{%- endcapture -%}{%- assign img_url = LS_IMG_URL | replace: '_1x1.', '_{width}x.' -%}{% comment /ls-rpl %}{% endcomment %}
{% include ‘image-style’, image: image, height: height, wrapper_id: img_wrapper_id, img_id: img_id %}
{% endfor %}
{% capture product_image_size %}{{ height }}x{% endcapture %}
{% if product.images.size > 1 %}
{% if product.images.size > 3 %}
{%- assign enable_thumbnail_slides = true -%}
{% endif %}
{% if enable_thumbnail_slides == true %}
{% include 'icon-chevron-left' %}
{{ 'sections.slideshow.previous_slide' | t }}
{% endif %}
{% for image in product.images %}
{% endfor %}
{% if enable_thumbnail_slides == true %}
{% include 'icon-chevron-right' %}
{{ 'sections.slideshow.next_slide' | t }}
{% endif %}
{% endif %}
{{ product.title }}
{% include 'product-price', variant: current_variant, show_vendor: section.settings.show_vendor %}
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}
{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- endif -%}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}
{%- endif -%}
{% capture “form_classes” -%}
product-form product-form-{{ section.id }}{% unless section.settings.show_variant_labels %} product-form–hide-variant-labels{% endunless %}{% if section.settings.enable_payment_button and product.has_only_default_variant%} product-form–payment-button-no-variants{% endif %}
{%- endcapture %}
{% form ‘product’, product, class:form_classes, novalidate: ‘novalidate’, data-product-form: ‘’ %}
{% unless product.has_only_default_variant %}
{% for option in product.options_with_values %}
{{ option.name }}
{% for value in option.values %}
{{ value }}
{% endfor %}
{% endfor %}
{% endunless %}
{% for variant in product.variants %}
{% if variant.available %}
{{ variant.title }}
{% else %}
{{ variant.title }} - {{ 'products.product.sold_out' | t }}
{% endif %}
{% endfor %}
{% if section.settings.show_quantity_selector %}
{{ 'products.product.quantity' | t }}
{% endif %}
{{ 'general.accessibility.error' | t }}
{% include 'icon-error' %}
{{ 'products.product.quantity_minimum_message' | t }}
{% unless current_variant.available %}
{{ 'products.product.sold_out' | t }}
{% else %}
{{ 'products.product.add_to_cart' | t }}
{% endunless %}
{% include 'icon-spinner' %}
{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}
{% endform %}
{%- comment -%}
Live region for announcing updated price and availability to screen readers
{%- endcomment -%}
{%- comment -%}
Live region for announcing that the product form has been submitted and the
product is in the process being added to the cart
{%- endcomment -%}
{{ 'products.product.loader_label' | t }}
{{ product.description }}
{% if section.settings.show_share_buttons %}
{% include ‘social-sharing’, share_title: product.title, share_permalink: product.url, share_image: product %}
{% endif %}
{% unless product == empty %}
{% endunless %}