texts: Magento 2, How to include unsubscribe link in transaction email

texts:
Is there a out-of-the-box way of including an unsubscribe link in transactional emails inside of Magento 2?

I tried utilizing:

<a href="{{var subscriber.getUnsubscriptionLink()}}">
{{var subscriber.getUnsubscriptionLink()}}
</a>

Which is used in the email newsletter templates but this does not work inside of a transactional email.


texts: Should I avoid checking for two fields in one validation?

texts:
I want to check both checkout address fields with one validation:

validator.addRule(

           'validate-housenumber-both',
           function (value) {
               if ($('[name="street[0]"]').val().match(/\d/) || $('[name="street[1]"]').val().match(/\d/)) {return true;}
                   else {return false;}
           },
           $.mage.__('One of the fields should contain a number')
       );

It seems to be working fine, but is there a reason why this should be avoided?


texts: How to add number of custom tab in product info detail tab?

texts:
I added 3 custom tab in product info detail tab page

   <referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View" name="custom1.tab" as="custom1"  template="product/view/custom1.phtml" group="detailed_info" >
            <arguments>
                <argument translate="true" name="title" xsi:type="string">custom1</argument>
            </arguments>
        </block>

        <block class="Magento\Catalog\Block\Product\View" name="custom2.tab" as="custom2"  template="product/view/custom2.phtml" group="custom2" >
            <arguments>
                <argument translate="true" name="title" xsi:type="string">custom2</argument>
            </arguments>
        </block>

        <block class="Magento\Catalog\Block\Product\View" name="custom3.tab" as="custom3"  template="product/view/custom3.phtml" group="custom3" >
            <arguments>
                <argument translate="true" name="title" xsi:type="string">custom3</argument>
            </arguments>
        </block>
    </referenceBlock>

and i call .phtml in seperate files. Frontend gets only "custom3" tab which i placed in last line in .xml file.

Please let me know the corrections in this file


texts: Eway Payment Gateway Not work in Magento 2.3

texts:
I have integrated eWay Payment gateway in Magento 2.3 It's install successfully. I did settings in admin as well. But I cannot see that eway payment option in front end check out page. I tried to install the plugin with default Magento 2.3 but there also the same issue.

Can you please help me to figure this out?

Thanks in Advance!!!


texts: is it possible having two types of checkout process for two different themes in one website

texts:
Magento store using a custom theme for desktop view. Now it is required to create a mobile theme for that store. So I just created a mobile theme inside the custom package.

The theme for desktop view is using the onepage checkout process.
But I am asked to setup a multi-step checkout process in the mobile theme.
How is it possible to have two types of checkout process for a single store ?
Or is there any alternative option to achieve this functionality ?


texts: How can i configure, If order placed by Cash On Delivery or Bank Deposit, customer get automatic order notification By Mail?

texts: In my case, if order placed by cash on delivery or bank deposit, the mail not automatically send to customer, if i click to send mail from backend then only customer get mail.


texts:
I'm trying to fetch all the products which are having 5 star rating on home page.

Used objectManager for product collection.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$reviewFactory = $objectManager->create('Magento\Review\Model\Review');
$storeId = $this->_storeManager->getStore()->getId();

foreach ($collection as $product) {
    $reviewFactory->getEntitySummary($product, $storeId);
    $ratingSummary = $product->getRatingSummary()->getRatingSummary();
}

Not finding any solution in Magento 2.

Thanks you


texts: I have bundle product and got its id I want to get the bundle option for that product

texts: I want to get collection of bundle option_id from table "catalog_product_bundle_option" related to the parent_id which I have passed


texts: How to render loaded attributes from Catalog/Layer_View block

texts:
I am trying to get loaded product attributes from Layered navigation into listing page.

The below code is working fine if I print $grid_labels[]

When I am applying/selecting layered navigation filter, i am getting the following error :

You cannot define a correlation name 'manufacturer_idx' more than once

I am unable to identify why the block/attributes are loading twice.

$block = $this->getLayout()->createBlock('Catalog/Layer_View');
$_filters = $block->getFilters();
$grid_label = array();
$grid_attribute_code = array();
//echo "<pre>";
foreach ($_filters as $_filter) {
    if ($count = $_filter->getItemsCount()) {
        $attr = Mage::getModel('eav/entity_attribute')->getCollection()->addFieldToFilter('frontend_label', $_filter->getName());
        $attcodeobj = $attr->getData();
        $attrcode = $attcodeobj[0]['attribute_code'];
        if($attrcode!=''):
        $grid_label[] = array($attrcode => $_filter->getName());
endif;
        //$grid_attribute_code[] = $_filter->getLabel();
    }
}

Can any one help me out on this issue ?


texts: Magento 2: error on any bin/magento command ("More than one node matching the query")

texts:
Magento 2.2.9

This error is driving me nuts:

More than one node matching the query: /config/type[@name='Magento\Framework\Console\CommandList']/arguments/argument[@name='commands']

I get this on my staging system but not on my local dev system. This occurs whenever I try to use any bin/magento command. Even a simple "bin/magento" comes up with this error.

I tried to track down to what causes this. I have a git post-receive hook on my dev system which rsyncs via ssh to the staging server. Odd thing is whenever I trigger this hook I can use bin/magento commands until I do a setup:upgrade. That one immediately fails with the mentioned error and after that I cannot use bin/magento anymore.

On the stagin system i deploy with a script:

#!/bin/bash

cd /web/;

MAG=bin/magento

if [ ! -f $MAG ]; then
        echo "Magento instance not found!";
        exit;
fi

php $MAG deploy:mode:show;
php $MAG maintenance:enable;

