テーマ仕様書 更新履歴
2021年
2021/12/14更新

2021/12/14更新

+ 追加した行
- 削除した行

マイページの定期管理にて、次回定期受注の商品追加、削除を行えるようにする

mypage > 定期注文詳細画面 商品情報

テーマ管理のファイルパス
ec_force/shop/customer/subs_orders/order_items/index.html.liquid
ec_force/shop/customer/subs_orders/order_items/index.html+smartphone.liquid

   <!-- 編集リンク -->
   {% if base_info.variant_changeable_on_mypage? %}
-    {% unless order_item.bundled_item? %}
+    {% if order_item.distribution_club? and order_item.distribution_club.changeable_on_mypage %}
+      <a href="/shop/customer/subs_orders/{{ subs_order.number }}/distribution_clubs/{{ order_item.distribution_club.id }}/edit">頒布会商品を編集する</a>
+    {% elsif order_item.bundled_item? == false and order_item.set? == false and order_item.distribution_club? == false and order_item.quantity_without_distribution_items != 0 %}
       <a href="/shop/customer/subs_orders/{{ subs_order.number }}/order_items/{{ order_item.id }}/edit">編集</a>
-    {% endunless %}
+    {% endif %}
   {% endif %}
 
   <!-- セット商品編集リンク -->
   {% if order_item.set? %}
     <a href="/shop/customer/subs_orders/{{ subs_order.number }}/sets/edit">セットの内容を編集する</a>
   {% endif %}
 
{% endfor %}
 
+<!-- 商品の追加(任意) -->
+{% assign order_item_ids = subs_order.order_items | map: 'variant_id' | join: ',' | split: ',' %}
+{% if products.size != 0 and base_info.variant_addable_on_mypage? and products_addable_on_mypage_in_all_variants %}
+  <div id="addable-product-view">
+    <div class="product-slides">
+      {% for product in products %}
+        {% assign flag = true %}
+        {% for oi in order_item_ids %}
+          {% assign id =  oi | plus: 0 %}
+          {% if product.master.id == id %}
+            {% assign flag = false %}
+          {% endif %}
+        {% endfor %}
+        {% if flag == true and product.master.products_addable_on_mypage == true and product.master.visible_in_cart %}
+          <a href="/shop/customer/subs_orders/{{ subs_order.number }}/order_items/add?product_number={{ product.number }}">
+            {% if product.thumbnail.url %}
+              {% assign src = product.thumbnail.url %}
+            {% else %}
+              {% assign src = 'missing' | image_url %}
+            {% endif %}
+            <img src="{{ src }}">
+          </a>
+          <p>{{ product.name | truncate: 35 }}</p>
+          <p>販売価格:<span>{{ product.first_price | number_to_currency: format: '%n %u' }}</span></p>
+          <a href="/shop/customer/subs_orders/{{ subs_order.number }}/order_items/add?product_number={{ product.number }}">
+            <button>追加する</button>
+          </a>
+        {% endif %}
+      {% endfor %}
+    </div>
+  </div>
+{% endif %}
+
 <!-- ポイント商品交換予約 -->  

mypage > 定期注文詳細画面 商品の編集

テーマ管理のファイルパス
ec_force/shop/customer/subs_orders/order_items/edit.html.liquid
ec_force/shop/customer/subs_orders/order_items/edit.html+smartphone.liquid

   <!-- ポイント交換予約キャンセル -->
   {% if base_info.use_point? and order_item.point_exchange_reserved? %}
     <a data-confirm="本当に予約キャンセルしますか?" rel="nofollow" data-method="delete" href="/shop/customer/subs_orders/{{ subs_order.number }}/point_exchange_reservations/{{ order_item.id }}">予約キャンセル</a>
+  {% elsif order_item.point_exchange_reserved? == false %}
+  <!-- 削除ボタン -->
+    <a data-confirm="本当に削除しますか?" data-method="delete" href="/shop/customer/subs_orders/{{ subs_order.number }}/order_items/{{ order_item.id }}">削除</a>
   {% endif %}
 </div>

