{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
{% block page_product_detail_tax %}
<div class="product-detail__price-info-grid">
<span class="price-unit-reference-content">
{% if page.product.purchaseUnit %}
{% set price = page.product.calculatedPrice %}
{% if page.product.calculatedPrices|length == 1 %}
{% set price = page.product.calculatedPrices.first %}
{% endif %}
{% if price.referencePrice is not null %}
{% block page_product_detail_price_unit_reference_content %}
{{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }} = {{ price.referencePrice.price|currency }}
{% endblock %}
{% endif %}
{% endif %}
</span>
<span class="text-primary">
{% if doncarneConfig.weightBasedBilling is not null %}
{% set weightBasedBillingId = doncarneConfig.weightBasedBilling %}
<a class="product-detail__shipping-info"
href="{{ path('frontend.cms.page',{ id: weightBasedBillingId }) }}"
title = "{{"productDetail.weightBasedPricing"|trans|sw_sanitize}}"
{{ dataBsToggleAttr }}="modal"
data-url="{{ path('frontend.cms.page',{ id: weightBasedBillingId }) }}"
>
{{"productDetail.weightBasedPricing"|trans|sw_sanitize}}
</a>
{% endif %}
</span>
<span>
{% if context.taxState == "gross" %}
{{"general.shortTaxInfoGross"|trans|sw_sanitize}}
{% else %}
{{"general.shortTaxInfoNet"|trans|sw_sanitize}}
{% endif %}
</span>
<a class="product-detail__shipping-info"
href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
title="{{"general.additionalShippingCosts"|trans|sw_sanitize}}"
{{ dataBsToggleAttr }}="modal"
data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
{{"general.additionalShippingCosts"|trans|sw_sanitize}}
</a>
</div>
{% if page is defined and page.product is defined %}
{% set product = page.product %}
{% endif %}
{% if product.isCloseout and product.availableStock < product.minPurchase %}
<link itemprop="availability" href="http://schema.org/LimitedAvailability"/>
<p class="delivery-information delivery-soldout">
<span class="delivery-status-indicator bg-danger"></span>
{{ "detail.soldOut"|trans|sw_sanitize }}
</p>
{% endif %}
{% endblock %}
{# moved down #}
{% block page_product_detail_wishlist %}
{% endblock %}
{% block page_product_detail_buy_inner %}
{# not loaded for cms page #}
{% set buyWidgetTheme = 'theme-light' %}
{% if page.product.seoCategory.translated.customFields.doncarne_category_buy_widget_theme == 'dark' %}
{% set buyWidgetTheme = 'theme-dark' %}
{% endif %}
<div class="product-detail-buy__inner {{buyWidgetTheme}}">
<div class="row align-items-center product-detail-headline">
{% sw_include '@Storefront/storefront/page/product-detail/headline.html.twig' %}
{% if page.product.getExtension("doncarneCutProperties").all()|first %}
{% sw_include '@Storefront/solution360/cut-product-property-image.html.twig' with {media: page.product.getExtension("doncarneCutProperties").all()|first.media} only %}
{% endif %}
</div>
{% set productReviewCount = page.product.extensions.rating.totalReviews %}
{% if productReviewCount > 0 %}
{% set productAvgRating = page.product.extensions.rating.rating|round(2, "common") %}
{% endif %}
{% if productAvgRating > 0 and productReviewCount > 0 %}
<div class="product-detail-review-rating"
data-rating-scroll="true" data-rating-selector="#review-tab">
<meta itemprop="aggregateRating" content ="{{ productAvgRating }}">
<meta itemprop="bestRating" content="5">
<meta itemprop="ratingCount" content="{{ productReviewCount }}">
<meta itemprop="ratingValue" content="{{ productAvgRating }}">
{% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
points: productAvgRating,
total: productReviewCount,
style: 'text-primary'
} %}
</div>
<!-- Add Review Button directly below rating -->
<div class="mt-1">
<button type="button" class="btn btn-link p-0 text-start text-decoration-none" id="openReviewModalBtn">
<small class="text-primary">{{ "detail.review.addReview"|trans|sw_sanitize }}</small>
</button>
</div>
{% else %}
<!-- Show review button when no reviews exist -->
<div class="product-detail-review-rating"
data-rating-scroll="true" data-rating-selector="#review-tab">
<div class="text-muted small">{{ "detail.review.noReviewsYet"|trans|sw_sanitize }}</div>
</div>
<!-- Add Review Button directly below no-rating text -->
<div class="mt-1">
<button type="button" class="btn btn-link p-0 text-start text-decoration-none" id="openReviewModalBtnEmpty">
<small class="text-primary">{{ "detail.review.writeFirstReview"|trans|sw_sanitize }}</small>
</button>
</div>
{% endif %}
<div class="mb-4">
{% if page.product.packUnit or page.product.purchaseUnit or page.product.unit.name %}
<span class="product-detail__unit-info d-block mb-1">
{{ page.product.purchaseUnit }} {{ page.product.unit.name }}
{% if page.product.packUnit %}
, {{ page.product.packUnit }}
{% endif %}
</span>
{% endif %}
<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 %}
{% if page.product.productNumber %}
{% block page_product_detail_ordernumber %}
<meta itemprop="productID" content="{{ page.product.id }}"/>
<span class="product-detail-ordernumber" itemprop="sku">
{{ page.product.productNumber }}
</span>
{% endblock %}
{% endif %}
</div>
</div>
{% sw_include '@Storefront/solution360/product-usps.html.twig' with { product: page.product }%}
{{ parent() }}
<div class="product-detail-buy__footer">
{% set state = page.product.translated.customFields.doncarne_product_delivery_product_state %}
{% if state == "frozen" %}
{% sw_icon 'snowflake' style {'namespace': 'DonCarneTheme'} %}
<p class="mb-0"><span class="product-detail-buy_text-frozen font-weight-bold">{{"productAttributes.frozen.label"|trans|sw_sanitize}}</span> - {{"productAttributes.frozen.desc"|trans|raw}}</p>
{% endif %}
{% if state == "fresh" %}
{% sw_icon 'steak' style {'namespace': 'DonCarneTheme'} %}
<p class="mb-0"><span class="product-detail-buy_text-fresh font-weight-bold">{{"productAttributes.fresh.label"|trans|sw_sanitize}}</span> - {{"productAttributes.fresh.desc"|trans|raw}}</p>
{% endif %}
</div>
{% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %}
{% if config('core.cart.wishlistEnabled') and not config('CoeWishlistSw6.config') %}
{% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
showText: true,
size: 'md',
productId: page.product.id
} %}
{% endif %}
</div>
<!-- Include Review Modal -->
{% sw_include '@Storefront/storefront/component/review/review-modal-inline.html.twig' %}
<!-- Modal Trigger Script -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Warte bis alles geladen ist
setTimeout(function() {
var btn1 = document.getElementById('openReviewModalBtn');
var btn2 = document.getElementById('openReviewModalBtnEmpty');
var modal = document.getElementById('productReviewModal');
function showModal() {
if (modal) {
// Versuche Bootstrap Modal
if (typeof bootstrap !== 'undefined' && bootstrap.Modal) {
var bsModal = new bootstrap.Modal(modal);
bsModal.show();
}
// Fallback: jQuery (Shopware nutzt oft jQuery)
else if (typeof $ !== 'undefined' && $.fn.modal) {
$(modal).modal('show');
}
// Notfall: Direkte Manipulation
else {
modal.classList.add('show');
modal.style.display = 'block';
document.body.classList.add('modal-open');
// Backdrop hinzufügen
var backdrop = document.createElement('div');
backdrop.className = 'modal-backdrop fade show';
document.body.appendChild(backdrop);
}
}
}
if (btn1) {
btn1.addEventListener('click', function(e) {
e.preventDefault();
showModal();
});
}
if (btn2) {
btn2.addEventListener('click', function(e) {
e.preventDefault();
showModal();
});
}
}, 500); // Kurze Verzögerung um sicherzustellen, dass alles geladen ist
});
</script>
{% endblock %}
{% block page_product_detail_ordernumber_container %}
{% endblock %}
{% block page_product_detail_reviews %}
{% endblock %}
{% block page_product_detail_delivery_informations %}
{% endblock %}