rm -rf pub/static/frontend/
rm -rf pub/static/adminhtml/
rm -rf var/view_preprocessed/*
rm -rf generated/code/*
rm -rf generated/metadata/*

php $MAG cache:flush 2>&1;
php $MAG setup:upgrade 2>&1;
php $MAG setup:di:compile 2>&1;

php $MAG setup:static-content:deploy en_US de_DE da_DK --exclude-theme Magento/luma --exclude-theme Magento/blank -f;

php $MAG cache:clean 2>&1;
php $MAG index:reindex 2>&1;

php $MAG maintenance:disable;

Before you ask: this setup and deployment has been working for me just fine for almost 2 years now on multiple systems.

Now I am lost and have no idea how to even debug this issue.

Any help or hint appreciated.

EDIT: By ommitting setup:upgrade the above deplyment script runs fine. The issue must happen during upgrade process.


texts: Add right column menu items in Admin - Magento 2

texts:
I have successfully been able to add multiple submenus items with submenu headers in a custom main menu panel within the admin menu panel as per below;

   <!-- Add Main Menu/NEw panel Menu -->

    <add id="My_Module::main"
         title="My Menu"
         module="My_Module"
         sortOrder="1"
         resource="My_Module::main"/>

    <!-- Sub Menu Header -->

    <add id="My_Module::header"
         title="XAPI"
         module="My_Module"
         sortOrder="10"
         resource="My_Module::header"
         parent="My_Module::core"/>

   <!-- Sub Menu Item/Link -->

    <add id="My_Module::settings"
         title="Manage Settings"
         module="My_Module"
         sortOrder="10"
         action="adminhtml/system_config/edit/section/settings"
         resource="My_Module::settings"
         parent="My_Module::header"/>

   ...
   ...
   more headers, more items etc

Problem is I can keep adding menu header with items but I wish to start having some be positioned into the right hand column as seen in the "Stores" admin menu panel etc.


texts:
I've just created a new theme that extends from Magento Blank, and within the file _theme.less I did something like this:

h1 {
  font-size: 24px;
}

@media (max-width: 768px) {
  h1 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 12px;
  }
}

However, the mobile styles are not being applied. I opened the styles-m.css source code and I found out that the desktop styles are at the bottom, overriding all of the styles above them.

@media (max-width: 480px) {
  h1 {
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 18px;
  }
}

h1 {
  font-size: 24px;
}

What am I doing wrong here?


texts: A non well formed numeric value encountered in magento/framework/Image/Adapter/Gd2.php

texts: issue faced when product update or save in magento admin version 2.1. Please share your idea.


texts: Import products with dropdown attributes don't show in layered navigation

texts:
First, here's my setup:
Magento 1.8.1, store functioning properly. I did import a list of product in CSV format using the Magento import function, the import was successful.

Here's my problem:
One attribute of the products is a dropdown list of numbers but I did not set any validation for it so it could be anything. When the import process is complete, all values are there and displayed properly in the frontend but I did set this attribute to be "Use In Layered Navigation" but nothing appear in the Shopping Options. The only way to make it appear there is to go in every products (on admin side), change manually the value of this attribute, change it back to it's proper value and save.

What I tried so far:
I thought maybe it could be a data format problem, so I change the cell format (I use OpenOffice Calc) to text and import again. Then I put the values back to number (still in the CSV here) and set the input validation (in magento) to integer and to decimal and re-import every time. Nothing worked. I flushed the cache and storage cache at each step.

Since I don't see the point of importing products in bulk if I have to change each of them manually after, there must be something I miss here.

Thanks


texts: Magento 2 : set custom price in product when add to cart

texts:
I see some answers about set custom price in product when add to cart.

But, I can't still solve my issue. I used observer for that to set custom price.

But, it's not working.

Can anyone please help me to solve it?

My code :

public function execute(\Magento\Framework\Event\Observer $observer) {
    $item = $observer->getEvent()->getData('quote_item');
    $product = $observer->getEvent()->getData('product');
    $itemProId = $item->getProduct()->getId();
    $custom_price = $product->getPrice() + 10;
    $item->setCustomPrice($custom_price);
    $item->setOriginalCustomPrice($custom_price);
    $item->getProduct()->setIsSuperMode(true);
}


texts: Magento 2 Programmatically login user by mail

texts:
I need to connect my user using only email and no password.

I already saw that there is method in customer/session module called loginById()

I search but the only thing concerning magento 2 is this :
https://magecomp.com/blog/login-customer-programmatically-without-password-magento-2/

But I don't know what to do with it, i try put it in block and controller but nothing work. I try add the loginById function like this:

$customer = $this->_customer->loadByEmail("$mail"); return
$this->_customerSession->loginById($customer->getId());

But don't work, my customer is not connected when I change page.

There are many topics on magento 1 like this one: Programmatically login a user

But I don't understand very well magento 2 so I can't code magento 2 with magento one solution.

If someone can help me, the final goal is to send mail and user on a page of a custom module with custom block, and if connection is ok he got redirected to the site.

In block i have :

protected $_customer;
protected $_customerSession;

public function __construct(
   ...
    \Magento\Customer\Model\Customer $customer,
    \Magento\Customer\Model\Session $customerSession
) {
   ...
    $this->_customer = $customer;
    $this->_customerSession = $customerSession;
}

public function connectUser(){
    $customer = $this->_customer->loadByEmail("jeremie@eurecia.com");
    return $this->_customerSession->loginById($customer->getId());
}

I call the connectUser() function in template.

EDIT : I don't use SSL (https) cause i dev in local using Wamp (php7).


texts: How to show product details in popup when click link in custom grid in Magento 2

texts: I need to show admin product grid in a popup window when we click link products in the custom admin grid in Magento 2. Please refer the attached screenshots. Please help us with some solution.


texts:
How to configure apache/magento2 to be able to reach the /setup when /pub is configured as root?

When i configure apache to use /pub as root i can't access the web-setup-wizard.

Does someone have a solution for this?

/Thomas


texts:
On my website www.antistaticesd.com, I want to make a new store.

There are two root categories:

Default Category for default store on www.antistaticesd.com
Business Store  for businesses to purchase business products. I have set up a directory for this www.antistaticesd.com/business

After creating the "business store" root category and "business_store_view" store view, I did the following:

Went to System >> Configuration
Selected "business_store_view" from Current Configuration scope to switch to business store configuration.
Went to "Web" from left panel.
Unchecked the "Use Website [STORE VIEW]"
Changed the Secure and Unsecure base URLs to "www.antistaticesd.com/business".

Also added the following lines to my .htaccess file( that is in the root installation of magento):

SetEnvIf Host www\.antistaticesd\.com MAGE_RUN_CODE=default
SetEnvIf Host www\.antistaticesd\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^antistaticesd\.com MAGE_RUN_CODE=default
SetEnvIf Host ^antistaticesd\.com MAGE_RUN_TYPE=website

SetEnvIf Host www\.antistaticesd\.com/business MAGE_RUN_CODE=business_store_view
SetEnvIf Host www\.antistaticesd\.com/business MAGE_RUN_TYPE=store
SetEnvIf Host ^antistaticesd\.com/business MAGE_RUN_CODE=business_store_view
SetEnvIf Host ^antistaticesd\.com/business MAGE_RUN_TYPE=store

Still, I see nothing but an error screen on reindexing and refreshing.
Please, Please help!!!!!


texts: Magento get product collection filter by tier price

texts:
I want to get all product list who have tier price.

How to filter by tier price?

$collection = Mage::getResourceModel('catalog/product_collection');

I have tried :

$collection->addAttributeToFilter('tier_price', 'notnull');

But it now worked.


texts: Re-position block/element in shopping cart

texts:
I have bought a custom extension to use in my shopping cart but i want to change the position.
At the moment the element/block is positioned underneath the whole cart form where as i want it to be placed right under or inside the coupon code block as shown in this pic:

The extension xml file to originally position the extension is:

<checkout_cart_index>
  <reference name="content">
        <block type="ext/custom" name="ext.custom"></block>
  </reference>
</checkout_cart_index>

In my checkout.xml file my coupon section looks like:

<checkout_cart_index translate="label">
    <reference name="content">
        ......
        <block type="checkout/cart" name="checkout.cart">
            <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
        </block>
        ......
    </reference>
</checkout_cart_index>


texts:
I created a local dev instance of my site. The site layout breaks on dev after I add items to cart.

After clicking Add to Cart, the loader spins for a couple seconds and disappears without showing the confirmation popup. The mini-cart doesn't update to until I refresh the page. Then the mini-cart shows the added item, but the page doesn't load beyond the call to getProductThumbnail. The same problem is on the shopping cart page. The grid and title of the first item load, but the html is broken beyond the opening quote of the image (e.g. <img src=" ).

I have tried setting sessions to both files and db. I am not using secure urls on dev. What am I missing?

Edit: This is a Vagrant box. I briefly resolved the issue by moving the var folder to a shared folder above the Magento root folder and creating a symlink (ln -s ../shared/var/ var). I tested adding to cart and logging into back end--all good--but when I came back later, I once again had the same problem with the Add to Cart confirmation not displaying and the page layout broken at the call to getProductThumbnail.


texts: Magento2 - Remove Meta Keywords from all pages

texts:
I'm currently developing some Magento2 themes. I noticed that in Magento2 Meta Keywords are still added. I want to remove this meta keywords from all pages, does anyone know the proper way to achieve this?

I did find meta.phtml, but I think this file is not used on a product page. Also the file Product/View.php adds the keywords with this function:

$this->pageConfig->setKeywords($keyword);

but I don't think it would be the prober way to extend the _prepareLayout function, right?

Thanks.


texts: how to Load Feature on category page before category name in magento 2?

texts:
how to Load Feature on category page before category name in Magento 2? In the category page, I share screenshot  link
enter link description here


texts: Magento 2: Add product grid into ui form tab using insertListing

texts:
I am adding a product grid into a form tab using insertListing of uiComponent

Tab code from uiCompnenet file

<fieldset name="products">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Products</item>
        </item>
    </argument>
    <insertListing>
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="autoRender" xsi:type="boolean">true</item>
                <item name="ns" xsi:type="string">ui_component_file_name</item>
            </item>
        </argument>
    </insertListing>
</fieldset>

My ui_component_file_name file is using custom_module_products_grid_data_source, relevant code from di.xml is given below

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="custom_module_products_grid_data_source" xsi:type="string">Magento\Catalog\Model\ResourceModel\Product\CollectionFactory</item>
        </argument>
    </arguments>
</type>

When I switch to the newly created tab I get the following error

This error should have appeared because Magento\Catalog\Model\ResourceModel\Product\CollectionFactory is not extended from Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult and I need to declare VirtualType for grid collection something like below under my di.xml

<virtualType name="Magento\Catalog\Model\ResourceModel\Product\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">mainTableName</argument>
        <argument name="resourceModel" xsi:type="string">Magento\Catalog\Model\ResourceModel\Product</argument>
    </arguments>
</virtualType>

Question:
What is the main table for catalog products if I want to create grid collection via VirtualType or How I add product grid into ui form tab using insertListing?


texts: Magento2 - How to get a custom attribute for catalog product?

texts:
I need to get a custom attribute for catalog products on the product page. I added code,

<?php $_getMyAttr = $_product->getResource()->getAttribute('my_custom_attr'); ?>
<?php if ($_getMyAttr){ ?>
<?php /* @escapeNotVerified */ echo $attrTestValue = $_getMyAttr->getFrontend()->getValue($_product); }?>

This works fine when I added to the,

  app/design/frontend/Mgs/ethan/Magento_Catalog/templates/product/view/type/default.phtml

but does not work when I added to,

  app/design/frontend/Mgs/ethan/Magento_Theme/templates/html/title.phtml

I have also tried to creating a block with the same code and adding that block to my catalog_product_view.xml in the directory app\design\frontend\Mgs\Ethan\Magento_Catalog\layout\catalog_product_view.xml. But I get a 500 error anytime when I try this.

Is there anything I need to do differently?

catalog_product_view.xml

   <?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>

        <referenceBlock name="page.main.title">
            <arguments>
                <argument name="css_class" xsi:type="string">product</argument>
                <argument name="add_base_attribute" xsi:type="string">itemprop="name"</argument>
            </arguments>
        <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.color.attributes" as="additional_color" template="Magento_Catalog::product/view/color_attribute.phtml" />
    </referenceBlock>

    <referenceBlock name="head.additional">
        <block class="Magento\Framework\View\Element\Template" name="script.sharethis" template="MGS_Mpanel::sharethis/sharethis_script.phtml" ifconfig="mpanel/share_config/share_product_detail"/>
    </referenceBlock>

    <block class="Magento\Theme\Block\Html\Title" name="mgs.product.title" template="Magento_Theme::html/title.phtml"/>

    <referenceBlock name="product.info.extrahint" remove="true"/>

    <referenceBlock name="product.info.sku" remove="true"/>

    <move element="mgs.product.title" destination="product.info.main" before="-" />

    <move element="product.info.overview" destination="product.info.main" after="product.addtocaart.form"/>

    <!-- <move element="product.info.price" destination="product.info.main" after="product.brand.name"/> -->

    <container name="product.info.sku.brand" htmlTag="div" htmlClass="product-sub-infomation" after="product.info.review">
        <block class="Magento\Catalog\Block\Product\View\Description" name="mgs.product.info.sku" template="product/view/attribute.phtml">
            <arguments>
                <argument name="at_call" xsi:type="string">getSku</argument>
                <argument name="at_code" xsi:type="string">sku</argument>
                <argument name="css_class" xsi:type="string">sku</argument>
                <argument name="at_label" xsi:type="string">default</argument>
                <argument name="add_attribute" xsi:type="string">itemprop="sku"</argument>
            </arguments>
        </block>
    </container>

    <move element="product.info.sku.brand" destination="product.info.main" after="product.info.price" />

    <move element="product.brand.name" destination="product.info.sku.brand" after="-" />

    <move element="product.attribute.specs.table" destination="product.info.main" after="product.info.price"/>
</body>

Thank you. I have asked this question somewhere else, so when you chance upon that, just ignore it.


texts: What is the reason for adding Pragma: no-cache to page requests by magento

texts:
When loading a Magento based request or page, in the headers of your request, will be a Pragma: no-cache , as well as settings in Cache-Control:  for no-cache and must-revalidate.

In terms of performance, wouldn't it be more suitable allow for these settings to be done by Apache using mod_rewrite?

You could then disable it, via your web server.

This would mean loading a product based page would be loaded from the server each time, even if no new content was given.

As far as I am aware, this is defined by the file:
/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php

Line 292, protected function _sendRedirectHeaders:

    /**
 * Add location header and disable browser page caching
 *
 * @param string $url
 * @param bool $isPermanent
 */
