{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block javascript %}
<script>
eccube.productsClassCategories = {
{% for Product in pagination %}
"{{ Product.id|escape('js') }}": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
{% endfor %}
};
$(function() {
// 表示件数を変更
$('.disp-number').change(function() {
var dispNumber = $(this).val();
$('#disp_number').val(dispNumber);
$('#pageno').val(1);
$("#form1").submit();
});
// 並び順を変更
$('.order-by').change(function() {
var orderBy = $(this).val();
$('#orderby').val(orderBy);
$('#pageno').val(1);
$("#form1").submit();
});
$('.add-cart').on('click', function(e) {
var $form = $(this).parents('li').find('form');
// 個数フォームのチェック
var $quantity = $form.parent().find('.quantity');
if ($quantity.val() < 1) {
$quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
setTimeout(function() {
loadingOverlay('hide');
}, 100);
return true;
} else {
$quantity[0].setCustomValidity('');
}
e.preventDefault();
$.ajax({
url: $form.attr('action'),
type: $form.attr('method'),
data: $form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
$('.add-cart').prop('disabled', true);
}
}).done(function(data) {
// カートブロックを更新する
$.ajax({
url: '{{ url('block_cart') }}',
type: 'GET',
dataType: 'html'
}).done(function(html) {
$('.ec-headerRole__cart').html(html);
});
window.location.href = "{{ url('cart') }}";
}).fail(function(data) {
alert('{{ 'カートへの追加に失敗しました。'|trans }}');
}).always(function(data) {
// Buttonを有効にする
$('.add-cart').prop('disabled', false);
});
});
$('.reload').on('click', function(event) {
location.reload();
});
});
$('.ec-modal-overlay, .ec-modal .ec-inlineBtn--cancel').on('click', function() {
$('.ec-modal').hide()
});
</script>
{% endblock %}
{% block main %}
{% if search_form.category_id.vars.errors|length > 0 %}
<div class="ec-searchnavRole">
<p class="errormsg text-danger">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
</div>
{% else %}
<div class="ec-searchnavRole">
<form name="form1" id="form1" method="get" action="?">
{% for item in search_form %}
<input type="hidden" id="{{ item.vars.id }}"
name="{{ item.vars.full_name }}"
{% if item.vars.value is not empty %}
value="{{ item.vars.value }}"
{% endif %}
/>
{% endfor %}
</form>
<div class="ec-searchnavRole__topicpath">
<ol class="ec-topicpath">
<li class="ec-topicpath__item"><a href="{{ url('product_list') }}">{{ '全て'|trans }}</a>
</li>
{% if Category is not null %}
{% for Path in Category.path %}
<li class="ec-topicpath__divider">|</li>
<li class="ec-topicpath__item{% if loop.last %}--active{% endif %}"><a
href="{{ url('product_list') }}?category_id={{ Path.id }}">{{ Path.name }}</a>
</li>
{% endfor %}
{% endif %}
{% if search_form.vars.value and search_form.vars.value.name %}
<li class="ec-topicpath__divider">|</li>
<li class="ec-topicpath__item">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
{% endif %}
</ol>
</div>
<div>
<h3 style="width:940px;color:black;height:40px;">物件一覧表示</h3>
</div>
<div class="ec-searchnavRole__infos">
<div class="ec-searchnavRole__counter"style="width:600px;">
{% if pagination.totalItemCount > 0 %}
{{ '<span class="ec-font-bold">%count%件</span><span>の物件がございます</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
<div class="ec-pagerRole">
{% include "pager.twig" with {'pages': pagination.paginationData} %}
</div>
{% else %}
<span>{{ 'お探しの物件はございません'|trans }}</span>
{% endif %}
</div>
{% if pagination.totalItemCount > 0 %}
<div class="ec-searchnavRole__actions">
<div class="ec-select">
{{ form_widget(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }}
{{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
</div>
</div>
{% endif %}
</div>
</div>
<div id="right_column_mod" style="padding-left:15px;">
{% if pagination.totalItemCount > 0 %}
{% for Product in pagination %}
<li class="ec-shelfGrid__item">
{% set productClass = Product.getProductClasses() %}
{% set cartItem = repository('Eccube\\Entity\\CartItem').findBy({ProductClass: productClass[0]}) %}
<div class="box_021">
<a href="{{ url('product_detail', {'id': Product.id}) }}">
<h4 class="bold" style="background-image:url();">
<a href="{{ url('product_detail', {'id': Product.id}) }}">{{ Product.name }}</a>
</h4>
<p style="margin:3px 0;">
{{Product.main_comment}}
</p>
<!--product_img start-->
<div class="product_img_03_list" style="width:315px;"><a href="{{ url('product_detail', {'id': Product.id}) }}">
{% if Product.main_image is null %}
<img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" width="310" alt="" />
{% else %}
<img src="{{ asset(Product.main_image|no_image_product, 'save_image') }}" width="310" alt="" />
{% endif %}
<!--アイコン-->
<!--商品ステータス-->
<ul style="margin-top:3px;"><ul> </li></ul>
<!--商品ステータス-->
<!--アイコン-->
</div>
</a>
<!--product_cap start-->
<div class="product_cap_03">
<div class="box_04 clearfix" style="padding-top:0px;">
<table cellspacing="1" cellpadding="0" summary="" style="width:560px;padding: 0px;margin: 0px 0px 0px 0px;">
<tr>
<th style="width:140px; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">物件種別</th>
<td style="padding: 5px;text-align : left; background-color:#eef;color:#000000;width:120px;">{{Product.syubetu}}</td>
<th style="width:140px; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">物件種目</th>
<td style="padding: 5px;text-align : left; background-color:#eef; color:#000000">{{Product.syumoku}}</td>
</tr>
<tr>
<th style="width:140px; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">所在地</th>
<td colspan="3" style="padding: 5px;text-align : left; background-color:#eef; color:#000000;width:120px;">{{Product.pref}}{{Product.ku}}{{Product.adDetail}}</td>
</tr>
<tr>
<th style="; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">沿線・駅・交通</th>
<td colspan="3" style="padding: 5px;text-align : left; background-color:#eef; color:#000000;width:120px;">{{Product.ensen}}{{Product.station}}{{Product.stOther}}</td>
</tr>
<tr>
<th style="width:140px; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">間取り</th>
<td style="padding: 5px;text-align : left; background-color:#eef; color:#000000;width:120px;">{{Product.rmNum}}{{Product.rmType}}</td>
<th style="width:140px; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">建物面積 </th>
<td style="padding: 5px;text-align : left; background-color:#eef; color:#000000;width:120px;">{{Product.buildArea}} m<sup>2</sup></td>
</tr>
<tr>
<th style="width:140px; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">土地面積</th>
<td style="padding: 5px;text-align : left; background-color:#eef; color:#000000;width:120px;">{{Product.landArea}} m<sup>2</sup></td>
<th style="width:140px; padding:5px; background-color:#3A6A9B; color:#FFF; text-align:center; font-weight:normal;">価格</th>
<td style="padding: 5px;text-align : center; background-color:#eef; color:#000000;width:120px;">
{% if Product.getPrice02IncTaxMax==0%}
<font style="color:red; font-weight:bolder;">ご成約済</font>
{% elseif Product.getPrice02IncTaxMax==1 %}
<font style="color:red; font-weight:bolder;">商 談 中</font>
{% else %}
<font style="color:red; font-weight:bolder;">{{Product.getPrice02IncTaxMax}}万円</font>
{% endif %}
</td>
</tr>
<tr style="height:40px;">
<td colspan="2" align="center">
<a href="{{ url('product_detail', {'id': Product.id}) }}" onmouseover="chgImg('../html/user_data/assets/images/b_detail_h.gif','detail1');" onmouseout="chgImg('../html/user_data/assets/images/b_detail.gif','detail1');">
<img src="../html/user_data/assets/images/b_detail.gif" width="110" height="21" alt="詳しくはこちら" name="detail1" id="detail1" />
</a>
</td>
<td>
{#コメントアウト解除でリスト登録制御
{% if cartItem != null %}
<div class="ec-productRole__btn">
<button type="button" class="ec-blockBtn--cancel" disabled="disabled">
{{ 'リストへ追加済です'|trans }}
</button>
</div>
{% else %}
{% if Product.getPrice02IncTaxMax!=0 and Product.getPrice02IncTaxMax!=1 %}
ここまで#}
{% set form = forms[Product.id] %}
<form name="form{{ Product.id }}" id="productForm{{ Product.id }}" action="{{ url('product_add_cart', {id:Product.id}) }}" method="post">
<div class="ec-productRole__actions">
{% if form.classcategory_id1 is defined %}
<div class="ec-select">
{{ form_widget(form.classcategory_id1) }}
{{ form_errors(form.classcategory_id1) }}
</div>
{% if form.classcategory_id2 is defined %}
<div class="ec-select">
{{ form_widget(form.classcategory_id2) }}
{{ form_errors(form.classcategory_id2) }}
</div>
{% endif %}
{% endif %}
<!--<div class="ec-numberInput"><span>{{ '数量'|trans }}</span>--->
{{ form_widget(form.quantity, { attr : { 'class': 'quantity' , style : 'display:none;' } }) }}
{{ form_errors(form.quantity) }}
<!--</div>--->
</div>
{{ form_rest(form) }}
</form>
<div class="ec-productRole__btn">
<a type="button" class="add-cart" data-cartid="{{ Product.id }}" form="productForm{{ Product.id }}">
<img src="../../html/user_data/assets/images/b_box_in.gif" width="108" height="21" alt="カゴに入れる"style="margin:5px 0 0 0;"/>
</a>
</div>
{#コメントアウト解除でリスト登録制御{% elseif Product.getPrice02IncTaxMax==0 %}
<div class="ec-productRole__btn">
<button type="button" class="ec-blockBtn--cancel" disabled="disabled">
{{ 'ご成約済のためリストに追加できません'|trans }}
</button>
</div>
{% elseif Product.getPrice02IncTaxMax==1 %}
<div class="ec-productRole__btn">
<button type="button" class="ec-blockBtn--cancel" disabled="disabled">
{{ '商談中のためリストに追加できません'|trans }}
</button>
</div>
{% endif %}
ここまで#}
</td>
{#コメントアウト解除でリスト登録制御
{% endif %}
ここまで#}
</tr>
</div>
</table>
</div>
<!--/product_cap end-->
</div>
</div>
</li>
{% endfor %}
<div class="ec-pagerRole">
{% include "pager.twig" with {'pages': pagination.paginationData} %}
</div>
<!--/product_img end-->
</div>
</div>
{% endif %}
</div>
{% endif %}
{% endblock %}