mypage > 定期注文詳細画面 商品の追加

テーマ管理のファイルパス(新規ファイル)
ec_force/shop/customer/subs_orders/variants/show.html.liquid
ec_force/shop/customer/subs_orders/variants/show.html+smartphone.liquid

{% assign template = 'shop/customer/subs_orders/variants' %}
 
<div id="product-show-view">
 
  <!-- 商品画像 -->
  {% if product.thumbnail.url %}
    {% assign src = product.thumbnail.url %}
  {% else %}
    {% assign src = 'missing' | image_url %}
  {% endif %}
  <img src="{{ src }}" id="main-img">
  <div id="sub-images-view"></div>
 
  <!-- 商品名 -->
  {{ product.name }}
 
  <!-- 商品詳細(任意) -->
  {{ product.parsed_description }}
 
  <!-- 通常価格(任意) -->
  <span id="list-price">{{ product.master.list_price | number_to_currency: format: '%n %u' }}</span>
  <!-- 通常価格(税込み) -->
  <span id="list-price-include-tax">{{ product.master.list_price_include_tax | number_to_currency: format: '%n %u' }}</span>
 
  <!-- 販売価格 -->
  <span id="sales-price">{{ product.first_price | number_to_currency: format: '%n %u' }}</span>
  <!-- 販売価格(税込み) -->
  <span id="sales-price-include-tax">{{ product.first_price_include_tax | number_to_currency: format: '%n %u' }}</span>
 
  <!-- メーカー(任意) -->
  {{ product.maker.name }}
 
  <!-- メーカーURL(任意) -->
  {{ product.maker.url }}
 
  <!-- カテゴリー(任意) -->
  {% assign _category = '' %}
  {% for category in product.product_categories %}
    {% if category.product_category_visibility %}
      {% unless _category == '' %}
        {% assign _category = _category | append: ', ' %}
      {% endunless %}
      {% assign _category = _category | append: category.name %}
    {% endif %}
  {% endfor %}
  {{ _category }}
 
  <!-- 説明(任意) -->
  <div id="description">{{ product.master.parsed_description | simple_format }}</div>
 
  <!-- 商品選択フォーム -->
  <form action="/shop/customer/subs_orders/{{ params.id }}/variants/add"  method="post">
 
    <!-- オプション選択 -->
    <input id="product-id" type="hidden" name="product_id" value="{{ product.id }}">
    <input id="variant-id" type="hidden" name="variant_id" value="{{ product.master.id }}">
    <div id="option_types"></div>
 
    <!-- 数量選択 -->
    <label>数量</label>
    <input id="text-out-of-stock" value="在庫切れ" disabled style="display:none;">
    <select id="quantity" name="quantity" style="display:none;"></select>
 
    <!-- 次回のみお届け -->
    <label>次回のみお届け</label>
    <input class="radio-plain" name="onetime", type="radio", value="yes">はい
    <input class="radio-plain" name="onetime", type="radio", value="no">いいえ
    ※「いいえ」を選択した場合、毎回お届けいたします。
 
    <!-- 再入荷お知らせ -->
    <a id="btn-stock-waiting-list" href="javascript:void(0);" style='display:none;'>再入荷お知らせ</a>
 
    <!-- 定期便に追加 -->
    <button id="btn-add" style='display:none;'>定期便に追加</button>
  </form>
 
</div>

頒布会機能

※頒布会機能を利用しない場合はコード修正の必要はありません。

mypage > 定期注文画面 頒布会情報の編集

テーマ管理のファイルパス(新規ファイル)
ec_force/shop/customer/subs_orders/distribution_clubs/edit.html.liquid
ec_force/shop/customer/subs_orders/distribution_clubs/edit.html+smartphone.liquid

