Skip to content

magento man

How to programmatically assign simple product to configurable on Magento 2.4

How do you programmatically assign simple product to configurable? What I tried: $configurableProduct = $this->objectManager->create(‘MagentoConfigurableProductModelProductTypeConfigurable’); $configurableProduct->setUsedProductAttributes($product, array($product_jsa_type_attribute_id)); $product->setNewVariationsAttributeSetId(4); $product->setAssociatedProductIds(array( $productObj->getIdBySku($ticketProduct[‘product_id’]), $productObj->getIdBySku($couponProduct[‘product_id’]), ));

How Magento validate products in cart for carts price rule and how to extract product from conditions_serialized column of the sale rules table?

I need to create an indexer for cart price rules. I decided to iterate the values from sales_rules table and extract the products from conditions_serialized coloumn. My indexer file is like below.i Will share the executeFull method only here public… Read More »How Magento validate products in cart for carts price rule and how to extract product from conditions_serialized column of the sale rules table?