protected function _sendRedirectHeaders($url, $isPermanent = false)
{
    if ($isPermanent) {
        header('HTTP/1.1 301 Moved Permanently');
    }

    header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
    header('Pragma: no-cache');
    header('Location: ' . $url);
    exit;
}

Are there times when Pragma: No-cache should not be used?


texts:
How to get all category attribute Label in magento admin I am using the below code but its returning only name i need to multiple values like description,name,id

$attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode('3', 'name');

echo '<pre>';
print_r($attributeModel->getData());


texts: where can i find the file for the colored "mentions"

texts:
When registering for example you get a green "message" on your screen to let you know you registered, and other messages. errors in red

What file is that in, i'd like to translate but can not find the file..., also i'd like to change colors, is that in a css file?


texts: How to remove onepage checkout Progress Bar in magento2

texts: Attempting to remove progress bar in checkout page in magento2. Unable to hide the progress Bar


texts: Magento Admin shows product as disabled but getStatus() method says product is enabled

texts:
My code shows a particular product as enabled while at the same time the magento admin/products panel says it is disabled.
Are there two fields controlling its enabled/disabled status?
Any insights would be welcome.
Thanks in advance.

(My code below is a paraphrased from my actual code, but the crux bit is the same)

Code Snippet:

    $products = Mage::getResourceModel('catalog/product_collection')
    ->addAttributeToSelect(array('name','sku','price','special_price','final_price','product_status','special_to_date'))
    ->load();

    foreach ($products as $product) {

           $zeroPriceZeroSpecialCount ++;

           $zeroPriceZeroSpecialHtml .= '
' . $zeroPriceZeroSpecialCount .
                '  Name = '  . $product->getName().
                '  SKU = ' .$product->getSku().
                '  Status = ' .$product->getStatus().
                '  Price = ' . $product->getPrice() .
                '  Special Price = ' . $product->getSpecialPrice() .
                '  Final Price =  ' . $product->getFinalPrice() .
                '  Special price To Date = ' .$product->getSpecialTODate().
                '
';
   }

  echo($zeroPriceZeroSpecialHtml);

My output:

  14 Name = Dynamite Baits - Strawberry And Ice Cream Liquid 250ml SKU =
  Status = 1 Price = 7.9900 Special Price = Final Price = 7.99 Special
  price To Date

What Magento Admin/Manage Products Says:


texts: pass data from module controller to layout

texts:
i make a simple module and i want to get all products of category and pass these products to my layout file. as well as i want to get products of a specific category and display these to my layout or view. for this i have to make seperate model or i can use build in functionality.
here is some code it write i my controller.

  class Saqi_Builder_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction(){
     $this->loadLayout(array('default'));
     $this->renderLayout();
    }
}


texts:
I wanted to install the free version of this extension and test it.
But I saw that there is only one language version for the free version.
Does anyone know how I can create a file for my language and translate this module?

https://www.iwdagency.com/extensions/one-step-page-checkout.html


texts:
I have created one interface and declared methods and in my model class i have implemented interface and methods have been defined.

Now in my other constructor class i'm injecting this interface and invoking its methods then its giving error as cannot instantiate interface .... However if i use my model class in the constructor which is implemented interface methods then its working fine.

But i have noticed that customer interface can inject in any class constructor and able to call its methods.

So please help me on how to inject interface in any class constructor and calling its methods.


texts: How to programmatically set description in simple associated products?

texts:
I need set description in all associated products of specific configurable product and with this code all it's ok except part of code where I insert description in associated products on database.

What command do I use on "how to set description in database"

<?php

define('MAGENTO_ROOT', getcwd());

require "app/Mage.php";

Mage::init();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
umask(0);
Mage::app('admin');

set_time_limit(0);
ini_set('memory_limit', '2048M');

try {

    $configProductIds = [1462];

    foreach ($configProductIds as $product_id) {

        $configProduct = Mage::getModel('catalog/product')->load($product_id);
        $description = $configProduct->getDescription();

        $childIds = Mage::getModel('catalog/product_type_configurable');
        $childIds = $childIds->getChildrenIds($configProduct->getId())[0];

        foreach ($childIds as $childId) {

            $childProduct = Mage::getModel('catalog/product')->load($childId);
            // how to set description in database
            $childProduct->save();
        }
    }
} catch (Exception $e) {
    print_r($e->getMessage());
    echo "

";
}


texts: footer_links not displaying Magento 1.9.1

texts:
Help, I am missing on the frontend homepage the footer: company with about us, etc. etc.
On the backend under: CMS/pages, the about us pages is enabled?
Can anyone provide help?


texts:
I want to generate dynamic meta title categories, based on category level.

In view.phtml category this is my code:

<?php
    $category = Mage::getSingleton('catalog/layer')->getCurrentCategory()->getParentCategory()->getTopCategory();
    $level = $this->getCurrentCategory()->getParentCategory()->getLevel();
    $curCatName = $this->getCurrentCategory()->getName();
    $halaman = "Halaman ".Mage::getBlockSingleton('page/html_pager')->getCurrentPage();
    $suffix = Mage::getStoreConfig('design/head/title_suffix');
    $newMetaTitle = "";
    if($level == 1){
        $newMetaTitle = "Sell"." "."any"." ".$curCatName." ".$suffix;
    }
    if($level == 2){
        $newMetaTitle = "Sell"." ".$curCatName." "."more items"." | ".$halaman." | ".$this->getCurrentCategory()->getParentCategory()->getName()." ".$suffix;
    }
    if($level == 3){
        $newMetaTitle = "Sell"." ".$curCatName." "."more items"." | ".$halaman." | ".$this->getCurrentCategory()->getParentCategory()->getName()." ".$suffix;
    }

    echo $newMetaTitle;
    ?>

The question is: I want to pass $newMetaTitle into head.ptml. How to do that?


texts: Magento 2 - Composer require "extension" installation error

texts: Can't able to install extension using composer,


texts: Search in Magento products error: Invalid filter type

texts:
I am using Magento 2.2 and a custom theme. When using the frontend search, I am getting the following exception (URL e.g. /catalogsearch/result/?q=Tshirt)

1 exception(s):
Exception #0 (InvalidArgumentException): Invalid filter type

Exception #0 (InvalidArgumentException): Invalid filter type
#0 /var/www/vhosts/sanodo.de/maintenance.sanodo.de/vendor/magento/framework/Search/Request/Cleaner.php(113): Magento\Framework\Search\Request\Cleaner->cleanFilter('visibility_filt...')
#1 /var/www/vhosts/sanodo.de/maintenance.sanodo.de/vendor/magento/framework/Search/Request/Cleaner.php(212): Magento\Framework\Search\Request\Cleaner->cleanQuery('visibility')
#2 /var/www/vhosts/sanodo.de/maintenance.sanodo.de/vendor/magento/framework/Search/Request/Cleaner.php(92): Magento\Framework\Search\Request\Cleaner->processQueryReference(Array)
#3 /var/www/vhosts/sanodo.de/maintenance.sanodo.de/vendor/magento/framework/Search/Request/Cleaner.php(57): Magento\Framework\Search\Request\Cleaner->cleanQuery('quick_search_co...')
#4 /var/www/vhosts/sanodo.de/maintenance.sanodo.de/vendor/magento/framework/Search/Request/Builder.php(142): Magento\Framework\Search\Request\Cleaner->clean(Array)

...

I could not find any information on this error.


texts:
After updating several patches on the Magento environment I've run into a bug that I cannot get solved. When logging into my account and setting up a order, everything works fine. Now I am getting an error on the register an account page:

Cannot save the customer.

I cannot find where the problem is coming from and I've been looking around for the bug on here for a while, no solutions. What is going wrong and where is it bugging? The error im getting when setting up a message after the PHP code is:

Cannot save the customer.Invalid method Mage_Customer_Model_Customer::cleanPasswordsValidationData(Array ( ) )

What does this mean and where am I making a mistake?


texts: Difference between INDEX_TYPE_INDEX and INDEX_TYPE_UNIQUE

texts:
While adding index, it is not necessary for the column values to be distinct.
So, in those case what is the Varien_Db_Adapter_Interface which is used in the ->addIndex() function.

Also, what is the exact difference between INDEX_TYPE_INDEX and INDEX_TYPE_UNIQUE since there is no documentation regarding the same.


texts:
I just setup Magmi, wanting to use it for making importing stuff easier. However, I was pretty dazzled when I visited magento magmi/web/magmi.php and realized I didn't ask for any login credentials.

Can someone please explain me how this can be safe?

Thanks!


texts: Cart Shipping estimate not rendering html correctly

texts:
I've installed aditional shipping method module on my site, and getting the strage error.

Please see image.

For some reason in the Cart it doesn't render the content correctly, but when I go to pay and there also can pick a shipping method it's rendered ok?

Checked out the code of both pages and the code is the same on both:


texts: How do you remove the short product description from the product page Magento 2

texts: I don't want the short description to show up on my product pages. How do I get rid of it? I am in Magento 2.1.2. I've tried deleting it from the attribute set but it won't let me remove it. Perhaps it is because I already have data in there? Thanks for any suggestions.


texts: Show error message when you click checkout

texts:
I want to be able to show a message when my user clicks on the "checkout" button. Because I need to check if the final cart amount isn't lower then 30€.

So I figured it'll be best to show the message when the user clicks the checkout button.

I created this .xml, but don't know if that's the event to use "sales"

<config>
<modules>
    <Curiosidade_CompraInicial>
        <version>1.0.0.0</version>
    </Curiosidade_CompraInicial>
</modules>
<global>
    <models>
        <curiosidade_comprainicial>
            <class>Curiosidade_CompraInicial_Model</class>
        </curiosidade_comprainicial>
    </models>
    <helpers>
        <curiosidade_comprainicial>
            <class>Curiosidade_CompraInicial_Helper</class>
        </curiosidade_comprainicial>
    </helpers>
</global>
<frontend>
    <events>
        <sales_quote_save_before>
            <observers>
                <curiosidade_comprainicial_enforceSingleOrderLimit>
                    <class>curiosidade_comprainicial/observer</class>
                    <method>enforceCompraInicialLimit</method>
                </curiosidade_limitedinheiro_enforceSingleOrderLimit>
            </observers>
        </sales_quote_save_before>
    </events>
