Magento 2.2.3 List all configurable’s childs prices when the configurable’s childs are out of stock

For a configurable product, the following code will list the configurable’s childs prices only for the childs that are in stock: if ($_product->getTypeId() == ‘configurable’) { $_children = $_product->getTypeInstance()->getUsedProducts($_product); foreach ($_children as $child){ echo $child->getPrice(); } } When all childs are out of stock, the code above will not show anything. For a configurable product…

Plugin Before not working

I am trying to understand functionality of plugin method. for that i have created a custom module and i added below code in di.xml <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <type name=”Adhikari\StudyPlugin\Model\StudyPlugin”> <plugin name=”studyPluginBefore” type=”Adhikari\StudyPlugin\Plugin\Model\StudyPlugin” sortOrder=”1″ disabled=”false”/> </type> </config> and model class code is namespace Adhikari\StudyPlugin\Model; class StudyPlugin extends \Magento\Framework\Model\AbstractModel { public function getName($name){ return $name; } }…

How add the removed item to the order again?

I need to remove products from the order, after which, removed products can be added to the order $backOrdersIds = array(); $this->getQuote()->getItemsCount(); foreach ($this->getQuote()->getAllItems() as $item) { $oldQty = (int)$item->getProduct()->getStockItem()->getQty(); $qtyOrdered = (int)$item->getQty(); $differenceQty = $oldQty – $qtyOrdered; //remove backorder items from Quote Mage::log(‘first foreach’ . $item->getProductId()); if($differenceQty <= 0 ){ $backOrdersIds[] = array( ‘productId’…

Magento 2: URL Rewrite not working through .htaccess

I want to redirect some old URL’s to new URL’s I’m doing it in my .htaccess path: /root/.htaccess <IfModule mod_rewrite.c> ############################################ ## Enable rewrites Options +FollowSymLinks RewriteEngine on Redirect 301 https://www.example.com/store/bra_bust_lift.html https://www.example.com/intimates/womens-intimates/bra-converters.html after that when I hit old URL it redirect me to 404 Page, it should redirect me to new URL.