dbm 5 jaren geleden
commit
1772365280

+ 0 - 0
README.md


BIN
shipping-notifications/etc/.db_schema.xml.swp


+ 9 - 0
shipping-notifications/etc/adminhtml/routes.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" ?>
+<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
+    <router id="standard">
+        <route frontName="shipping_notifications" id="shipping_notifications">
+            <module name="Cpcommerce_ShippingNotifications"/>
+        </route>
+    </router>
+</config>
+

+ 10 - 0
shipping-notifications/etc/db_schema.xml

@@ -0,0 +1,10 @@
+<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
+    <table name="cpcommerce_shipping_notification_categories" resource="default" engine="innodb" comment="CP-Commerce Shipping Notification Delayed Categories">
+        <column xsi:type="int" name="ship_categ_id" padding="6" nullabe="false" identity="true"/>
+        <column xsi:type="varchar" name="ship_categ" length="255" nullable="false" />
+
+        <constraint xsi:type="primary" referenceId="ship_categ_id">
+            <column name="ship_categ_id" />
+        </constraint>
+    </table>
+</schema>

+ 8 - 0
shipping-notifications/etc/module.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
+	<module name="Cpcommerce_ShippingNotifications" setup_version="0.0.2">
+		<sequence>
+			<module name="Magento_Catalog" />
+		</sequence>
+	</module>
+</config>

+ 6 - 0
shipping-notifications/registration.php

@@ -0,0 +1,6 @@
+<?php
+\Magento\Framework\Component\ComponentRegistrar::register(
+	\Magento\Framework\Component\ComponentRegistrar::MODULE,
+	'Cpcommerce_ShippingNotifications',
+	__DIR__
+);

+ 16 - 0
shipping-notifications/view/frontend/layout/catalog_product_view_type_simple.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<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="Magento\Catalog\Block\Product\View\Description" name="shipping_notification" before="addtocart" template="Cpcommerce_ShippingNotifications::shipping_notification.phtml"/>
+    </referenceContainer>
+
+    <referenceBlock name="shipping_notification">
+        <block class="Magento\Cms\Block\Block" name="cpcommerce_shipping_notification">
+            <arguments>
+                <argument name="block_id" xsi:type="string">cpcommerce_shipping_notification</argument>
+            </arguments>
+        </block>
+    </referenceBlock>
+</body>
+</page>

+ 14 - 0
shipping-notifications/view/frontend/templates/shipping_notification.phtml

@@ -0,0 +1,14 @@
+<?php
+    $_product = $block->getProduct();
+    $shipping_category = $_product->getResource()->getAttribute('shipping_category')->getFrontend()->getValue($_product);
+
+    if($shipping_category == 'Late'){
+        $ship_notif_enable = 1;
+    }
+?>
+
+<?php if($ship_notif_enable) : ?>
+<?php echo $block->getChildHtml('cpcommerce_shipping_notification'); ?>
+<?php endif; ?>
+
+