</frontend>
<default>
    <sales>
        <curiosidade_comprainicial>
            <active>1</active>
            <compra_inicial_montante>1500</compra_inicial_montante>
            <compra_inicial_montante_msg><![CDATA[Não pode fazer uma compra acima de %s.]]></compra_inicial_montante_msg>
        </curiosidade_comprainicial>
    </sales>
</default>


texts: How to place order automatically on selected date by customer in magento 1.9

texts:
I want to create one extension in that I want below functionality so please help me with that
-> customer can choose the date from my account section
-> On the selected date, customer-selected products placed in the order with COD.
Please suggest any extension or steps
thanks!


texts:
i've been noticing this for a while, if i have been sitting on the backend for a while and i go to a new section it redirects me back to the dashboard however if i was sitting on the backened and i deleted the magento install folder and copied it from our TFS stored copy when i go to load another section it asks for me to login

i am wondering, Why does Magento redirect back to the backend dashboard but not ask to login, is there some file in the cache which when my session expires just creates a new one from here (and thus if i deleted it i would be forced to log back in) or is there something else going on


texts: In Magento 1, to echo the store VAT number from a CMS page, I'd use {{config path="general/store_information/merchant_vat_number"}}. How do I do this in Magento 2?


texts:
I want to create three new order attribute for checkout page, so I found good tutorials to create using install script but I want to add text boxes to checkout page and save it to database,

Are there any simple solution ? ( free module )


texts: Client continually hitting Max Children Limits on PHP

texts:
I have a client who is with an un-named hosting company on a shared server. They are continually hitting a Max Children Limit on their PHP which causes their site to crash.

Is there away in Apache to clean these up?


texts: I just put merge and minify html css and js to yes in admin panel of magento2.1. I'm in production mode and clean and flush cache and indexer are reindex but still I see all css and js files in page source that are not merged and minified. What should i do?


texts: Magento 2.2.5 - Connect register.phtml to the database

texts:
At the moment I'm struggling with sending data through my register.phtml.

The situation right now is,
I've created a module that allows me to override the core register.phtml with my own custom register.phtml which contains several fields. Using Pbmage_AttributeManager I've created several customer attributes.

What I am trying to do is, connect the fields that I have made in my custom register.phtml to the attributes that I have created in the database.

I've been looking at the core register.phtml, but I have yet to figure out what their way is of sending data to the database.

Thank you for taking your time reading this.


texts: Sort By Price: Low to High & High to Low using Magento 2

texts: I want to add filter option: Sort By Price, Low to High & High to Low in sort by box.


texts: How to add breadcrumbs in product category and product details page in Magento 2?

texts:
I have added the following code to the following file.

  app/design/frontend/Emthemes/everything/diamond/Magento_Catalog/layout/default.xml

<move element="breadcrumbs" destination="content" before="-" />

But it's not working for me.
Anyone can help me regarding this.


texts: Magento 2, how to add `attribute` and `custom option` of configuration product into cart?

texts:
Using Magento 2.2, API, Configurable Product. I had read the Similar Question for add attributes with custom option but it cannot help me to understand. I need to create new Web Service for Add Product To Cart look like image below. Please help to explain me.

  Add Configuration Product To Cart on Web Front End


texts: How can I change the position of the Country and the Postal code for email PDF invoices?

texts:
I would like to change the position of "country" with "zip code"?
Everything else is correct.

You can see the Value:

  Zürich, 8605

and

  Schweiz

Those need to be changed, but where can I do this?


texts: How to Programmatically set a Product's Multi-Select Attribute by Labels

texts:
If have a multiselect attribute and want to set the selection on a product.

$selectedOptions = "red,green,blue";
$product->..... // # what to do?

How can I do that?


texts: How to add order state to Bank Transfer payment?

texts:
We need to add a Pending state to the order when the invoice is created.

This works good with all the payment methods, but not with Bank Transfer.

In my configuration I have the new order state when client wants to pay by Bank Transfer as Processing.

Now I need to add a Pending state when I create an invoice in the admin. How can I do that?

  Why we need this?
  We have diferent people reponsible for different
  tasks, shipping is working based on states. Ex. if the order is in
  Pending state, then the shipping department is shipping those items,
  because we have the payment.

I hope I've explained my self,

Please sugest a posible solution,

Thanks,


texts: How to Fetch Product child Function Outside External file in Magento

texts:
I want to fetch all child function of magento outside of it.I have CORE_PHP with some jquery functionality and php function,In that Files,I need to add Product Children Function of  magento into that core_php files.How is it possible? I used this code for called magento functionality.

My Idea is product details page html block will be fetch and display outside External file and user will need to customized product Image using HTML5,JS works and make cart as an individual product.(Just like Customized products).On that External page i just fetch product Name, Description, Image and so on using this code

$_product = Mage::getModel('catalog/product')->load($pid);
echo $_product->getName();

I need to get ChildHtml Block (<?php echo $this->getChildHtml('addto') ?>) content into external file (sample.php).How to achieve it.

For example : <?php echo $this->getChildHtml('addto') ?> This ChildHTML function will fetch outside of Magento and this functionality can be modified into custom core PHP file <?php echo Mage::getSingleton('core/layout')->getChildHtml('addto') ?> . But this concept not working in my custom file.So i need to get all childHtml function outside magento. Working example of fetching magento data outside of it.

$base = __DIR__ . '/../';
require_once($base.'/app/Mage.php'); //Path to Magento
umask(0);
Mage::app("default");
Mage::getSingleton("core/session", array("name" => "frontend"));

Mage::app()->loadArea('frontend');

$layout = Mage::getSingleton('core/layout');
Mage::getSingleton('core/translate')->init('sv_SE', true);
//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();

//get the loaded head and header blocks and output
$headBlock = $layout->getBlock('head');
$headerBlock = $layout->getBlock('header');
$footerBlock = $layout->getBlock('footer');

echo $headBlock->toHtml() . $headerBlock->toHtml();

// Change 12 to the ID of the product you want to load
$pid = $_REQUEST['pid'];
$_product = Mage::getModel('catalog/product')->load($pid);
echo Mage::getSingleton('core/layout')->getChildHtml('addto');

But No result from ECHO value.Is it proper way for render ChildHTML functionality into external file. Can please guide me..


texts:
From time to time magento randomly returns 404 error on existing pages, If I refresh the page - it works.
Is there any way to debug the issue? I suspect that the problem is caused by some extension, but does not know how to determine which one, because the error is not consistent and can occur only several times a day.


texts: bin/magento cron:run running for a long time

texts:
the bin/magento cron:run entry in my crontab seems to cause a rather high load on the cpu (php's and mysql's cpu usage are permanently both at around 25% each) - I checked by disabling the crontab entries.

When I run bin/magento cron:run manually, it runs for about a minute - how can I find out what is causing this behaviour?

I already tried disabling a few suspicious modules, with no luck!


texts: Stock item not put back in stock automatically upon reaching positive inventory

texts:
When a stock item reaches QTY 0 or negative (granted backorders are disabled & QTY for item to become out of stock is 0 as well), is_in_stock is set to 0 automatically.

However, when it then reaches a positive inventory level, is_in_stock is not automatically set to 1. Why is this the case?

Consider the following example:

$product = Mage::getModel('catalog/product')->load($product_id); //where $product_id is an in stock product
$stock_item = $product->getStockItem();
$stock_item->setQty(0);
$stock_item->save();

The product is now listed as out of stock.

$product = Mage::getModel('catalog/product')->load($product_id); //where $product_id is the product now out of stock
$stock_item = $product->getStockItem();
$stock_item->setQty(1);
$stock_item->save();

The product remains out of stock. Should this not be put back into stock?


texts:
I need to create a promotional coupon for my Magento site.
From admin> Promotions> Shopping Cart Price Rules , I added coupon description what I need.
But when I go to the "Manage Coupon Codes" option to generate a new coupon, the block is not clickable.

Why is this happening I don't have an idea. Please help me to solve this.


texts: magento 2.3.3 customer loggin issue quote table is_active?

texts:
Magento 2.3.3 customer login issue quote table is_active?
When there is more than 1 data in the quote table with is_active = 1 then the user is facing login issues.
So I have to change is_active to 0 manually then the user is able to log in.
anyone? I am not able to get this behavior from Magento stuck in this.
Thanks


texts:
I'm trying to save my custom customer attribute when the corresponding checkbox is checked.

But if the customer unchecks the checkbox it should update the attribute to a value of 0.

var newProducts = $('#new_products');
$('input[type="checkbox"').on('click',function () {
    if (newProducts.is(':checked')) {
        <?php
            $customer->getCustomAttribute("new_products_attr")->setValue(1);
            $customerRepository->save($customer);
        ?>
    }
});

The problem I have is PHP runs before the jQuery, I could do an ajax call but then how am I supposed to access the variables needed?


texts:
How can I apply tax in extra fee in magento 2? (With inc and Ex tax)?

Thanks in advance.


texts: I want to restrict no of orders by customer to 99 per month and the total amount limit to $500 per month.


texts: i want to change pop up for paypal on checkout after click continue to paypal

texts:
i want to open pop up in new tab rather just showing in pop up.Can i change the width of Pop up.Plz help
https://ibb.co/iGMBPk


texts: Get Categories Which are visible in Main Navigation in magento 1.9.


texts: OAuth: How to add magento product using oauth rest api from external php script

texts:
I'm new in Magento, I want to add Magento product from my CodeIgniter (external php script).

I have created Web_Services->OAuth_Consumers and get key and Secret.

what is the next step? (also set REST Attribute, REST Roles)

I try googling but not getting proper answer.

Thank you.


texts: How do I add a configurable as a related product and show it's options in Magento 2.1

texts: I am using Magento 2.1.9 and I would like the customer to see related products on a product page that are configurable without navigating away from original product page. Meaning you can configure and add to cart straight from the related products block. Is this possible to do?


texts: Magento 2 in default newsletter subscribe not working?

texts:
I will attached the phtml and php block code but client side mail does
  not send?

subscribe.phtml

