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 (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?,…