Update Product Attribute through Import Tool using csv – ERROR: keep creating new same sku number – magento 2

I’m try to update a product attribute called “custom_stock_status”. I have put together a csv file, with 2 columns like this, and import the file using import behavior “add/update”, but it keeps creating the same sku number, even-though the sku p1,p2,p3 are already exists in the backend. Everytime i try to import the csv file again, it create another SAME sku number in the backend.

sku | custom_stock_status p1    coming soon p2    coming soon p3    coming soon 

Magento 2.3 – Customer Email Tempalte is sent empty

I have created a custom email template. I’m using transport builder to send the email, but for some strange reason the email is empty. To send email I’m using mageplaza-magento-2-smtp extension. Below my code:

etc/config.xml

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">     <default>         <newsletter>             <referral>                 <invite_friend_email_template>                     newsletter_referral_invite_friend_email_template                 </invite_friend_email_template>             </referral>         </newsletter>     </default> </config> 

etc/email_templates.xml

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">     <template id="newsletter_referral_invite_friend_email_template"               label="Invite Friend Email"               file="invite_friend.html"               type="html"               module="Ped_Referral"               area="frontend"/> </config> 

view/frontend/email/invite_friend.html

<!--@subject {{trans "You have been invited to register"}} @-->  {{template config_path="design/email/header_template"}}  <p>     {{trans "You have been invited to register" }} </p>  {{template config_path="design/email/footer_template"}} 

Controller action to send email

<?php declare(strict_types=1);  namespace Ped\Referral\Controller\Customer;  use Magento\Customer\Model\Session; use Magento\Framework\App\Action\Context; use Magento\Framework\App\Area; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Data\Form\FormKey\Validator; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\MailException; use Magento\Framework\Translate\Inline\StateInterface; use Magento\Newsletter\Model\Queue\TransportBuilder; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Ped\Referral\Controller\Customer; use Psr\Log\LoggerInterface; use Magento\Framework\App\ResponseInterface; use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\NoSuchEntityException;  class Invite extends Customer {     private const XML_PATH_EMAIL_INVITE_FRIEND = 'newsletter/referral/invite_friend_email_template';      /**      * @var Validator      */     private $  formKeyValidator;      /**      * @var LoggerInterface      */     private $  logger;      /**      * @var TransportBuilder      */     private $  transportBuilder;      /**      * @var ScopeConfigInterface      */     private $  scopeConfig;      /**      * @var StateInterface      */     private $  inlineTranslation;      /**      * @var StoreManagerInterface      */     private $  storeManager;      /**      * Invite constructor.      * @param Context $  context      * @param Session $  customerSession      * @param Validator $  formKeyValidator      * @param LoggerInterface $  logger      * @param TransportBuilder $  transportBuilder      * @param ScopeConfigInterface $  scopeConfig      * @param StateInterface $  inlineTranslation      * @param StoreManagerInterface $  storeManager      */     public function __construct(         Context $  context,         Session $  customerSession,         Validator $  formKeyValidator,         LoggerInterface $  logger,         TransportBuilder $  transportBuilder,         ScopeConfigInterface $  scopeConfig,         StateInterface $  inlineTranslation,         StoreManagerInterface $  storeManager     ) {         parent::__construct($  context, $  customerSession);         $  this->formKeyValidator = $  formKeyValidator;         $  this->logger = $  logger;         $  this->transportBuilder = $  transportBuilder;         $  this->scopeConfig = $  scopeConfig;         $  this->inlineTranslation = $  inlineTranslation;         $  this->storeManager = $  storeManager;     }      /**      * Validate form key      * @return bool      */     private function validateFormKey(): bool     {         return $  this->formKeyValidator->validate($  this->getRequest());     }      /**      * Validate request params      * @return bool      * @throws LocalizedException      */     private function validateParams(): bool     {         $  email = $  this->getRequest()->getParam('email');          if (strpos($  email, '@') === false) {             throw new LocalizedException(__('The email address is invalid. Verify the email address and try again.'));         }          return true;     }      /**      * Send referral email message      * @param $  email      * @throws MailException      * @throws NoSuchEntityException      */     private function sendMessage($  email): void     {         $  storeId = $  this->storeManager->getStore((int)$  this->getCustomer()->getStoreId())->getId();         $  templateId = $  this->scopeConfig->getValue(             self::XML_PATH_EMAIL_INVITE_FRIEND,             ScopeInterface::SCOPE_STORE,             $  storeId         );          $  transport = $  this->transportBuilder             ->setTemplateIdentifier($  templateId)             ->setTemplateOptions([                 'area' => Area::AREA_FRONTEND,                 'store' => $  storeId,             ])             ->setTemplateVars([                 'name' => $  this->getCustomer()->getName(),             ])             ->setFrom([                 'name' => $  this->getCustomer()->getName(),                 'email' => $  this->getCustomer()->getEmail(),             ])             ->addTo($  email)             ->getTransport();          $  transport->sendMessage();     }      /**      * Send referral email message to customer's friend      * @return ResponseInterface|Redirect|ResultInterface      */     public function execute()     {         $  resultRedirect = $  this->resultRedirectFactory->create();          if (!$  this->validateFormKey()) {             return $  resultRedirect->setRefererUrl();         }          $  email = $  this->getRequest()->getParam('email');          try {             $  this->validateParams();              $  this->inlineTranslation->suspend();             $  this->sendMessage($  email);             $  this->inlineTranslation->resume();              $  this->logger->info('Sent referral email message to ' . $  email);             $  this->messageManager->addSuccessMessage(__('Email sent successfully'));         } catch (LocalizedException $  e) {             $  this->messageManager->addErrorMessage($  e->getMessage());         } catch (\Exception $  e) {             $  this->logger->critical($  e);             $  this->messageManager->addErrorMessage(                 __('An error occurred while processing your form. Please try again later.')             );         }          return $  resultRedirect->setPath('referral/customer/index');     } } 