Newsletter

        <form class="form subscribe"
            novalidate
            action="<?php /* @escapeNotVerified */ echo $block->getFormActionUrl() ?>"
            method="post"
            data-mage-init='{"validation": {"errorClass": "mage-error"}}'
            id="newsletter-validate-detail">

                <?php /* @escapeNotVerified */ echo __('Sign Up for Our Newsletter:') ?>

                    <input name="email" type="email" id="newsletter"
                                placeholder="<?php /* @escapeNotVerified */ echo __('Enter your email address') ?>"
                                data-validate="{required:true, 'validate-email':true}"/>

                <button class="action subscribe primary" title="<?php /* @escapeNotVerified */ echo __('Subscribe') ?>" type="submit">
                    <?php /* @escapeNotVerified */ echo __('Subscribe') ?>
                </button>

        </form>

Subscribe.php

<?php

namespace Magento\Newsletter\Block;

class Subscribe extends \Magento\Framework\View\Element\Template
{
    /**
     * Retrieve form action url and set "secure" param to avoid confirm
     * message when we submit form from secure page to unsecure
     *
     * @return string
     */
    public function getFormActionUrl()
    {
        $checkSubscriber = $this->_subscriber->loadByEmail($email);
                    if ($checkSubscriber->isSubscribed()) {
                        $response = [
                            'status' => 'ERROR',
                            'msg' => __('Something went wrong with the subscription.'),
                        ];

                    }
        return $this->getUrl('newsletter/subscriber/new', ['_secure' => true]);
    }
}
?>

Please help this task ???


texts:
I want to know how to replace the "My Wish List" text in toplinks with an icon. I don't want an Icon with pseudo code like "::before". Adding a <i> </i>- tag in the code should be the solution.
The text of My Wish List we can edit in "getLabel()" function of  "Link.php" in module-wishlist. But I don't want any text. Only the Icon should be in storefront visible. If I set the return value to an empty string in getLabel() function then in mobile view it is not visible.
Where I can do that?
I think we need to create an own module and overwrite the files. But which file and what exactly?


texts: How to increase the {{var qty}} digits ? 1 to 000001

texts:
I need increase, Magento default {{var qty}} is like 1 or 10 or 100. now i want to increase the digits purchased qty 1 means = 000001 and same for 10= 000010 for 100 = 000100 need to add 0's in front on EMAIL TEMPLATE only.
Need to increase the digits. please help ! thanks in advance


texts:
I have an observer for sales_order_place_after and this is working. Now I am generating an order myself and would like to trigger this event but it does not get to my observer.

Is something wrong here:

Mage::dispatchEvent('sales_order_place_after', array('order' => $service->getOrder()));

Or do I need to do something special from a external script file? My script looks like this.


texts: Magento 2 - After override Minicart remove link not working

texts:
I am override the minicart,
Source : vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html
My code :
app\code\Zero\MinicartQty\view\frontend\web\template\minicart\item\default.html

If i click the remove link url added "#".


texts:
I have setup a redis server and I see a redis-server running in daemon mode. I thought the following stops the redis server

service redis-server stop

However, when i run that command, the website crashes and it throws up the below error

To avoid that I restart redis with

service redis-server start

or with

src/redis-server

I am not able to understand the difference between the above two restart options.

Also, why does the magento site go down when i stop the redis-server ?

Trying to get a hang of redis and any help/resources greatly appreciated.
Many Thanks.


texts: On order page in action tab want to delete button

texts: In the Sales>Order page on the right side, there is the drop-down option for Actions. In that actions tab, there is the delete option and I want to hide this option from that page. Anyone know how to hide this? Thanks.


texts: Magento 2: How to add array of input fields in admin panel?

texts:
I wanna display an array of input fields in Cart Prices Rules page under Condition's tab like this:

I have a similar example which does this in stores/configuration section but I wanna achieve this in magento Rules somewhere under Conditions section:

Any help?


texts: How to add text at bottom of checkout in magento 2 after block .checkout-container or column main or maincontent


texts:
I have been using this code to redirect visitors from a number of countries to
domain#2 (using GeoIP), which works fine:

RewriteCond %{HTTP_HOST} !^domain\.two$ [NC]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(TH|KH|BN|IN|LA|MY|MM|NP|PH|SG|ID|VN)$
RewriteRule ^(.*)$ http://domain.two/$1 [L]

Now I would like to redirect all countries not listed above to be redirected
to domain.one.
How could I archive this?


texts: How to create a custom payment method module

texts: I was trying something  new on the payment method where people can upload receipt and it will appear in backend I was thinking  about editing the amazon pay and put my own code to it ,I am totally new to this any one here who can help I will be so damn happy


texts: Magento 2 : External link in admin order grid not linking when click

texts:
I have an extra column in my Magento 2 admin order grid, with a column with external urls. This is working well (I see an overview of al my hyperlinks).

But when I click on a url, I go to the order detail page instead of my external url.
I suppose, this is due the "data-bind" Knockout code.
How can I make working urls? Can I disable the onclick events for a single column?

(tricks like css z-index:999 are not working...)


texts: "Not visible products" showing up in default Magento sitemap.xml

texts:
When I generate a Magento sitemap.xml, all the "not visible individually" products are showing up in the xml file.
I indexed and refreshed my cache multiple times and this is not by default this way.
Any ideas how to fix this?
Thanks in advance.


texts:
When I upgraded from 2.2.0 to 2.2.2
I having an issue with 404 on the homepage.
every setting in stores/configurations/general/web/default pages seems to be ok, even checked the core_config_data table which also seems to be alright.
I have deleted all modules/themes to avoid conflicts
cache cleared
var folder deleted
i have used

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

couple of times already
Any suggestions?


texts: Get custom product attribute by product-id in Grouped Product

texts:
I want to display custom product attribute of simple product on Grouped-product in Grouped phtml file (app\design\frontend\Company\theme\Magento_GroupedProduct\templates\product\view\type\grouped.phtml) but not getting success.

There are few simple products added in grouped product and all simple product have 1 attribute which i want to display on grouped-product-page.

Magento Version: 2.1.8 but I am ok if i got response for any magento 2.1.x version.

Any help would highly appreciated. Thanks.


texts: CAPTCHA is not shown at Login/register form in Magento 1.7 version

texts:
I followed below steps to show captcha in login and registration form. But I can't see it.

Login to backend
Go to system > configuration > customers > customer configuration > CAPTCHA and select your website scope

Enable CAPTCHA on frontend - Yes

Select all forms into Form box

In Displaying Mode box select After number of attempts to login

Number of Unsuccessful Attempts to Login = 0

Save Config

Go to frontend and press Log in link
Is there any thing else left to enable captcha in login or registration form...


texts:
I have created a theme from scratch using the CSS of Foundation 5, by overriding the Magento base template. Everything is fine with the CSS. However, when I include the Javascript of Foundation, some Magento plugins aren't working anymore.

So my question is: What is the proper way to include Foundation 5 and all of it's javascript features?

Here is the site I am using it goo.gl/OaE08J .

Thank you in advance


texts: Magento 2.2 - custom attribute module fails

texts:
I've made a custom attribute module using this magento stackexchange Link to article.

etc/frontend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="core_layout_render_element">
        <observer name="core_layout_render_container_attribute" instance="Stackoverflow\ContainerAttribute\Observer\LayoutSchemaAttributesObserver" />
    </event>
</config>

Observer/LayoutSchemaAttributesObserver.php

namespace Stackoverflow\ContainerAttribute\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\View\Layout\Element;

class LayoutSchemaAttributesObserver implements ObserverInterface
{

public function execute(\Magento\Framework\Event\Observer $observer)
{
    /** @var \Magento\Framework\View\Layout $layout */
    $layout = $observer->getEvent()->getLayout();
    $elementName = $observer->getEvent()->getElementName();

    if($layout->isContainer($elementName) && ($containerTag = $layout->getElementProperty($elementName, Element::CONTAINER_OPT_HTML_TAG))) {
        $nodes = $layout->getXpath(sprintf('//*[@name="%s"]/attribute[@name]', $elementName));
        if ($nodes) {
            /** @var \SimpleXMLElement $_node */
            foreach ($nodes as $_node) {
                $name = $_node->attributes()->name;
                $value = $_node->attributes()->value;
                $output = $observer->getEvent()->getTransport()->getOutput();
                $output = preg_replace(
                    "/^(<$containerTag.*?)(>)/",
                    sprintf("$1 %s$2", ($name && $value) ? sprintf("%s=\"%s\"", $name, $value) : $name),
                    $output
                );
                $observer->getEvent()->getTransport()->setOutput($output);
            }
        }
    }
}
}

This then allowed me to use:

<attribute name="customAttribute" />

It worked great in 2.1 did exactly what i needed. However after upgrading to 2.2.0 I'm now getting the following error:

  Element 'attribute': This element is not expected. Expected is one of
  ( block, container, referenceBlock, referenceContainer, uiComponent ).

Obviously attribute isn't a valid xml tag for M2.2 but, why can't I now use this? What has changed in M2.2 that makes this no longer work?

As always, appreciate any help.


texts: Getting error on reindexing from terminal in Magento 2

texts:
I have installed fresh magento 2 in my local server. Now when i am trying to reindex from my terminal in Ubuntu its givng error i.e.:

  PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found

Prior i have installed magento 2, but it was working fine.


texts: Do you have any Tips for Magento 2 SEO? Help me

texts: I am a newbie in Magento 2 and I am learning about SEO. Is there anyone who knows about Magento 2 seo best-practices?


texts: Getting error to create sitemaps in a separate directory for each store view

texts:
While I'm trying to create the sitemaps in separate directories, it lets me create the first one only and for the second one gives me error:
Path "/sitemap/en/en_sitemap.xml" is not available and cannot be used. My wish was below structure

/sitemap/nl/sitemap.xml
/sitemap/en/en_sitemap.xml

I have checked the ownership and permissions, what could be wrong?


texts: Install/Upgrade Scripts - Can they run multiple times when multiple users are hitting the site before they are done?

texts:
We have a couple of updates that we'd like to run by way of a module's upgrade script.  One of them takes about 5 minutes to complete.

The problem here that we are not sure about is that the site is very active.

So when we push the upgrade script to production, how will it behave?

Will the upgrade script continually be run multiple times when people are hitting the site until one instance of it is finally complete?

Is Magento smart enough to only run one instance of it (even if it is not completed yet and other people are hitting the site)?

