Yearly Archives: 2020
We are unable to get any Shipping Methods to show on customer check out. Checking out as a guest (call to estimate-shipping-method) or as a registered user (call to estimate-shipping-method-by-address-id) are returning empty arrays. According to this... I am missing the email and region_code as required in the payload. On our […]
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 […]
Currently, Magento 2.2.7 is showing the discount amount in the invoice and orders, if coupon gets applied. But I need to show the discount amount also for a specially priced product. Suppose if any coupon gets applied, the discount should be the sum of applied coupon discount amount + special […]
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 and model class code is namespace AdhikariStudyPluginModel; class StudyPlugin extends MagentoFrameworkModelAbstractModel { public function getName($name){ return $name; } } after that my plugin method code is […]
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 < = […]
I’ve been working in a tool that doesn’t let me just use a Regex, so I have to use a RegexReplace to get rid of everything else. I’ve found a disgusting work around, but I think someone here can help me make an elegant solution. So I’m trying to find […]