<!-- フラッシュメッセージ -->
{{ 'notice' | flash: 'alert alert-success', 'text' }}
{{ 'alert' | flash: 'alert alert-danger', 'text' }}
{{ 'error' | flash: 'alert alert-danger', 'text' }}
 
<!-- 頒布会選択商品変更フォーム -->
<form action="/shop/customer/subs_orders/{{ subs_order.number }}/distribution_clubs/{{ distribution_club.id }}" accept-charset="UTF-8" method="post">
  <input type="hidden" name="_method" value="put">
  {% for order_item in distribution_order_items %}
    {% for i in (1..order_item.distribution_item_quantity) %}
 
      <!-- 商品名 -->
      {% assign changeable_variants = changeable_variants_hash[order_item.id] %}
      {% if changeable_variants.size == 0 %}
        <!-- 頒布会選択商品名 -->
        {{ order_item.variant.name }}
      {% else %}
        <!-- 変更可能頒布会選択商品名(規格) -->
        <select class="form-control input-sm" name="select_items[{{order_item.id}}][][selected_variant_id]">
          {% for variant in changeable_variants %}
            {% if variant.option_values_presentation == blank %}
              {% capture product_options %}
                {{ variant.product.name }}
              {% endcapture %}
            {% else %}
              {% capture product_options %}
                {{ variant.product.name }}({{ variant.option_values_presentation }})
              {% endcapture %}
            {% endif %}
 
            <option value="{{ variant.id }}" {% if order_item.variant.id == variant.id %}selected{% endif %}>{{ product_options }}</option>
          {% endfor %}
        </select>
        <input name="select_items[{{order_item.id}}][][origin_variant_id]" type="hidden" value="{{ order_item.variant_id }}">
      {% endif %}
 
      <!-- 個数 -->
      1個
 
      <!-- 価格(税抜) -->
      0円
    {% endfor %}
  {% endfor %}
 
  <!-- 送信ボタン -->
  <input class="btn btn-primary btn-sm pull-right" id='submit' type="submit" value="保存">
 
  <!-- 戻るボタン -->
  <a href="/shop/customer/subs_orders/{{ subs_order.number }}/order_items">戻る</a>
</form>

mypage > 定期注文詳細画面 商品情報

テーマ管理のファイルパス
ec_force/shop/customer/subs_orders/order_items/index.html.liquid
ec_force/shop/customer/subs_orders/order_items/index.html+smartphone.liquid

   {% if order_item.set_item_selected? %}
     / {{ order_item.set_item_quantity }}個(セット商品)
   {% endif %}
+  {% if order_item.distribution_item_quantity != 0 %}
+    {% if order_item.quantity_without_distribution_items == 0 %}
+      (頒布会選択商品)
+    {% else %}
+      / {{ order_item.distribution_item_quantity }}個(頒布会選択商品)
+    {% endif %}
+  {% endif %}
+  {% if order_item.skip? %}
+    (次回スキップ)
+  {% endif %}
 
   <!-- 価格 -->

あわせて本ページ冒頭の「①マイページの定期管理にて、次回定期受注の商品追加、削除を行えるようにする」に記載の 「mypage > 定期注文詳細画面 商品情報」の変更も必要です。

cart > カート画面

テーマ管理のファイルパス
ec_force/shop/carts/show.html.liquid
ec_force/shop/carts/show.html+smartphone.liquid

       <form action="/shop/cart" method="post">
         <input name="_method" type="hidden" value="put">
         <input name="variant_id" type="hidden" value="{{ order_item.variant_id }}">
-
-        {% if order_item.set_item_quantity != 0 %}
+        {% if order_item.set_item_quantity != 0 or order_item.product.distribution_club or order_item.distribution_item_quantity != 0 %}
           <span>  {{ order_item.quantity }}個 </span>
         {% else %}
           <select name="quantity">
           <input type="submit" value="更新">
         {% endif %}