We are on Magento EE 1.9.


texts: magento 1.9x Add attribute in Inventory tab?

texts:
Here is the setup script to add attribute to General tab, but how to add it into Inventory tab instead?

$installer = new Mage_Catalog_Model_Resource_Setup('core_setup');
$installer->startSetup();

$attributeSetDefault = 'Default';
$attributeGroup = 'General';
$attributeSetId = $installer->getAttributeSetId('catalog_product', $attributeSetDefault);
if ($attributeSetId) {
    $attributeGroupId = $installer->getAttributeGroupId('catalog_product', $attributeSetId, $attributeGroup);
}

// Attribut : Barcode EAN13
$attributCode = 'localisation';

$attribute = $installer->getAttribute('catalog_product', $attributCode);
if (empty($attribute['attribute_id'])) {

    $installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attributCode, array(
        'type' => 'varchar',
        'input' => 'text',
        'backend' => '',
        //'input_renderer' => 'PointOfSales/adminhtml_product_helper_form_barcodeean13', //definition of renderer
        'label' => 'Localisation',
        'class' => '',
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'visible' => true,
        'required' => false,
        'user_defined' => false,
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => false,
        'unique' => false,
        'apply_to' => 'simple',
        'configurable' => false,
    ));

    $attributeId = $installer->getAttributeId('catalog_product', $attributCode);

    if ($attributeGroupId && $attributeId) {
        $installer->addAttributeToGroup('catalog_product', $attributeSetId, $attributeGroupId, $attributeId);
    }
}
$installer->endSetup();


texts: combine products of 2 categories to one category

texts:
we created 4 categories.

Category 1, 2 , 3, 4

all have 50 + 50 + 50 + 50 products,

I created category 5 and category 6 ,

I want to add products of "category 1 & 2" to Category 5

I want to add products of "category 3 & 4" to Category 6.

is there any solution for this in magento site.

please hel pme to find solution.

thanks in advance.


texts: Magento Database: Negative values in sales_flat_order.discount_amount?

texts:
Looking into my Magento database inside the sales_flat_order table, I find - since the day I updated from the 1.4 to the 1.5 version - the values of discount_amount being negative (e.g. -5 EUR for a 5 EUR coupon code).

Before that date (in the database), all the discount_amount values are positive (e.g. 5 EUR for a 5 EUR coupon code).

Now I'm puzzled. Does Magento by standard store positive or negative values into the sales_flat_order table?

I assume that there should be a positive number in that field and the negative number has been introduced in error. However gaining some clarification through feedback by others would be great.

Additional notes:

The database design itself allows to store both negative and positive values in that column.
In the admin, orders with both a positive or negative discount_amount (and base_discount_amount) do behave exactly the same with the only difference having the number displayed as negative or positive. But negative numbers magically get multiplied by -1 in the calculation.


texts: Override core file using preference not return value

texts:
I am trying to override my core file using preference,
Note : I am override vendor\magento\module-wishlist\CustomerData\Wishlist.php
Module:
app\code\Zero\WishlistBrand\registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Zero_WishlistBrand',
    __DIR__
);

app\code\Zero\WishlistBrand\etc\module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Zero_WishlistBrand" setup_version="1.0.0">
    </module>
</config>

app\code\Zero\WishlistBrand\etc\frontend\di.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <preference for="Magento\Wishlist\CustomerData\Wishlist" type="Zero\WishlistBrand\CustomerData\Wishlist" />

</config>

app\code\Zero\WishlistBrand\CustomerData\Wishlist.php
<?php

namespace Zero\WishlistBrand\CustomerData;

class Wishlist extends \Magento\Wishlist\CustomerData\Wishlist
{
    protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem)
    {

        $product = $wishlistItem->getProduct();
        return [
            'image' => $this->getImageData($this->itemResolver->getFinalProduct($wishlistItem)),
            'product_sku' => $product->getSku(),
            'product_id' => $product->getId(),
            'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem),
            'product_name' => 'tesxt text text',
             // added following
            'product_brand' => $product->getResource()->getAttribute('brand')->getFrontend()->getValue($product),

            'product_price' => $this->block->getProductPriceHtml(
                $product,
                'wishlist_configured_price',
                \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST,
                ['item' => $wishlistItem]
            ),
            'product_is_saleable_and_visible' => $product->isSaleable() && $product->isVisibleInSiteVisibility(),
            'product_has_required_options' => $product->getTypeInstance()->hasRequiredOptions($product),
            'add_to_cart_params' => $this->wishlistHelper->getAddToCartParams($wishlistItem),
            'delete_item_params' => $this->wishlistHelper->getRemoveParams($wishlistItem),
        ];
    }

}
?>

Note : I am override vendor\magento\module-wishlist\CustomerData\Wishlist.php
It's not return anything.
I am calling

app\design\frontend\Zero\sleepworld\Magento_Wishlist\templates\sidebar.phtml
Code : https://codeshare.io/50mWPe line number: 50


texts: How can I reference a file in my custom module?

texts:
I have a csv file in my custom module that I would like to open and parse in my Setup/InstallData file.
The csv is located in MyModule/MyDirectory/files/.
When I try to reference the file using the relative path, ../../files/myfile.csv, I get the error:

[ErrorException]
  file(../../files/myfile.csv): failed to open stream: No such file or directory

How can I get the file path of my csv so I can open it using open() ?


texts: Ordering a catalog/product collection by sales data

texts:
I have a 'catalog/product' collection which is being filtered by product attributes, but I need to order this collection so that the most popular (sales OR views) come first.

Is there a way to do this?

This is my code:

$collection = Mage::getModel('catalog/product')->getCollection();
    ->addAttributeToSelect('entity_id')
    ->addAttributeToFilter('visibility', 4)
    ->addAttributeToFilter('recipient', 13)
    ->addAttributeToFilter('personality', 99)

$collection->clear()->setPageSize(10)->load();


texts: Get confirmation email from ProductAlert module

texts:
Currently I have extended Magento_ProductAlert module so that user can subscribe to out of stock product by entering his email address. So far everything works - email gets saved in database and email about back in stock product gets also sent to user.

But now I want to send one more email - lets call it "confirmation email" - the email which is sent to user when he has successfully subscribed to product to get notification when this product will be back in stock. I've already tried some variations which I've found on internet but with no luck.

Can someone maybe help me what I have to extend to send 2 emails instead of 1?

First email - "You have succsessfully subscribed for product X" (this is what I want to add)

Second email - "Hello, We wanted to inform you that product X is back in stock" (this is what I already have)

Thank you!


texts: Is it possible to use the sub-category thumbnails as a link to the category? So that you can click the thumbnail instead of the text, if yes, can you then also remove the text?


texts:
I am upgrading to Magento 2.2.5 to Magento 2.3.0, Some of the third party module is giving error while composer update. my current php version is 7.2.12

Can you please help me out? Please refer below screenshot:

I have also tried composer require [ModuleName] 2.3.0 --no-update
But it is giving package not found error:

  [InvalidArgumentException]
  Could not find package ModuleName in a version matching
  2.3.0


texts: checkout problem with 1.9.3.4 after upgrade

texts:
I have upgrade from 1.9.3.2 at 1.9.3.4. I do not installed any 9767 patches.
checkout Process is blocked.
The checkout process does not proceed from first step.
how to solve ?


texts: Sort product collection on stock status in magento2.3

texts:
I want to sort my list.phtml and catalogsearch by availability.
Mean that when category page or search result page loads, first show "in stock" product and at the end show out of stock items.
Don't want to show or sort on "sort by" function. want to show from load. by default i set "sort by" to lowest price but need to show lowest price and availability is in stock.


texts: Magento 1.8 Need database query change all products custom design template

texts:
Ok I am in the process of updating a theme in Magento 1.8 and have everything set except the products are still showing the old theme. The store has about 1800 products and would take me forever to change the theme for every one manually. Is there a query to change them on all of the products at once?

The setting can be found in the admin panel:
Catalog -> Manage products -> select product -> design -> custom design dropdown
(see image below)

what I would like to change it to, you can see from the image below

Any help with this will be greatly appreciated.
Thanks in advance,
jmituzas


texts: Filter and sorting not working in custom culumn in upsell_product_listing.xml

texts:
I have joined column qty to Magento\Catalog\Model\ResourceModel\Product\Collection
But Sorting filter by qty not working and sorting too in upsell_product_listing
/app/code/Vendor/UpsellProducts/etc/adminhtml/di.xml
    <virtualType name="upsell_product_listing_data_source" type="Magento\Catalog\Model\ResourceModel\Product\CollectionFactory">
    <arguments>
        <argument name="instanceName" xsi:type="string">Vendor\UpsellProducts\Model\Grid\JoinProductCollection</argument>
    </arguments>
</virtualType>
<type name="Magento\Catalog\Ui\DataProvider\Product\Related\UpSellDataProvider">
    <arguments>
        <argument name="collectionFactory" xsi:type="object">upsell_product_listing_data_source</argument>
    </arguments>
</type>

/app/code/Vendor/UpsellProducts/Model/Grid/JoinProductCollection.php
namespace Vendor\UpsellProducts\Model\Grid;

use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;

class JoinProductCollection extends ProductCollection
{

    /**
     * @return OriginalCollection|void
     */
    protected function _initSelect()
    {
        $this->addFilterToMap('qty', '_inv.qty');

        parent::_initSelect();
    }

    /**
     *
     */
    protected function _renderFiltersBefore()
    {

        $this->getSelect()->joinLeft(
            array('_inv' => $this->getResource()->getTable('cataloginventory_stock_item')),
            "e.entity_id = _inv.product_id",
            array('qty')
        );

        parent::_renderFiltersBefore();
    }
}

Vendor/UpsellProducts/view/adminhtml/ui_component/upsell_product_listing.xml
        <column name="qty" component="Magento_Ui/js/grid/columns/select">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="sortOrder" xsi:type="number">60</item>
                <item name="filter" xsi:type="string">textRange</item>
                <item name="label" translate="true" xsi:type="string">Qty</item>
            </item>
        </argument>
    </column>

