Get Dropdown field Label from value for custom collection in magento 2.3

I have created a backend Module ‘deliveryslot’. We have two Dropdown fields ‘Delivery Day’ and ‘Delivery Time’. I want to get the Dropdown fields Label from its value in Collection with Factory class. How can we do that? $deliverySlots = $this->_deliverySlotFactory->create(); $deliverySlotsColletion = $deliverySlots->getCollection(); foreach ($deliverySlotsColletion as $dsc) { $deliverSlotData[] = $dsc->getData(); } I am…

Magento 2 : which event should I use when want to add free item in cart?

when purchase a Product X, want to add product Y automatically to code. It saves in cart but ‘save’ function is goes into loop because it also has event as ‘checkout_cart_save_after‘. di.xml <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Event/etc/events.xsd”> <event name=”checkout_cart_save_after”> <!– checkout_cart_save_after, checkout_cart_product_add_after –> <observer name=”add_gift_to_cart” instance=”Product\AddGift\Observer\AddFreeProductToCart” /> </event> </config> and observer : public function execute(\Magento\Framework\Event\Observer $observer) {…

Why radio button ‘onclick’ not work?

I have template .html <input type=”radio” value=’0′ name=”name” id=”0″ data-bind=”click:fun”><label for=”0″ data-bind=”click:fun”>0%</label> <input type=”radio” value=’5′ name=”name” id=”5″ data-bind=”click:fun”> <label for=”5″ data-bind=”click:fun”>5%</label> and JS: function(data, event) { *other code* console.log(‘work’); return true; }; other code – work console.log – work return – Through time. Sometimes it works – sometimes not. How many do not click on…

Magento 2.3.3 – migration tool error

I try to use the delta import and I have this errors: In Mysql.php line 593: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘270- 113-0’ for key ‘CATALOG_PRODUCT_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID’ , query was: INSERT INTO `catalog_product_entity_int` (`value_id`,`attribu te_id`,`store_id`,`entity_id`,`value`) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?,…

How to override arguments in layout file?

module-sales/view/frontend/layout/sales_order_view.xml <referenceContainer name=”content”> <block class=”Magento\Sales\Block\Order\View” name=”order.comments” template=”Magento_Sales::order/order_comments.phtml” before=”sales.order.info.links”/> <block class=”Magento\Sales\Block\Order\View” name=”sales.order.view” cacheable=”false” after=”sales.order.info.links”> <block class=”Magento\Sales\Block\Order\Items” name=”order_items” template=”Magento_Sales::order/items.phtml”> <block class=”Magento\Framework\View\Element\RendererList” name=”sales.order.items.renderers” as=”renderer.list”/> <block class=”Magento\Theme\Block\Html\Pager” name=”sales_order_item_pager”/> <block class=”Magento\Sales\Block\Order\Totals” name=”order_totals” template=”Magento_Sales::order/totals.phtml”> <arguments> <argument name=”label_properties” xsi:type=”string”>colspan=”4″ class=”mark”</argument> <argument name=”value_properties” xsi:type=”string”>class=”amount”</argument> </arguments> <block class=”Magento\Tax\Block\Sales\Order\Tax” name=”tax” template=”Magento_Tax::order/tax.phtml”/> </block> </block> </block> <block class=”Magento\Sales\Block\Order\Info” as=”info” name=”sales.order.info” after=”sales.order.view”/> </referenceContainer> I want to change only…