Initial commit: Free Shipping Message module

This commit is contained in:
shopkeeperdev
2025-11-20 12:01:53 -05:00
commit f07db21ac4
7 changed files with 252 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!--
/**
* Shopkeeper FreeShippingMessage Layout
* Adds CMS block widget below the add to cart button
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="product.info.form.content">
<block class="Shopkeeper\FreeShippingMessage\Block\Product\View\Message"
name="product.free.shipping.message"
template="Shopkeeper_FreeShippingMessage::product/view/message.phtml"
after="addtocart">
<arguments>
<argument name="cms_block_id" xsi:type="string">free_shipping_message</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>

View File

@@ -0,0 +1,10 @@
<?php
/**
* @var \Shopkeeper\FreeShippingMessage\Block\Product\View\Message $block
*/
?>
<?php if ($block->hasCmsBlock()): ?>
<div class="free-shipping-message">
<?= /* @noEscape */ $block->getCmsBlockHtml() ?>
</div>
<?php endif; ?>