Why do I receive a blank email? (without subject neither body)

Magento 2 add body class into as per current page using toolbar.php plugin for category and search results page

I have created plugin for toolbar.php \Magento\Catalog\Block\Product\ProductList\Toolbar

protected function _prepareLayout() {     $  this->pageConfig->getTitle()->set(__('Category Page'));     $  this->pageConfig->addBodyClass('class'. $  this->getCurrentPage() );          $  this->getLayout()->getBlock('page-title')->setPageTitle('Custom Title');      return parent::_prepareLayout(); } 

On product listing, need to add existing page number in body class.

Magento 2 + docker setup getting error of Redis

I have tried to set up one source in the local environment with docker image but getting an issue like below

Fatal error: Uncaught CredisException: Connection to Redis failed after 2 failures.Last Error : (0) php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/xyz/vendor/colinmollenhour/credis/Client.php on line 448

CredisException: Connection to Redis failed after 2 failures.Last Error : (0) php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/xyz/vendor/colinmollenhour/credis/Client.php on line 448

I have attached an image for more reference.enter image description here

Magento 2 image not found

I’m writing a callback module and when i try to insert image like following:

        a#popup-button{         display: block;         width: 50px;         height: 50px;         background: url("../images/phone-icon.png") no-repeat;         background-size: contain;         background-position: center center;         font-size: 0;     } 

I get enter image description here

Magento 2.3 – Salable Quantity turning off

Is there a way to set work around the Reservations in 2.3 ?

Currently, “The quantity of the product decrease only after shipping is completed”. We do oversell over the weekend as qty doesn’t go down on order placement. Its brilliant but when you go back on Monday and see -45 on products you have a problem.

Can we switch so quantity depreciates on order placement?

Is there a Magento 2 Membership Extension that offers functionality similar to Amazon Prime Membership?

I have a grocery store built upon Magento 2. I am looking for a way to incorporate membership functionality that will allow the grocery stores’ premium customers to buy products at a discounted rate. (Think of Amazon Prime Membership where Prime members pay an annual fee and enjoy benefits like faster shipping, reduced product prices etc.)

Is there an extension that offers this exact functionality? I have come across a couple of extensions but found out they offer only membership “plans” functionality not what I am looking for.

How to get the total price of products added to cart based on product Attribute (Magento 1.9)?

I’m currently working on a Magento extension where I need help in getting the total price of all products having the same attribute when they are added to the cart.

Here is my code for a better explanation @ the shipping’s carrier page:

foreach ($  this->_quote->getAllItems() as $  item) {           $  productid = $  item->getProductId();          $  product = Mage::getModel('catalog/product')->load($  productid);        $  chilledFood = $  product->getData('is_chilled_food'); // the custom attribute 'is_chilled' added to product backend, so if the product is chilled, the value will be 'yes'          if ($  chilledFood) {  // need help from here?             return $  this->_price = ' ';         }       } 

So I need help on knowing if the customer selects chilled food in the cart. If yes, the shipping price will be an additional $ 5 from other types of food category. BUT there will be free shipping cost if the total chilled food amounts to $ 50 and above.

Thank you.

Payment method in Checkout page issue in Magento 2.2.6

I am facing the serious issue which road block for the order placement in my Magento instance. I have made some customization in Checkout side. And it was working properly. Suddenly, I am facing this issue like, getting Payment method instead of Shipping address template.enter image description here

I don’t know what wrong with that, because no error is showing in console.