{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
{% block page_product_detail_buy_inner %}
<div class="product-detail-buy js-magnifier-zoom-image-container">
{% block page_product_detail_rich_snippets %}
{% block page_product_detail_rich_snippets_brand %}
{% if page.product.manufacturer %}
<meta itemprop="brand"
content="{{ page.product.manufacturer.translated.name }}"/>
{% endif %}
{% endblock %}
{% block page_product_detail_rich_snippets_gtin13 %}
{% if page.product.ean %}
<meta itemprop="gtin13"
content="{{ page.product.ean }}"/>
{% endif %}
{% endblock %}
{% block page_product_detail_rich_snippets_mpn %}
{% if page.product.manufacturerNumber %}
<meta itemprop="mpn"
content="{{ page.product.manufacturerNumber }}"/>
{% endif %}
{% endblock %}
{% block page_product_detail_rich_snippets_weight %}
{% if page.product.weight %}
<meta itemprop="weight"
content="{{ page.product.weight }} kg"/>
{% endif %}
{% endblock %}
{% block page_product_detail_rich_snippets_height %}
{% if page.product.height %}
<meta itemprop="height"
content="{{ page.product.height }} mm"/>
{% endif %}
{% endblock %}
{% block page_product_detail_rich_snippets_width %}
{% if page.product.width %}
<meta itemprop="width"
content="{{ page.product.width }} mm"/>
{% endif %}
{% endblock %}
{% block page_product_detail_rich_snippets_depth %}
{% if page.product.length %}
<meta itemprop="depth"
content="{{ page.product.length }} mm"/>
{% endif %}
{% endblock %}
{% block page_product_detail_rich_snippets_release_date %}
<meta itemprop="releaseDate"
content="{{ page.product.releaseDate|format_date(pattern="Y-MM-dd", locale=app.request.locale) }}"/>
{% endblock %}
{% endblock %}
{# {% if not feature('FEATURE_NEXT_16992') %} #}
{# #}{# @deprecated tag:v6.5.0 tag:)(FEATURE_NEXT_16992) - Block will be removed in v6.5.0 #}
{# {% block page_product_detail_not_available %} #}
{# {% endblock %} #}
{# {% endif %} #}
{% block page_product_detail_buy_container %}
<div itemprop="offers"
itemscope
itemtype="{% if page.product.calculatedPrices|length > 1 %}http://schema.org/AggregateOffer{% else %}http://schema.org/Offer{% endif %}">
{% block page_product_detail_configurator_include %}
{% if page.product.parentId and page.configuratorSettings|length > 0 %}
<div class="product-detail-configurator-container">
{% sw_include '@Storefront/storefront/page/product-detail/configurator.html.twig' %}
</div>
{% endif %}
{% endblock %}
{% block page_product_detail_custom_accessories %}
{% if page.extensions['accessoriesProductsLoad'].get('accessories_product') or page.extensions['accessoriesProductsLoad'].get('accessories_product') %}
<div class="product-detail-configurator-group-title">Passendes Zubehör</div>
{% endif %}
{% if page.extensions['accessoriesProductsLoad'].get('accessories_product') %}
{% for accessoriesProductsLoadStream in page.extensions['accessoriesProductsLoadStream'].get('accessories_product_stream') %}
<div class="product-accessories">
{% for accessoriesproduct in accessoriesProductsLoadStream %}
<div class="pro-detail-configurator" style="cursor: pointer;"
id="custom-ass-{{ accessoriesproduct.id }}"
onclick="setAccessoriesproduct('{{ accessoriesproduct.id }}')">
<div class="pp-box1">
{% if accessoriesproduct.cover.media.url %}
<img src="{{ accessoriesproduct.cover.media.url }}" alt="aou">
{% else %}
<img src="/bundles/radfabriktheme/assets/images/aou.png" alt="aou">
{% endif %}
</div>
<div class="pp-box2">
<h5 class="pro-head">{{ accessoriesproduct.translated.name }}</h5>
<p>
<a href="{{ rawUrl('frontend.detail.page', { 'productId': accessoriesproduct.id }, salesChannel.domain|first.url) }}">Mehr
Produktinfos</a></p>
{% if accessoriesproduct.deliveryTime.id == '32c6890dcfe34dae9ef1c16320b3afc2' %}
<a class="deliverd color-green"
style="color: #26c156;">• {{ accessoriesproduct.deliveryTime.name }}</a>
{% else %}
<a class="deliverd color-green"
style="color: #f89d0e;">• {{ accessoriesproduct.deliveryTime.name }}</a>
{% endif %}
</div>
<div class="pp-box3">
<div class="line-through-price">
{% if price.listPrice.price %}
<span class="line-price">{{ price.listPrice.price|currency }}</span>
{% endif %}
{% set price = accessoriesproduct.calculatedPrice %}
{% if accessoriesproduct.calculatedPrices|length == 0 %}
<span class="p-price">{{ price.unitPrice|currency }}</span>
{% endif %}
</div>
<a class="click-icon" id="click-icon-accessories"> +</a>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
{% endif %}
{% if page.extensions['accessoriesProductsLoad'].get('accessories_product') %}
<div class="product-accessories">
{% for accessoriesproduct in page.extensions['accessoriesProductsLoad'].get('accessories_product') %}
<div class="pro-detail-configurator" style="cursor: pointer;"
id="custom-ass-{{ accessoriesproduct.id }}"
onclick="setAccessoriesproduct('{{ accessoriesproduct.id }}')">
<div class="pp-box1">
{% if accessoriesproduct.cover.media.url %}
<img src="{{ accessoriesproduct.cover.media.url }}" alt="aou">
{% else %}
<img src="/bundles/radfabriktheme/assets/images/aou.png" alt="aou">
{% endif %}
</div>
<div class="pp-box2">
<h5 class="pro-head">{{ accessoriesproduct.translated.name }}</h5>
<p><a target="_blank"
href="{{ seoUrl('frontend.detail.page', { 'productId': accessoriesproduct.id }, salesChannel.domain|first.url) }}">Mehr
Produktinfos</a></p>
{% if accessoriesproduct.deliveryTime.id == '32c6890dcfe34dae9ef1c16320b3afc2' %}
<a class="deliverd color-green"
style="color: #26c156;">• {{ accessoriesproduct.deliveryTime.name }}</a>
{% else %}
<a class="deliverd color-green"
style="color: #f89d0e;">• {{ accessoriesproduct.deliveryTime.name }}</a>
{% endif %}
</div>
<div class="pp-box3">
<div class="line-through-price">
{% if accessoriesproduct.calculatedPrice.listPrice %}
<span class="line-price">{{ "UVP" }} {{ accessoriesproduct.calculatedPrice.listPrice.price|currency }}</span>
{% endif %}
{% set price = accessoriesproduct.calculatedPrice %}
{% if accessoriesproduct.calculatedPrices|length == 0 %}
<span class="p-price">{{ price.unitPrice|currency }}</span>
{% endif %}
</div>
<a class="click-icon" id="click-icon-accessories"> +</a>
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block page_product_detail_data %}
{% block page_product_detail_data_rich_snippet_url %}
<meta itemprop="url"
content="{{ seoUrl('frontend.detail.page', { productId: page.product.id }) }}"/>
{% endblock %}
{% block page_product_detail_data_rich_snippet_price_range %}
{% if page.product.calculatedPrices|length > 1 %}
{% set lowestPrice = false %}
{% set highestPrice = false %}
{% for price in page.product.calculatedPrices %}
{% if not lowestPrice or price.unitPrice < lowestPrice %}
{% set lowestPrice = price.unitPrice %}
{% endif %}
{% if not highestPrice or price.unitPrice > highestPrice %}
{% set highestPrice = price.unitPrice %}
{% endif %}
{% endfor %}
<meta itemprop="lowPrice" content="{{ lowestPrice }}"/>
<meta itemprop="highPrice" content="{{ highestPrice }}"/>
<meta itemprop="offerCount" content="{{ page.product.calculatedPrices|length }}"/>
{% endif %}
{% endblock %}
{% block page_product_detail_data_rich_snippet_price_currency %}
<meta itemprop="priceCurrency"
content="{{ context.currency.translated.shortName }}"/>
{% endblock %}
{% block page_product_detail_price %}
{% if (config('AmMacTradeCustomPlugins.config.amMacTradeInsuranceWarranty')) %}
{% set insurance_warranty = page.extensions['insurance_warranty'].all() %}
{% if page.extensions['insurance_warranty'] is not null %}
<div class="product-details-insurance-warranty">
<div class="product-detail-configurator-group-title">
{{ insurance_warranty['insurance_title'] }}
<div class="info-text"></div>
<a href="https://www.mactrade.de/garantiepaket" target="_blank"
title="{{ "macTrade.pdp.moreInformationText"|trans|sw_sanitize }}">{{ "macTrade.pdp.moreInformationText"|trans|sw_sanitize }}</a>
</div>
<div class="product-detail-configurator-option">
<input type="radio" name="ammactrade-insurance-warranty"
value="{{ insurance_warranty['insurance_prod_id'] }}"
class="product-detail-configurator-option-input-insurance-warranty is-combinable"
title="{{ "macTrade.pdp.insuranceProductTitle"|trans|sw_sanitize }}"
id="ammactrade-insurance-warranty" onclick="insurance_warranty_change(this);">
<label class="product-detail-configurator-option-label is-combinable is-display-text"
title="{{ insurance_warranty['insurance_name'] }}" for="ammactrade-insurance-warranty">
<div class="insurance_details_option">
<div class="insurance_details_option_img">
{% if page.insurance is not null %}
{% if page.insurance.cover.media.url %}
<img src="{{ page.insurance.cover.media.url }}" width="50px"/>
{% else %}
{% sw_icon 'placeholder' style {
'default': '100px'
} %}
{% endif %}
{% endif %}
</div>
<div class="insurance_details_option_title">
{{ insurance_warranty['insurance_name'] }}
</div>
<div class="insurance_details_option_price">
+ {{ insurance_warranty['insurance_price']|number_format(2, ',', '.') }} €
</div>
</div>
<div class="insurance_details_option_desc">
{{ insurance_warranty['insurance_desc']|raw }}
</div>
</label>
<input type="radio" name="ammactrade-insurance-warranty" value="0"
class="product-detail-configurator-option-input-insurance-warranty is-combinable"
title="{{ "macTrade.pdp.insuranceProductTitle"|trans|sw_sanitize }}"
id="ammactrade-insurance-warranty0" checked="checked"
onclick="insurance_warranty_change(this);">
<label class="product-detail-configurator-option-label is-combinable is-display-text"
title="{{ "macTrade.pdp.noInsuranceProduct"|trans|sw_sanitize }}"
for="ammactrade-insurance-warranty0">
{{ insurance_warranty['insurance_no'] }}
</label>
</div>
</div>
<script>
function insurance_warranty_change(t) {
var input_product_insurance = document.getElementsByClassName("product-insurance");
for (var i = 0; i < input_product_insurance.length; i++) {
input_product_insurance[i].value = t.value;
}
};
</script>
{% endif %}
{{ parent() }}
{% else %}
{{ parent() }}
{% endif %}
<div class="main-mc-block">
<div class="product-detail-price-container">
{% sw_include '@Storefront/storefront/page/product-detail/buy-widget-price.html.twig' %}
</div>
{% block page_product_detail_tax %}
<div class="product-detail-tax-container">
{% if context.taxState == "gross" %}
{% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
{% else %}
{% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
{% endif %}
<p class="product-detail-tax">
{% block page_product_detail_tax_link %}
<a class="product-detail-tax-link"
href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
title="{{ taxText }}"
data-toggle="modal"
data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
{{ taxText }}
</a>
{% endblock %}
</p>
</div>
{% endblock %}
{% if page.product.customFields.product_custom_fields_feed_voucher_price_string %}
{% if context.salesChannel.id !='45be9f42765d42e8ae1137d1812040f4' && context.salesChannel.id !='28cc3b3554794114a8df96aeca8d78ae' %}
<div class="product-detail-promotion-container">
<div class="promotion-icon">
<img src="{{ asset('assets/images/discount.svg', "@AmMacTrade") }}" alt="Rabatt">
</div>
<div class="promotion-text">
Auch für
<span> {{ page.product.customFields.product_custom_fields_feed_voucher_price_string|number_format(2, ',', '.') }} €</span>
zinsfrei finanzieren mit dem Gutscheincode:
<span>{{ page.product.customFields.product_custom_fields_feed_voucher_text }}</span>
<div class="promotion-link">Mehr Infos <a
href="{{ page.product.customFields.product_custom_fields_feed_voucher_promotion_link }}"
target="_blank"></a></div>
</div>
</div>
{% endif %}
{% endif %}
{% set remoteClickOptions = {
selector: "#review-tab",
scrollToElement: true
} %}
{% block page_product_detail_reviews %}
{% if page.product.ratingAverage > 0 and page.reviews.totalReviews > 0 and config('core.listing.showReview') %}
<div class="product-detail-reviews">
{% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
points: page.product.ratingAverage,
style: 'text-primary'
} %}
<a data-toggle="tab"
class="product-detail-reviews-link"
data-offcanvas-tabs="true"
data-remote-click="true"
data-remote-click-options='{{ remoteClickOptions|json_encode }}'
href="#review-tab-pane"
aria-controls="review-tab-pane">
{{ page.reviews.totalReviews }}
{{ "detail.reviewLinkText"|trans({'%count%': page.reviews.totalReviews})|sw_sanitize }}
</a>
</div>
{% endif %}
{% endblock %}
{% endblock %}
{% block page_product_detail_buy_form %}
{% if page.product.active %}
<div class="product-detail-form-container">
{% sw_include '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
</div>
{% endif %}
{% endblock %}
{% block page_product_detail_delivery_informations %}
<div class="product-detail-delivery-information">
{% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %}
</div>
{% endblock %}
{% block page_product_detail_ordernumber_container %}
{% if page.product.productNumber %}
<div class="product-detail-ordernumber-container">
{% block page_product_detail_ordernumber_label %}
<span class="product-detail-ordernumber-label">
{{ "detail.productNumberLabel"|trans|sw_sanitize }}
</span>
{% endblock %}
{% block page_product_detail_ordernumber %}
<meta itemprop="productID"
content="{{ page.product.id }}"/>
<span class="product-detail-ordernumber"
itemprop="sku">
{{ page.product.productNumber }}
</span>
{% endblock %}
</div>
{% endif %}
{% if page.product.manufacturerNumber %}
<div class="product-detail-ordernumber-container" style="margin-top: -10px;">
<span class="product-detail-ordernumber-label">
Herstellernummer:
</span>
<span class="product-detail-ordernumber"
itemprop="sku">
{{ page.product.manufacturerNumber }}
</span>
</div>
{% endif %}
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
{% if config('core.cart.wishlistEnabled') %}
{% block page_product_detail_wishlist %}
{% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
showText: true,
size: 'md',
productId: page.product.id
} %}
{% endblock %}
{% endif %}
{% block page_product_detail_c2_widget %}
{# {% if page.product.customFields.product_custom_fields_subscription == 1 and page.product.restockTime <= 10 %} #}
{% if page.product.customFields.product_custom_fields_subscription == true and (page.product.customFields.product_custom_fields_subscription_productType != 'ACCESSORY') and page.product.customFields.product_custom_fields_subscription_monthlyPriceGross > 0 %}
<div class="product-detail-c2-widget-container">
<div class="mac-abo-block">
<div class="abo1">
<script>
var button
function initWi() {
button = new wi({
productId: "{{ page.product.productNumber }}",
trackingId: "",
color: "FFFFFF",
backgroundColor: "4A4A49",
hoverColor: "FFFFFF",
hoverBackgroundColor: "042e41",
//poweredBy: "powered by c2 [circle]",
poweredBy: "",
widgetTitle: "",
retailerTitle: "MacTrade Abo",
manufacturerTitle: "",
button: "MacTrade Abo starten",
priceCopy: "/Monat ({{ page.product.customFields.product_custom_fields_subscription_durationInMonths }} Mon.)",
marketingLinkText: "Mehr Infos",
marketingURL: "/mactrade-abo/",
API: "https://backend.c2-circle.com",
merchantIdentifier: "mactrade",
buttonType: "large"
})
button.render(document.querySelectorAll("[data-wi-id=wi-button-container]"))
}
(function () {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://www.c2-circle.com/partner/static/mactrade/script.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
</script>
<script>
//var newProductId = "{{ page.product.productNumber }}"
//button.updateProduct(document.querySelectorAll("[data-wi-id=wi-button-container]"), newProductId)
</script>
<div data-wi-id="wi-button-container"></div>
<script>
setTimeout(function () {
var wiPrice = $(".wi-price").html();
wiPrice = wiPrice.trim();
console.log(wiPrice);
var wiPriceArr = wiPrice.split(" ");
$(".wi-price").html(wiPriceArr[1] + " " + wiPriceArr[0] + "*");
}, 1500);
console.log("Kaufen=========");
console.log('{{ page.extensions['amMactradeap1'].get('keyApi') }}');
</script>
</div>
{# start #}
{% if page.extensions['amMactradeap1'].get('keyApi') %}
<div class="abo2-right">
<h3>Gutschrift für Ihr Altgerät</h3>
<div class="price-txt-zw"><p>zwischen</p>
<h2 class='price_range_block'></h2></div>
<p class="price-mid-txt">
{{ page.extensions['amMactradeap1'].get('keyApiText') }}
</p>
<button class="btn-black"
onclick="javascript:window.open('https://mactrade.kauft-an.de/', '_blank');">
Ankaufspreis ermitteln
</button>
<div class="powe-line"><a href="https://mactrade.kauft-an.de/mactrade_c/hilfe/" target="_blank"
class="small-link">Mehr Infos </a>
<p>powered by kauft-an</p></div>
</div>
<script>
var categoryName = '{{ page.product.customFields.product_custom_fields_product_family }}';
//var categoryName = '{{ name }}';
var kaufenCatId = '';
if (categoryName == 'MAC') {
kaufenCatId = 110;
} else if (categoryName == 'IPAD') {
kaufenCatId = 3;
} else if (categoryName == 'IPHONE') {
kaufenCatId = 18;
} else if (categoryName == 'WATCH') {
kaufenCatId = 102;
} else if (categoryName == 'ACCESSORIES') {
kaufenCatId = 320;
} else if (categoryName == 'MacBook Air') {
kaufenCatId = 6;
}
kaufenCatId = '{{ page.extensions['amMactradeap1'].get('keyApi') }}';
fetch('https://api.kauft-an.de/api/v1/product.pricerange/' + kaufenCatId, {
headers: {
'Authorization': 'Bearer 6|a46tPuG1bkeMaXx9JoxyI1VAC0LdSHOdalgqspem'
}
})
.then(response => response.json())
.then(data => {
// Process the retrieved data
console.log(data);
document.querySelector('[class^="price_range_block"]').innerHTML = data.result.min_price + ' € - ' + data.result.max_price + ' €*';
document.querySelector('[class^="price_range"]').innerHTML = data.result.min_price + ' € - ' + data.result.max_price + ' €*';
})
.catch(error => {
// Handle any errors that occurred during the API call
console.error(error);
});
</script>
{% endif %}
{# end #}
</div>
</div>
{% else %}
<div class="product-detail-c2-widget-container
{% if category %}
{% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
{% for breadcrumbCategory in breadcrumbCategories %}
{% set key = breadcrumbCategory.id %}
{% set name = breadcrumbCategory.translated.name %}
{% if loop.index == 1 %}
{% if name == 'Zubehör' %}
d-none
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
">
<div class="mac-abo-block">
{% if page.extensions['amMactradeap1'].get('keyApi') %}
<div class="abo2-right">
<h3>Gutschrift für Ihr Altgerät</h3>
<div class="price-txt-zw"><p>zwischen</p>
<h2 class='price_range_block'></h2></div>
<p class="price-mid-txt">für Ihr altes
{% set category = page.header.navigation.active %}
{% if category %}
{% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
{% set categoryId = category.id %}
{% for breadcrumbCategory in breadcrumbCategories %}
{% set key = breadcrumbCategory.id %}
{% set name = breadcrumbCategory.translated.name %}
{% if loop.index == 2 %}
{{ name }}
{% endif %}
{% endfor %}
{% endif %}
</p>
<button class="btn-black"
onclick="javascript:window.open('https://mactrade.kauft-an.de/', '_blank');">
Ankaufspreis ermitteln
</button>
<div class="powe-line"><a href="https://mactrade.kauft-an.de/mactrade_c/hilfe/" target="_blank"
class="small-link">Mehr Infos </a>
<p>powered by kauft-an</p></div>
</div>
<script>
var categoryName = '{{ page.product.customFields.product_custom_fields_product_family }}';
var kaufenCatId = '';
if (categoryName == 'MAC') {
kaufenCatId = 110;
} else if (categoryName == 'IPAD') {
kaufenCatId = 3;
} else if (categoryName == 'IPHONE') {
kaufenCatId = 18;
} else if (categoryName == 'WATCH') {
kaufenCatId = 102;
} else if (categoryName == 'ACCESSORIES') {
kaufenCatId = 320;
}
kaufenCatId = '{{ page.extensions['amMactradeap1'].get('keyApi') }}';
fetch('https://api.kauft-an.de/api/v1/product.pricerange/' + kaufenCatId, {
headers: {
'Authorization': 'Bearer 6|a46tPuG1bkeMaXx9JoxyI1VAC0LdSHOdalgqspem'
}
})
.then(response => response.json())
.then(data => {
// Process the retrieved data
console.log(data);
document.querySelector('[class^="price_range_block"]').innerHTML = data.result.min_price + ' € - ' + data.result.max_price + ' €*';
document.querySelector('[class^="price_range"]').innerHTML = data.result.min_price + ' € - ' + data.result.max_price + ' €*';
})
.catch(error => {
// Handle any errors that occurred during the API call
console.error(error);
});
//$(".wi-price").append("*");
</script>
{% endif %}
{# end #}
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
<script>
function setAccessoriesproduct(idValue) {
if (!$('.setValueDynamic-' + idValue).html()) {
console.log($('.setValueDynamic-' + idValue).html())
$('#custom-ass-' + idValue).css('border', '2px solid #1c516c');
$('#custom-ass-' + idValue).addClass('border-dark');
$('.setValueDynamic-' + idValue).html('<input type=hidden name=lineItems[' + idValue + '][id] class=product-accessories-id-' + idValue + ' value=' + idValue + '><input type=hidden name=lineItems[' + idValue + '][referencedId] value=' + idValue + ' ><input type=hidden name=lineItems[' + idValue + '][quantity] value=1 ><input type=hidden name=lineItems[' + idValue + '][stackable] value=1 ><input type=hidden name=lineItems[' + idValue + '][removable] value=1 ><input type=hidden name=lineItems[' + idValue + '][type] value=product >');
} else {
$('.setValueDynamic-' + idValue).html('');
$('#custom-ass-' + idValue).css('border', '1px solid #d0d0d0');
$('#custom-ass-' + idValue).removeClass('border-dark');
}
}
</script>
</div>
{% endblock %}