Exporting a Backup of All Orders

We are currently making a major overhaul to an old website of ours, and it is still using Magento Version 1.4.1.1. I know it is very outdated.

We have a lot of orders here that we want to make a backup of, such as name, email address, telephone order, sale amount, date of order(s), items ordered, etc.

There are over 10k transactions.

How do I easily back it up in a reader friendly format, preferably on a spreadsheet?

I have seen plugins like https://marketplace.magento.com/raveinfosys-raveinfosys-orderexporter.html but it only goes until version 1.5.

I have a little programming knowledge, but prefer an easy way to do it.

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)

XML declaration allowed only at the start of the document

i am getting this error on developer mode but works in default

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Theme layout update file XML declaration allowed only at the start of the document Line: 31 First line xml, is line 31 before that its html comment

<?xml version="1.0" encoding="UTF-8"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">      <update handle="editor"/>     <body>        <referenceContainer name="content">             <block class="Apptha\Airhotels\Block\Adminhtml\Uploadvideo\Edit" name="airhotels_uploadvideo_edit"/>         </referenceContainer>          <referenceContainer name="left">             <block class="Apptha\Airhotels\Block\Adminhtml\Uploadvideo\Edit\Tabs" name="airhotels_uploadvideo_edit_tabs">                 <block class="Apptha\Airhotels\Block\Adminhtml\Uploadvideo\Edit\Tab\AddVideo" name="airhotels_uploadvideo_edit_tab_addvideo"/>                  <action method="addTab">                     <argument name="name" xsi:type="string">addvideo_section</argument>                     <argument name="block" xsi:type="string">airhotels_uploadvideo_edit_tab_addvideo</argument>                 </action>                 <!--CedAddTab-->             </block>         </referenceContainer>     </body> </page> 

Thanks

Get all products with status = enabled and price (not working)

I’ve been trying without success to obtain all products with status = enabled from MAGENTO database and the price.

My query shows ALL the items (enabled and disabled ones) and i want to get only those with status = enabled.

This is my query:

SELECT main.sku, option_value_brand.value AS code_brand, code_business_unit.value as code_business_unit FROM catalog_product_entity AS main  LEFT JOIN eav_attribute attribute_brand on attribute_brand.attribute_code = 'code_brand' and attribute_brand.entity_type_id = 4 LEFT JOIN eav_attribute attribute_business_unit on attribute_business_unit.attribute_code = 'code_business_unit' and attribute_brand.entity_type_id = 4 LEFT JOIN catalog_product_entity_int code_brand ON main.entity_id = code_brand.entity_id and code_brand.attribute_id = attribute_brand.attribute_id LEFT JOIN eav_attribute_option option_brand on option_brand.attribute_id = code_brand.attribute_id and option_brand.option_id = code_brand.value LEFT JOIN eav_attribute_option_value option_value_brand on option_brand.option_id = option_value_brand.option_id LEFT JOIN catalog_product_entity_varchar code_business_unit ON main.entity_id = code_business_unit.entity_id and code_business_unit.attribute_id = attribute_business_unit.attribute_id; 

How should i modify my query in order to obtain what i want (all the items with status = enabled AND the price?)

I tried to use this condition but it did not work:

WHERE catalog_product_entity_int.value = 1 

Migrating from M1 to M2: need to / want to rename multiple attributes

in our mission to migrate from M1 to M2 we need / want to rename attributes that we have named say 7 years ago.

So product attribute ‘manufacturer’ would become ‘brand’ and product attribute ‘product_color’ would become ‘color’

We have tried looking at nginx rewrite. Only it does not handly query params editing very well and even less changing multiple! parameters.

SO I was thinking: as a workaround: could we add some kind of lookup / araay of old and new parameters somwhere that if/when we query in our layered bavigation for

manufacturer=51 or brand=51 => that the result would be the same? Or that the old attribute would be replace with a 301 to the new attribute?

and this would work with multiple attributes too?

manufacturer=51&product_color=1 becomes brand=51&color=1

Help appreciated 😉

Unable to delete the cookie with cookieName = mage-cache-sessid Exception #0 (

i am setup a multi store and getting error suddenly which is

1 exception(s): Exception #0 (Magento\Framework\Stdlib\Cookie\FailureToSendException): Unable to delete the cookie with cookieName = mage-cache-sessid Exception #0 (Magento\Framework\Stdlib\Cookie\FailureToSendException): Unable to delete the cookie with cookieName = mage-cache-sessid #0  

Please if someone can help me this

Thanks

Security Patch SUPEE-11086 – Possible issues?

Magento has released a new security patch for M1, and updates for M1 and M2.

These releases include critical security fixes. “We strongly recommend that all merchants upgrade as soon as possible.”

What issues should I look out for when upgrading or applying this patch?

SUPEE-11086

SUPEE-11086, Magento Commerce 1.14.4.1 and Open Source 1.9.4.1 contain multiple security enhancements that help close remote code execution (RCE), cross-site scripting (XSS), cross-site request forgery (CSRF) and other vulnerabilities.

Magento 2.3.1, 2.2.8 and 2.1.17 Security Update

These versions contains multiple functional and security updates. Risk: Critical for Magento Commerce and Magento Open Source prior to 2.1.17, 2.2.8 and 2.3.1.

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.

How to create symlinks to all source files after changing git branch?

I am working in git workflow. I want to know how I can create symlinks to source files after changing git branch?

Let’s say I have three root source files in my theme that are located as below.

app\design\frontend\Vendor\theme\web\css\styles-l.less app\design\frontend\Vendor\theme\web\css\styles-m.less app\design\frontend\Vendor\theme\web\css\custom.less

And these files import other files to make changes like below. In custom.less file I set like below.

@import (reference) 'source/lib/_lib.less'; @import 'source/_variables.less'; @import '_homepage.less'; @import '_custom_header.less'; @import '_category.less'; 

Now let’s say if I moved to other git branch and I added or deleted some module specific less file then if I run below command

php bin/magento dev:source-theme:deploy area="frontend" --theme="Vendor/theme" css/styles-l css/styles-m css/custom 

symlinks to all source files are generated in pub directory, but the module specific files are not generated.(_module.less and _widgets.less). We must run `

grunt clean:theme

grunt exec:theme

Only after that module specific file comes at pub directory. So I can safely run

grunt less:theme

But in this case I have to deploy static content again which is very time consuming. Any help will be great.