-        {% if order_item.set_item_quantity == 0 %}
+        {% if order_item.set_item_quantity == 0 and order_item.distribution_item_quantity == 0 %}
           <a rel="nofollow" data-method="delete" href="/shop/cart/delete?variant_id={{ order_item.variant_id }}">削除</a>
         {% endif %}
       </form>

その他軽微な修正

定期受注 配送サイクル表記の変更

cart > お届けサイクル(部分テンプレート)

テーマ管理のファイルパス
/ec_force/shop/orders/_view_payment_schedule.html.liquid
/ec_force/shop/orders/_view_payment_schedule.html+smartphone.liquid

           <option value='{{ d.month }}'>{{ d.month }}ヶ月</option>
         {% endfor %}
       </select>
-      <span>おきの</span>
+      <span>ごとの</span>
 
       <select class='validate[required]' id='select_scheduled_to_be_delivered_on_xth_day'>
         {% for d in (1..28) %}
          <option value='{{ d }}'>{{ d }}日</option>
        {% endfor %}
        <option value="99">末日</option>
      </select>
      <span>にお届け</span>
    </div>
 
    <!-- 間隔で指定 -->
    <div id='container_delivery_schedule_by_term' style='display:none;'>
      <select class='validate[required,custom[integer]]' id='select_scheduled_to_be_delivered_every_x_day'>
        {% for i in order.available_delivery_intervals %}
          <option value="{{ i.day }}">{{ i.day }}日</option>
        {% endfor %}
      </select>
      <span>間隔でお届け</span>
    </div>
 
    <!-- 曜日で指定 -->
    <div id='container_delivery_schedule_by_day_of_week' style='display:none;'>
      <select id='select_scheduled_to_be_delivered_every_x_month_by_day_of_week' class='validate[required]'>
        {% for d in order.available_delivery_dates %}
           <option value='{{ d.month }}'>{{ d.month }}ヶ月</option>
         {% endfor %}
       </select>
-      <span>おきの</span>
+      <span>ごとの</span>
       <select id='select_scheduled_to_be_delivered_on_xth_day_of_week' class='validate[required]'>
         {% for n in (1..4) %}
           <option value='{{ n }}'>{{ n }}</option>

mypage > 定期注文一覧画面

テーマ管理のファイルパス
ec_force/shop/customer/subs_orders/index.html.liquid
ec_force/shop/customer/subs_orders/index.html+smartphone.liquid

     <!-- 配送サイクル(任意) -->
     {% if subs_order.payment_schedule == 'date' %}
-      {{ subs_order.scheduled_to_be_delivered_every_x_month }}ヶ月おきの{% if subs_order.scheduled_to_be_delivered_on_xth_day == 99 %}末{% else %}{{ subs_order.scheduled_to_be_delivered_on_xth_day }}{% endif %}日に配送
+      {{ subs_order.scheduled_to_be_delivered_every_x_month }}ヶ月ごとの{% if subs_order.scheduled_to_be_delivered_on_xth_day == 99 %}末{% else %}{{ subs_order.scheduled_to_be_delivered_on_xth_day }}{% endif %}日に配送
     {% elsif subs_order.payment_schedule == 'term' %}
-      {{ subs_order.scheduled_to_be_delivered_every_x_day }}日おきに配送
+      {{ subs_order.scheduled_to_be_delivered_every_x_day }}日ごとに配送
     {% elsif subs_order.payment_schedule == 'day_of_week' %}
-      {{ subs_order.scheduled_to_be_delivered_every_x_month }}ヶ月おきの{{ subs_order.scheduled_to_be_delivered_on_xth_day_of_week }}回目の{{ subs_order.human_scheduled_to_be_delivered_every_x_day_of_week }}曜日に配送
+      {{ subs_order.scheduled_to_be_delivered_every_x_month }}ヶ月ごとの{{ subs_order.scheduled_to_be_delivered_on_xth_day_of_week }}回目の{{ subs_order.human_scheduled_to_be_delivered_every_x_day_of_week }}曜日に配送
     {% endif %}
 
     <!-- 次回配送予定日(任意) -->

