<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* Block/recommend_for_top.twig */
class __TwigTemplate_eb22b2b7db89a814e627689a14056541 extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
'stylesheet' => [$this, 'block_stylesheet'],
'javascript' => [$this, 'block_javascript'],
'main' => [$this, 'block_main'],
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/recommend_for_top.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/recommend_for_top.twig"));
// line 1
$context["recommend_products"] = twig_get_attribute($this->env, $this->source, $this->env->getFunction('repository')->getCallable()("Plugin\\Recommend42\\Entity\\RecommendProduct"), "getRecommendProduct", [], "any", false, false, true, 1);
// line 2
echo "
";
// line 3
$this->displayBlock('stylesheet', $context, $blocks);
// line 224
echo "
";
// line 225
$this->displayBlock('javascript', $context, $blocks);
// line 256
echo "
";
// line 257
$this->displayBlock('main', $context, $blocks);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_stylesheet($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
// line 4
echo " <style>
.slick-slider {
margin-bottom: 30px;
}
.slick-dots {
position: absolute;
bottom: -25px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: \" \";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
.slick-prev, .slick-next {
font-size: 0;
line-height: 0;
position: absolute;
top: 50%;
display: block;
width: 60px;
height: 60px;
padding: 0;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);
cursor: pointer;
color: transparent;
border: none;
outline: none;
background: transparent;
}
.slick-prev {
left: 0;
z-index: 1;
height: 30px;
}
.slick-next {
right: 0;
z-index: 1;
height: 30px;
}
.slick-prev:before, .slick-next:before {
font-family: 'slick';
font-size: 40px;
line-height: 1;
opacity: 1;
color: white;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-prev:before {
content: \"\";
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.slick-next:before {
content: \"\";
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
";
// line 140
echo "
";
// line 147
echo "
";
// line 152
echo "
.slick-track{
position: relative;
top: 0;
left: 0;
display: flex;
margin-left: auto;
margin-right: auto;
}
.product_name{
font-size: 15px;
height: 40px;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
color: #1F9FCB;
margin-top: 8px;
}
.standardText {
color: #000000;
font-size: 12px;
padding-top: 8px;
padding-bottom: 8px;
}
.item_price {
color: black;
font-size: 18px;
font-weight: bold;
}
";
// line 188
echo " @media screen and (min-width: 1025px) {
/* .ec-sliderRole にホバーしたときだけ表示 */
.ec-sliderRole:hover .slick-prev:before,
.ec-sliderRole:hover .slick-next:before {
opacity: 1;
pointer-events: auto;
}
.slick-next:before {
content: \"\";
display: block;
width: 54px;
height: 54px;
background-image: url(/html/user_data/assets/img/common/btn_carousel_r_2.png);
background-size: contain;
margin-left: 40px;
}
.slick-prev:before {
content: \"\";
display: block;
width: 54px;
height: 54px;
background-image: url(/html/user_data/assets/img/common/btn_carousel_l_2.png);
background-size: contain;
margin-left: -40px;
}
}
";
// line 219
echo " @media screen and (max-width: 1024px) {
}
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 225
public function block_javascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
// line 226
echo " <script>
\$(function() {
let width = \$(window).width();
var photo_count = 2;
if (width <= 768) {
} else if (width <= 1024) {
// タブレット
photo_count = 4;
} else {
// PC
photo_count = 4;
}
\$('.main_visual_2').slick({
dots: false,
autoplay: false,
centerMode: true,
centerPadding: '10%',
arrows: true,
infinite: true,
slidesToShow: photo_count,
swipeToSlide: true,
touchMove: true,
touchThreshold: 10,
});
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 257
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 258
echo " <div class=\"block_content\" style=\"max-width: 1150px; margin: auto; padding-left: 10px; padding-right: 10px; margin-bottom: 0px;\">
<h2 style=\"font-size: 18px; margin-bottom: 16px;\">おすすめ商品</h2>
</div>
<div class=\"ec-sliderRole\" style=\"margin-bottom: 0px; padding: 0px 10px;\">
<div class=\"main_visual_2\" style=\"margin-bottom: 0px;\">
";
// line 263
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["recommend_products"]) || array_key_exists("recommend_products", $context) ? $context["recommend_products"] : (function () { throw new RuntimeError('Variable "recommend_products" does not exist.', 263, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["RecommendProduct"]) {
// line 264
echo " <div class=\"item slick-slide\" style=\"padding: 6px;\">
<a href=\"";
// line 265
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProduct"], "Product", [], "any", false, false, true, 265), "id", [], "any", false, false, true, 265)]), "html", null, true);
echo "\">
<img src=\"";
// line 266
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProduct"], "Product", [], "any", false, false, true, 266), "mainFileName", [], "any", false, false, true, 266), 266, $this->source)), "save_image"), "html", null, true);
echo "\" style=\"width: 320px; height: 136px; object-fit: cover; border-radius: 4px;\">
<dl>
";
// line 269
echo " <p class=\"product_name\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProduct"], "Product", [], "any", false, false, true, 269), "name", [], "any", false, false, true, 269), 269, $this->source), "html", null, true);
echo "</p>
";
// line 271
echo " <p class=\"standardText\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProduct"], "Product", [], "any", false, false, true, 271), "getStandardText", [], "any", false, false, true, 271), 271, $this->source), "html", null, true);
echo "</p>
<dd class=\"item_price\">
";
// line 273
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["RecommendProduct"], "Product", [], "any", false, false, true, 273), "getPrice02IncTaxMin", [], "any", false, false, true, 273), 273, $this->source)), "html", null, true);
echo "円
</dd>
</dl>
</a>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['RecommendProduct'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 279
echo " </div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "Block/recommend_for_top.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 407 => 279, 395 => 273, 389 => 271, 384 => 269, 379 => 266, 375 => 265, 372 => 264, 368 => 263, 361 => 258, 351 => 257, 312 => 226, 302 => 225, 288 => 219, 256 => 188, 219 => 152, 216 => 147, 213 => 140, 83 => 4, 73 => 3, 63 => 257, 60 => 256, 58 => 225, 55 => 224, 53 => 3, 50 => 2, 48 => 1,);
}
public function getSourceContext()
{
return new Source("{% set recommend_products = repository('Plugin\\\\Recommend42\\\\Entity\\\\RecommendProduct').getRecommendProduct %}
{% block stylesheet %}
<style>
.slick-slider {
margin-bottom: 30px;
}
.slick-dots {
position: absolute;
bottom: -25px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: \" \";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
.slick-prev, .slick-next {
font-size: 0;
line-height: 0;
position: absolute;
top: 50%;
display: block;
width: 60px;
height: 60px;
padding: 0;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);
cursor: pointer;
color: transparent;
border: none;
outline: none;
background: transparent;
}
.slick-prev {
left: 0;
z-index: 1;
height: 30px;
}
.slick-next {
right: 0;
z-index: 1;
height: 30px;
}
.slick-prev:before, .slick-next:before {
font-family: 'slick';
font-size: 40px;
line-height: 1;
opacity: 1;
color: white;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-prev:before {
content: \"\";
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.slick-next:before {
content: \"\";
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
{# .slick-prev:hover,
.slick-prev:focus,
.slick-next:hover,
.slick-next:focus {
color: transparent;
outline: none;
background: transparent;
} #}
{# .slick-prev:hover:before,
.slick-prev:focus:before,
.slick-next:hover:before,
.slick-next:focus:before {
opacity: 1;
} #}
{# .slick-prev.slick-disabled:before,
.slick-next.slick-disabled:before {
opacity: .25;
} #}
.slick-track{
position: relative;
top: 0;
left: 0;
display: flex;
margin-left: auto;
margin-right: auto;
}
.product_name{
font-size: 15px;
height: 40px;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
color: #1F9FCB;
margin-top: 8px;
}
.standardText {
color: #000000;
font-size: 12px;
padding-top: 8px;
padding-bottom: 8px;
}
.item_price {
color: black;
font-size: 18px;
font-weight: bold;
}
{# PC用スタイル #}
@media screen and (min-width: 1025px) {
/* .ec-sliderRole にホバーしたときだけ表示 */
.ec-sliderRole:hover .slick-prev:before,
.ec-sliderRole:hover .slick-next:before {
opacity: 1;
pointer-events: auto;
}
.slick-next:before {
content: \"\";
display: block;
width: 54px;
height: 54px;
background-image: url(/html/user_data/assets/img/common/btn_carousel_r_2.png);
background-size: contain;
margin-left: 40px;
}
.slick-prev:before {
content: \"\";
display: block;
width: 54px;
height: 54px;
background-image: url(/html/user_data/assets/img/common/btn_carousel_l_2.png);
background-size: contain;
margin-left: -40px;
}
}
{# スマホ&タブレット用スタイル #}
@media screen and (max-width: 1024px) {
}
</style>
{% endblock %}
{% block javascript %}
<script>
\$(function() {
let width = \$(window).width();
var photo_count = 2;
if (width <= 768) {
} else if (width <= 1024) {
// タブレット
photo_count = 4;
} else {
// PC
photo_count = 4;
}
\$('.main_visual_2').slick({
dots: false,
autoplay: false,
centerMode: true,
centerPadding: '10%',
arrows: true,
infinite: true,
slidesToShow: photo_count,
swipeToSlide: true,
touchMove: true,
touchThreshold: 10,
});
});
</script>
{% endblock javascript %}
{% block main %}
<div class=\"block_content\" style=\"max-width: 1150px; margin: auto; padding-left: 10px; padding-right: 10px; margin-bottom: 0px;\">
<h2 style=\"font-size: 18px; margin-bottom: 16px;\">おすすめ商品</h2>
</div>
<div class=\"ec-sliderRole\" style=\"margin-bottom: 0px; padding: 0px 10px;\">
<div class=\"main_visual_2\" style=\"margin-bottom: 0px;\">
{% for RecommendProduct in recommend_products %}
<div class=\"item slick-slide\" style=\"padding: 6px;\">
<a href=\"{{ url('product_detail', {'id': RecommendProduct.Product.id}) }}\">
<img src=\"{{ asset(RecommendProduct.Product.mainFileName|no_image_product, \"save_image\") }}\" style=\"width: 320px; height: 136px; object-fit: cover; border-radius: 4px;\">
<dl>
{# 商品名 #}
<p class=\"product_name\">{{ RecommendProduct.Product.name }}</p>
{# 規格 #}
<p class=\"standardText\">{{ RecommendProduct.Product.getStandardText }}</p>
<dd class=\"item_price\">
{{ RecommendProduct.Product.getPrice02IncTaxMin|number_format }}円
</dd>
</dl>
</a>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
", "Block/recommend_for_top.twig", "/home/shikomel/shikomel.com/public_html/web-order-stg.shikomel.com/app/template/default/Block/recommend_for_top.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 1, "block" => 3, "for" => 263);
static $filters = array("escape" => 265, "no_image_product" => 266, "number_format" => 273);
static $functions = array("repository" => 1, "url" => 265, "asset" => 266);
try {
$this->sandbox->checkSecurity(
['set', 'block', 'for'],
['escape', 'no_image_product', 'number_format'],
['repository', 'url', 'asset']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}