error when trying how to filter by qty
    main.CRITICAL: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'at_qty.qty' in 'where clause', query was: SELECT DISTINCT  COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e` WHERE

Can`t understand why in error is column "at_qty". Maybe in need to join the column somewhere else?


texts: Update customer address using address id in magento 2

texts: How can I update customer address by address id in Magento 2 programmatically  ?


texts: Multiple payment methods on one transaction

texts:
We have a Gift Card module we wrote and the custom has now required that we make the Gift Card a Payment method. We will then need to allow for two forms of payment on a single transaction. I thought this would be a common thing but it is proving harder to find a solution.

Is there an existing module or am I searching the wrong way?

EDIT:
Basically we want the following:

Customer checkout : balance is $100
Customer makes payment from the following:

Type1(Visa) $70
Type2(Mastercard) $30


texts: How to translate this 4 items(s) in magento 2 in my order tab after login


texts:
I have a popup form with DOB field. I would like to get Calendar shown when a customer clicks on DOB text field or on click on calendar icon beside DOB field.
My HTML is:

                Date of Birth

                    <input type="text" name="dob" id="customer_dob" value="" class="_has-datepicker" data-validate="{required:true}" autocomplete="off" aria-required="true" /><button type="button" class="ui-datepicker-trigger v-middle">Select Date</button>


texts: I am getting lots of 404 errors in Fire Bug's Net tab. I have attached the screen shot to know more. The error gets continuously incremented in Fire Bug. I have checked for this and getting solutions for this but not related to this type of problem.


texts: show the value of an attribute of a product magento 1.9

texts:
i need show value the hardness attribute is type text

The code:

<?php

require_once("app/Mage.php");

Mage::app();

$products = Mage::getModel('catalog/product')->getCollection();

foreach($products as $product)
{

    $sku = $product->getSku();
    if($sku == '5555')
    {
        echo '
';

        $x = $product->getResource();
        $y = $x->getAttribute('name');
        $z = $y->getSource();
        $attr = $z->getAttribute('name');
        echo get_class($attr);
        echo "Nombre: ".$attr->getName()." ID: ".$attr->getId();
        echo "
-----------------------------------------------------------------------------------------------
";
        echo '
';
    }
}


texts: Category custom attribute, doesn't save value - Magento 2.1.2

texts:
I am creating a custom attribute for categories using this resource.

The attribute field "Tagline - Category Head" is shown fine in the backend, but when I type a value and save the category, the value is not saved (it stays blank). I also searched the database for any field named "tagline" and nothing came up.

Here is the code

Setup/InstallData.php (just the install function)

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    /**
     * Add attributes to the eav/attribute
     */

    $eavSetup->addAttribute(
    \Magento\Catalog\Model\Category::ENTITY, 'tagline1',
        [
            'type' => 'text',
            'label' => 'Tagline - Category Head',
            'input' => 'text',
            'source' => '',
            'visible_on_front' => true,
            'required' => false,
            'sort_order' => 100,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'group' => 'General Information',
        ]
    );
}

view/adminhtml/ui_component/category_form.xml

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="taglines">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Taglines</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">100</item>
            </item>
        </argument>
        <field name="tagline1">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">1</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">Tagline - Category Head</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>


texts: Website Search Query to list out all your products

texts:
What search query to enter into the search bar present in an E-Commerce website developed by Magento which will list out all the products present on that E-Commerce Website?
For Example, for websites developed using Presta Shop if you enter a single space and hit search it will list out all the products present on the website. This is true for any website developed using the Presta Shop Platform. I was wondering if there exists any similar hack for Magento Websites?


texts: I need to create a simple custom payment method like "cash on delivery" but with extra fee when customer selects it. I implemented payment method, but can't find how to make part with extra fee. Can anybody give me a hint?


texts: How to Generate Category Specific Site Map in Magento 2?

texts:
Can anyone please suggest any extension or custom code that'll help me to generate category specific sitemap?

We have around 500K+ products and would like to generate sitemap like

www.website.com/sitemap/category1.xml
www.website.com/sitemap/category2.xml
www.website.com/sitemap/category3.xml
www.website.com/sitemap/category4.xml


texts: Multistore, multiple languages: optimal SEO versus user friendliness

texts:
I have read these threads, but they don’t seem to answer my confusion:

How to create Multiple Store with different domain in Magento
http://www.ecommercegorilla.com/how-to-set-up-multiple-store-fronts-with-magento/
Optimise URL when changing Store and language switcher to maintain SEO standards

Our situation:

Magento 2.2.6
multi-website, multi-store, multi languages
each store-view is a different language (English, French, German, etc.)
Store-view switching (within the same store) via country-flags
Store code are language based (EN, DE, FR, etc..) for the main website

The best set-up advice for optimal SEO appears to be:

Create Sub-directories. Not Sub-domains or ccTLDs:
Source: https://www.searchenginejournal.com/subdomain-subdirectory-cctld/226545/

Turn off ‘Add Storecode to URL’

Server URL rewrites: yes.
Source: https://www.predikkta.com/blog/your-essential-guide-to-magento-technical-seo.html

My confusion
My confusion comes from my assumption that each language should have its own URL. And the only way to achieve this is by turning on ‘Add Storecode to URL’.  But the above SEO settings appear to contradict this assumption. What am I not understanding or missing?

My questions:

1.Is setting 2 and 3 also true for our situation (multistore / multi languages)?
2.If yes,
2a how does Google then know to separate the different language store views when indexing? So that each has a chance for maximum SEO
2b is there then any different URL per language? Or is this not needed and is my assumption out-dated?
2c how does a French visitor know he is in the French store-view and not the English store-view? The URL would then not give any indication, I think?


texts: Get list of disabled products in Magento 2 with SQL query?

texts: How can I get a list of disabled products in magento 2 using sql query?


texts: Magento white screen after applying changes and running deploy command?

texts:
I am new to Magento and I am facing this issue can any guide me? please after running these commands

php bin/magento deploy:mode:set developer

Then try running:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static:content:deploy -f
php bin/magento c:f


texts: Upgrade Magento 1.5 to 1.9 Call to undefined method Mage_Core_Model_App::getIsCacheLocked()

texts:
I did an upgrade from 1.5 to 1.9 but after the upgrade I get the following error:

Fatal error: Call to undefined method Mage_Core_Model_App::getIsCacheLocked() in /var/www/demanchetknopenwinkel/app/code/core/Mage/Core/Model/Resource.php on line 112

I followed the steps from the site duntuk.com to upgrade but after that, no go.

Reindexing also gives the same problem.

Any idea on how to fix?

Br,

Steve


texts: Magento 1.9.0.1 don't set out of stock automatically on simple products

texts:
We are running a shop that has the inventory functions enabled. We have configurable products where the simple products can fall under a stock of 0 and are ordered from our supplier when a order hits us.

The current behavior is, that if a product falls to zero it is automatically set to "out of stock" and therefore not shown anymore in the frontend.

Our wanted behavior is, that the stock availability is NOT set by Magento or it is shown in the frontend that the simple product is out of stock.

We thought this should be possible by setting the Allow qty Below 0 setting to yes but unfortunately Magento still sets the availability from the simple product to "Out of stock".

Are some of our settings wrong or am I missing something else?


texts:
Transactional email variables not passing to template. I'm defining the email variables and sending the email as such.

class Sendemail
{

   /**
     * @var  \Magento\Framework\Mail\Template\TransportBuilder
     */
    private $_transportBuilder;

  public function __construct( \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder){

    $this->_transportBuilder = $transportBuilder;
  }

  public function sendEmail($sender, $recipient, $template, $store)
  {

    $retrievalcode = "somecustomcode";
    $vars = Array('retrieval_code' => $retrievalcode);

     $transport = $this->_transportBuilder->setTemplateIdentifier($template)
            ->setTemplateOptions(['area' => Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $store])
            ->setTemplateVars($vars)
            ->setFrom($sender)
            ->addTo($recipient)
            ->getTransport();
        $transport->sendMessage();
  }

}

The email is sending but it not including the defined template variable. Any suggestions would be appreciated.The variable is being call in the transactional email template as:

{{var retrieval_code}}


texts: M2 di compiling throws error because of incompatible argument type

texts:
I have the following class in Magento 2:

namespace Vendor\MyModule\Block;

class ProductTab extends \Magento\Catalog\Block\Adminhtml\Category\Tab\Product
{
    /**
     * @var \Magento\Framework\App\Config\ScopeConfigInterface
     */
    protected $_scopeConfig;