mypage > 定期注文詳細画面 基本情報

テーマ管理のファイルパス
ec_force/shop/customer/subs_orders/show.html.liquid
ec_force/shop/customer/subs_orders/show.html+smartphone.liquid

 <!-- 配送間隔 -->
 {% if subs_order.payment_schedule == 'date' %}
-  {{ subs_order.scheduled_to_be_delivered_every_x_month }}ヶ月おきの{% if subs_order.scheduled_to_be_delivered_on_xth_day == 99 %}末{% else %}{{ subs_order.scheduled_to_be_delivered_on_xth_day }}{% endif %}日に配送
+  {{ subs_order.scheduled_to_be_delivered_every_x_month }}ヶ月ごとの{% if subs_order.scheduled_to_be_delivered_on_xth_day == 99 %}末{% else %}{{ subs_order.scheduled_to_be_delivered_on_xth_day }}{% endif %}日に配送
 
 {% elsif subs_order.payment_schedule == 'term' %}
-  {{ subs_order.scheduled_to_be_delivered_every_x_day }}日おきに配送
+  {{ subs_order.scheduled_to_be_delivered_every_x_day }}日ごとに配送
 
 {% elsif subs_order.payment_schedule == 'day_of_week' %}
-  {{ subs_order.scheduled_to_be_delivered_every_x_month}}ヶ月おきの{{ subs_order.scheduled_to_be_delivered_on_xth_day_of_week }}回目の{{ subs_order.human_scheduled_to_be_delivered_every_x_day_of_week }}曜日に配送
+  {{ subs_order.scheduled_to_be_delivered_every_x_month}}ヶ月ごとの{{ subs_order.scheduled_to_be_delivered_on_xth_day_of_week }}回目の{{ subs_order.human_scheduled_to_be_delivered_every_x_day_of_week }}曜日に配送
 {% endif %}
 
 <!-- お届け時間 -->

mypage > 定期注文詳細画面 基本情報の編集

テーマ管理のファイルパス
ec_force/shop/customer/subs_orders/edit.html.liquid
ec_force/shop/customer/subs_orders/edit.html+smartphone.liquid

          <!-- 日付で指定 -->
         <div id='container_delivery_schedule_by_date'>
-          <label for="subs_order_scheduled_to_be_delivered_every_x_month">何ヶ月おきの何日に配送</label>
+          <label for="subs_order_scheduled_to_be_delivered_every_x_month">何ヶ月ごとの何日に配送</label>
           <select class="validate[required]" name="subs_order[scheduled_to_be_delivered_every_x_month]" id="subs_order_scheduled_to_be_delivered_every_x_month">
             {% if subs_order.available_delivery_dates.size > 0 %}
               {% assign months = subs_order.available_delivery_dates | map: 'month' %}
              {% for m in months %}
                <option value="{{ m }}" {% if m == subs_order.scheduled_to_be_delivered_every_x_month %}selected{% endif %}>{{ m }}ヶ月</option>
              {% endfor %}
            {% else %}
              {% for m in (1..12) %}
                <option value="{{ m }}" {% if subs_order.scheduled_to_be_delivered_every_x_month == m %}selected{% endif %}>{{ m }}ヶ月</option>
               {% endfor %}
             {% endif %}
           </select>
-          おきの
+          ごとの
           <select class="validate[required]" name="subs_order[scheduled_to_be_delivered_on_xth_day]" id="subs_order_scheduled_to_be_delivered_on_xth_day">
             {% for d in (1..28) %}
               <option value="{{ d }}" {% if subs_order.scheduled_to_be_delivered_on_xth_day == d %}selected{% endif %}>{{ d }}日</option>
            {% endfor %}
            <option value="99" {% if subs_order.scheduled_to_be_delivered_on_xth_day == 99 %}selected{% endif %}>末日</option>
          </select>
          に配送
        </div>
 
         <!-- 間隔で指定 -->
         <div id='container_delivery_schedule_by_term'>
