Skip to content

magento2.3

Auto Added by WPeMatico

How to convert csp meta tag into csp_whitelist.xml format in magento 2

below is the meat tag i want covert as per magento 2 <meta http-equiv=”Content-Security-Policy” content=”default-src ‘self’ ‘unsafe- inline’;script-src ‘self’ ‘unsafe-inline’ *.acsbapp.com *.acsbap.com acsbap.com acsbapp.com;connect-src ‘self’ ‘unsafe-inline’ *.acsbapp.com *.acsbap.com acsbap.com acsbapp.com *.wikipedia.org;media-src ‘self’ ‘unsafe-inline’ data:;img-src ‘self’ ‘unsafe -inline’ data: *.acsbapp.com *.acsbap.com… Read More »How to convert csp meta tag into csp_whitelist.xml format in magento 2

How to hide and show the payment method based on shipping address country to sort the payment method

This code has worked to hide and show the payment method based on the shipping address country. public function execute(MagentoFrameworkEventObserver $observer) { //shipping company field $shippingCompanyField = $this->cart->getQuote()->getShippingAddress()->getCountryId(); $paymentMethod = $observer->getEvent()->getMethodInstance()->getCode(); if ($shippingCompanyField == ‘IN’) { if ($paymentMethod == “multisafepay_giropay”)… Read More »How to hide and show the payment method based on shipping address country to sort the payment method

Difference between async/ and bulk/async in Magento 2

I need to override my REST API endpoints to async and faced the issue that I don’t understand the difference between asynchronous endpoints in https://developer.adobe.com/commerce/webapi/rest/use-rest/asynchronous-web-endpoints/ and bulk endpoints in https://developer.adobe.com/commerce/webapi/rest/use-rest/bulk-endpoints/ As I see they are working in the same way… Read More »Difference between async/ and bulk/async in Magento 2

In this collection This BEst seller give me error it’s not working, unable to sort by best seller ASC, DESC not working in this condition

public function getProductCollection() { $objectManager = MagentoFrameworkAppObjectManager::getInstance(); $filterableAttributes = $objectManager->create(MagentoCatalogModelLayerCategoryFilterableAttributeList::class); $attributes = $filterableAttributes->getList(); $price=$this->getRequest()->getParam(‘price’); $cat=$this->getRequest()->getParam(‘cat’); $sortby=$this->getRequest()->getParam(‘product_list_order’); if (empty($sortby)) { $sortby=’position’; } $listdesc=$this->getRequest()->getParam(‘product_list_dir’); $page=($this->getRequest()->getParam(‘p’))? $this->getRequest()->getParam(‘p’) : 1; //get values of current limit $pageSize=($this->getRequest()->getParam(‘limit’))? $this->getRequest()->getParam(‘limit’) : 3; $collection = $this->_productCollectionFactory->create(); $collection->addAttributeToSelect(‘*’); $collection->setOrder(‘title’,’ASC’);… Read More »In this collection This BEst seller give me error it’s not working, unable to sort by best seller ASC, DESC not working in this condition