    /**
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Backend\Helper\Data $backendHelper
     * @param \Magento\Catalog\Model\ProductFactory $productFactory
     * @param \Magento\Framework\Registry $coreRegistry
     * @param array $data
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Backend\Helper\Data $backendHelper,
        \Magento\Catalog\Model\ProductFactory $productFactory,
        \Magento\Framework\Registry $coreRegistry,
        array $data = [],
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
    ) {
        $this->_productFactory = $productFactory;
        $this->_coreRegistry = $coreRegistry;
        $this->_scopeConfig = $scopeConfig;
        parent::__construct($context, $backendHelper, $coreRegistry, $data);
    }
}

After running rm -rf var/di && bin/magento setup:di:compile I get the following error:

  Errors during compilation:
      Vendor\MyModule\Block\ProductTab
          Incompatible argument type: Required type: \Magento\Catalog\Model\ProductFactory. Actual type: \Magento\Framework\Registry; File:
  /var/www/magento/app/code/Vendor/MyModule/Block/ProductTab.php
  Total Errors Count: 1

What have I done wrong? I don't get it... I just copied the construct-function of the parent and added a 6th argument to it (the scope config).


texts:
i've created a url redirect for when the user types womens/clothing/activate/[ITEM] they can get catalog/product/view/id/[ITEMID]/category/[CATID]

when i use my new url redirect it works fine however when i go into the catalog where the item is i'm the internal url (catalog/product/view/id/[ITEMID]/category/[CATID]) instead of my rewrite, in the template i use getProductUrl()

i am wondering if i'm missing a step to get my products in the catalog view to have my url redirect over the internal one


texts: Magento Test Framework(MTF) vs Selenium with Java - Magento 2.0.1

texts:
I am a newbie in magento testing framework, I had good knowledge about selenium webdriver with Java. I put some little research about MTF sample test module(CreateWidgetEntity), When I run this its follow some flow to create widget in admin. This same thing is possible in selenium with java also(eclipse IDE). so I am not sure MTF provide what best features in testing.
I could found one its generate screenshot,logs as per individual test.

My question is

What are the best features MTF provide over selenium with Java(eclipse)?


texts:
I would like to sort the display of a Magento 2.0.6 website products by date. I am looking forward to apply this sorting on the frontend.

I have been trying to find an extension so I can have this sorting option on the catalog setting but I am out of luck so far.


texts: JS gets automatically removed from CMS page

texts:
I am trying to add some JS to the CMS homepage.
I tried to add an external js file as well as adding the code directly. See code below.
When I save the CMS page and test everything the js works fine.

However,when I reload the CMS in the Backend again to add more content the js script apparently isn't loaded from the db therefore the whole <script> section gets removed from the cms page and when I save it again is removed from the page.

How do I solve this?

Code:

<script type="text/javascript">
require([
    'jquery',
    'slick'
], function ($) {
    jQuery(document).ready(function () {
        jQuery('.slider').slick();
    });
});
</script>

and with external file:

<script type="text/x-magento-init">
{
  "*": {
    "Magento_Theme/js/slider": {}
  }
}
</script>


texts: Magento 2: Wrong product thumbnail image on search results page

texts:
I've noticed in both the backend catalog search and frontend search that incorrect product thumbnail images are being displayed for certain products if they do not have an image associated with them. Instead, these products show the image thumbnail of the previously appearing product that does have an associated image.

For example, in the below image all of the thumbnails are correct bar the one outlined in red, this particular product should show the Magento 2 placeholder instead as there is no image. But because there is no image it repeats the thumbnail for the last product rather than the placeholder.

All images are hosted off-site so aren't actually held on the server itself. Running Magento 2.1.7.

I'm scratching my head figuring it out so any pointers on where to start looking to diagnose the issue would be greatly appreciated.


texts: Magento 2 - Is there any way to disable Welcome Email after signup for specific store or website

texts:
I have multiple store view setup in my Magento 2 store.

Now I want to disable welcome email for the user that register from the wholesale store. I am trying this solution but it stops sending email to all user.

https://magento.stackexchange.com/a/174419

I am not getting how to do this for the specific store.

Update

I am trying following code

<?php

namespace Company\Module\Model\Plugin;

class EmailNotification extends \Magento\Customer\Model\EmailNotification {

    public function aroundNewAccount(
        \Magento\Customer\Model\EmailNotification $subject,
        \Closure $proceed,
        \Magento\Customer\Api\Data\CustomerInterface $customer,
        $type,
        $backUrl = '',
        $storeId = 0,
        $sendemailStoreId = null
    ) {

        if($sendemailStoreId == 1){
            return false;
        }

        /*$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $_storeManager = $_objectManager->get('Magento\Store\Model\StoreManager');
        if($_storeManager->getStore()->getWebsiteId() == 1){
            return false;
        }*/

        $result = $proceed($customer ,$type ,$backUrl ,$storeId ,$sendemailStoreId);
        return $result;
    }

}

?>

And getting  error We can't save the customer.

Thanks,


texts: Having an Issue of loader on product page in magento2.4.1?

texts:
can anyone explane me what issue can be
i am using nginx server
purchaged theme bs_eren
& magento 2.4.1
this is only happend on product page.


texts: Move users from one store to another (Do not share) - Magento 2.3

texts:
I had a store and many customers. Now I have 3 website with 1 store and i store view per each website, and I need to move some of my customers to the other stores, but when I edit a customer, the option to change stores is disabled as you can see in the image below. How can I move these users to other stores?

NOTE:

My users can only buy in one store, I must not share users in my three stores.

UPDATE 1:

These are my website and stores:

This is my user configuration:


texts: SSL in Admin doesn't generate urls and assets with https

texts:
The frontend is set to https entirely without problems.
We did the following with no luck for the admin panel:

For both backend and frontend we set the secure and unsecure base urls to https://domain.com (where domain.com is substituted by our real domain ;)

We selected use secure urls in frontend and backend.

We set SSL_OFFLOADED as the Offloader header.

We set the .htaccess rules after RewriteEngine On.

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

With this configuration the frontend loads perfectly in https, the backend in the other hand loads without styles also known as mixed content error. We looked around and came across a hack for this error that is put the following meta tag in the head tag of our admin site:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

With this meta tag the site loads but now all the ajax calls are unresponsive, they can't work because all urls although converted to https with the .htaccess rule and the magento rules are rendered as http.

The rest of the backend functions but not the ajax calls. For example if I choose to open catalog/categories the page doesn't load and redirects to the admin homepage which in my case is orders. If i try to make any changes to any grids that uses ajax in somehow, they dont work also.

What should we do??

Any help is appreciated.

Thanks in advance


texts: Magento 2 Custom query to display selected product in Custom block

texts:
I have some product ids . Currently I can display products in category using {{block . But now I am developing a custom block in

app/design/frontend/Alothemes/bencher6/Magento_Theme/templates/myphp/myphpcode.phtml

then in myphpcode.phtml i write the following query

$productId = 672;
   $_product = Mage::getModel('catalog/product')->load(672);

But I got Uncaught Error: Class 'Mage' not found magento .

So how can I list selected product block on a page .

When i try the following code

$product=$this->getLoadProduct(672);
echo $product->getName();

Uncaught Error: Call to a member function getName() on null

I am calling this in cms page using following code

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::myphp/myphpcode.phtml"}}


texts: How to call static block in left sidebar in a page in Magento 2

texts:
How can we call a static block in Magento 2 in a page. In Magento 1 we have this with the following code:

<reference name="left">
<block type="cms/block" name="Klantenservice menu" before="-">
    <action method="setBlockId"><block_id>cmsmenu</block_id></action>
</block>
</reference>


texts: GridJsObject is not defined when add grid seriallize inside Grid UI

texts:
I have face with this error while creat grid seriallize render data inside Grid parent. It build in by Grid UI Component. I dont use old way like magento 1. When click on edit tab to trigger ajax render grid. Console rise undefined JSObject. How to fix it and define missing object? Why it could happen

grid render by component grid follow path below but i don't understand it fully

  lib\web\mage\adminhtml\grid.js


texts: Magento 2.4 Can't login to admin. No error notification

texts:
I have installed magento 2.4 on windows 10 and wampserver.
It is installed now. I can't login to backend. I does not through any error notification either.

While front end login and create customer is also not working. It show invalid form key always.


texts: how to override translate from a vendor language package

texts:
hello everyone in my case i want to translate some sentences in magento 2.3 wich is already tanslated by a language package or in a module inside the vendor folder , for example i have already a translation for some text but I don't know how to override it , see some examples file location bellow :
web/vendor/imaginaerum/magento2-language-fr-fr/dictionary.csv
web/vendor/mageplaza/magento-2-japanese-language-pack/ja_JP.csv
web/vendor/splendidinternet/mage2-locale-de-de/de_DE.csv
web/vendor/magento/module-quote/i18n/en_US.csv
web/vendor/mageplaza/magento-2-chinese-language-pack/github_contributions.csv

my question is how to override those translations in my custom module


texts: Magento 2 API: Extension Attribute with null value not showing

texts:
I'm retrieving from the Magento API an order by its increment_id attribute like this:
http://mystore.com/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=increment_id&searchCriteria[filter_groups][0][filters][0][value]=1200040527&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

I have added a plugin to add a custom attribute to the Order items like this (etc/di.xml):
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Sales\Api\OrderRepositoryInterface">
        <plugin name="order_custom_extension_attribute"
                type="MyVendor\Sales\Plugin\OrderRepositoryPlugin"/>
    </type>
</config>

And then adding the custom attribute  (is_gift_card) to the OrderItem like this (etc/extension_attributes.xml)
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Sales\Api\Data\OrderItemInterface">
        <attribute code="is_gift_card" type="boolean"/>
    </extension_attributes>
</config>

Finally my plugin to add the extension attribute to the order items in the afterGet and afterGetList:
    public function __construct(
         \Magento\Sales\Api\Data\OrderExtensionFactory $extensionFactory
    ) {
        $this->extensionFactory = $extensionFactory;
    }

    public function afterGet(\Magento\Sales\Api\OrderRepositoryInterface $subject, \Magento\Sales\Api\Data\OrderInterface $order)
    {
        return $this->addExtensionAttributes($order);
    }

    public function afterGetList(\Magento\Sales\Api\OrderRepositoryInterface $subject, \Magento\Sales\Api\Data\OrderSearchResultInterface $searchResult)
    {
        $orders = $searchResult->getItems();

        foreach ($orders as &$order) {
           $order = $this->addExtensionAttributes($order);
        }

        return $searchResult;
    }

    private function addExtensionAttributes($order){

        $items = $order->getAllItems();
        foreach ($items as $item){
            $giftCard = $item->getData('is_gift_card');

            $extensionAttributes = $item->getExtensionAttributes();
            $extensionAttributes = $extensionAttributes ? $extensionAttributes : $this->extensionFactory->create();
            $extensionAttributes->setIsGiftCard($giftCard);
            $item->setExtensionAttributes($extensionAttributes);
        }

        return $order;
    }
}

The thing is that is_gift_card is added to the extension_attribute segment IF that attribute has any value, but it is not showing at all if it has a null value.
Is this a normal behaviour from the Magento API?
Thanks in advanced


texts:
I have defined a custom attribute for my products, and now would like to get a list of all values I have entered for this attribute, not for a specific product, but in general.

It is a text field, it doesn't have any predefined options. Thus, getAllOptions() on the attribute object does not work.

How do I get a list of all entered values for the attribute?

Edit:

I got it to work now. You have to use the \Magento\Catalog\Model\ResourceModel\Product\Collection, then you can alter the collection like this:

    $productCollection = $this->productCollectionFactory->create()->addAttributeToSelect('attributeName')->groupByAttribute('attributeName')->load();
    return $productCollection->getColumnValues('attributeName');

This returns an array of all values saved for this attribute.


texts: Magento 2: How to add websites dropdown in admin form?

texts: Magento 2: Code to add "website" dropdown in admin form


texts:
Currently, no space is allowed in the county input field.

Where can I change this, so that I can include a space for county?