-          <label for="subs_order_scheduled_to_be_delivered_every_x_day">何日おきに配送</label>
+          <label for="subs_order_scheduled_to_be_delivered_every_x_day">何日ごとに配送</label>
           <select class="validate[required]" name="subs_order[scheduled_to_be_delivered_every_x_day]" id="subs_order_scheduled_to_be_delivered_every_x_day">
             {% if subs_order.available_delivery_intervals.size > 0 %}
               {% assign intervals = subs_order.available_delivery_intervals | map: 'day' %}
              {% for interval in intervals %}
                <option value="{{ interval }}" {% if interval == subs_order.scheduled_to_be_delivered_every_x_day %}selected{% endif %}>{{ interval }}日</option>
              {% endfor %}
            {% else %}
              {% assign least_interval = subs_order_settings['require_at_least_x_days_between_1st_and_2nd_orders'] %}
              {% for interval in (least_interval..30) %}
                <option value="{{ interval }}" {% if interval == subs_order.scheduled_to_be_delivered_every_x_day %}selected{% endif %}>{{ interval }}日</option>
              {% endfor %}
              <option value="60" {% if subs_order.scheduled_to_be_delivered_every_x_day == 60 %}selected{% endif %}>60日</option>
               <option value="90" {% if subs_order.scheduled_to_be_delivered_every_x_day == 90 %}selected{% endif %}>90日</option>
             {% endif %}
           </select>
-          おきに配送
+          ごとに配送
         </div>
 
         <!-- 曜日で指定 -->
         <div id='container_delivery_schedule_by_day_of_week'>
-          <label for="scheduled_to_be_delivered_every_x_month">何日おきに配送</label>
+          <label for="scheduled_to_be_delivered_every_x_month">何日ごとに配送</label>
           <select class="validate[required]" name="subs_order[scheduled_to_be_delivered_every_x_month]" id="subs_order_scheduled_to_be_delivered_every_x_month">
             {% if subs_order.available_delivery_dates.size > 0 %}
               {% assign months = subs_order.available_delivery_dates | map: 'month' %}
               {% for m in months %}
                <option value="{{ m }}" {% if subs_order.scheduled_to_be_delivered_every_x_month == m %}selected{% endif %}>{{ m }}ヶ月</option>
               {% endfor %}
            {% else %}
              {% for m in (1..12) %}
                <option value="{{ m }}" {% if subs_order.scheduled_to_be_delivered_every_x_month == m %}selected{% endif %}>{{ m }}ヶ月</option>
               {% endfor %}
             {% endif %}
           </select>
-          おきの
+          ごとの
 
           <select class="validate[required]" name="subs_order[scheduled_to_be_delivered_on_xth_day_of_week]" id="subs_order_scheduled_to_be_delivered_on_xth_day_of_week">
             {% for n in (1..4) %}

お気に入り 削除機能修正

mypage > お気に入り一覧画面

テーマ管理のファイルパス
ec_force/shop/customer/favorites/index.html.liquid
ec_force/shop/customer/favorites/index.html+smartphone.liquid

     {{ favorite.product.first_price | number_to_currency: format: '%n %u' }}
 
     <!-- 操作 -->
-    <a data-confirm="商品名:{{ favorite.product.name }} をお気に入りから削除しますか?" rel="nofollow" data-method="delete" href="/shop/customer/favorites/{{ favorite.id }}">削除</a>
+    <a data-confirm="商品名:{{ favorite.product.name }} をお気に入りから削除しますか?" rel="nofollow" data-method="delete" href="/shop/customer/favorites/{{ favorite.product.id }}">削除</a>
 
   {% endfor %}