Skip to content

product

Auto Added by WPeMatico

updating product description via coding correctly shows text on product page but admin side’s edit description with pagebuilder shows old values?

In my custom module, I am able to set the description of an existing product successfully using the code below & the product url shows correct output for description: $product = $this->productRepository->get(‘q783’); $product->setData(‘description’,’hello world’); $this->productRepository->save($product); However, this programmatically saved description… Read More »updating product description via coding correctly shows text on product page but admin side’s edit description with pagebuilder shows old values?

Magento 2 : When creating a product – Cannot add or update a child row: a foreign key constraint fails?

When creating a product, it throws this error SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`vbm`.`catalog_product_entity`, CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DELETE), query was: INSERT INTO… Read More »Magento 2 : When creating a product – Cannot add or update a child row: a foreign key constraint fails?

Product added to the Catalog collection does not display a price

I created a preference for the block MagentoCatalogBlockProductListProduct to add a specific product at the begining of the collection in getLoadedProductCollection(). Almost everything is well displayed except the price. public function getLoadedProductCollection() { $originalCollection= parent::getLoadedProductCollection(); $featuredProduct = $this->productFactory->create()->load(18); //test productId… Read More »Product added to the Catalog collection does not display a price