texts:
I am creating an extension which will add a product to cart based on an url parameter (https://unavio.de/shop/ExAddtoCart?sku=2889). Code is running correct as long as I am not injecting any dependency other than:

\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory

So here is my (working) Index.php:

<?php
namespace Unavio\ExternalAddToCart\Controller\Index;
use \Magento\Framework\App\Action\Action;

    class Index extends \Magento\Framework\App\Action\Action {
    protected $resultPageFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute() {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/AddToCart.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info("######### Start AddToCart call #########");
        $logger->info("Checking for URL-parameter");
        if (count($_GET) && isset($_GET['sku'])) {
            $sku = $_GET['sku'];
            $logger->info($sku);
            $params = array();
            $params['qty'] = '1';//product quantity

            ### Code should continue here :-)
        }else {
            $logger->info("No or invalidURL-parameter");
            return $this->resultRedirectFactory->create()->setPath('catalog/');
        }
      }
    }

I am trying to follow this thread:

https://stackoverflow.com/questions/38968822/add-product-to-cart-programatically-magento2

But as soon as I inject

\Magento\Catalog\Model\Product $product,
\Magento\Checkout\Model\Cart $cart

like this:

<?php
namespace Unavio\ExternalAddToCart\Controller\Index;
use \Magento\Framework\App\Action\Action;
use \Magento\Catalog\Model\Product;
use \Magento\Checkout\Model\Cart;

class Index extends \Magento\Framework\App\Action\Action {
protected $cart;
protected $product;
protected $resultPageFactory;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory,
    \Magento\Catalog\Model\Product $product,
    \Magento\Checkout\Model\Cart $cart
) {
    $this->resultPageFactory = $resultPageFactory;
    $this->cart = $cart;
    $this->product = $product;
    parent::__construct($context);
}

public function execute() {
    $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/AddToCart.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);
    $logger->info("######### Start AddToCart call #########");
    $logger->info("Checking for URL-parameter");
    if (count($_GET) && isset($_GET['sku'])) {
        $sku = $_GET['sku'];
        $logger->info($sku);
        $params = array();
        $params['qty'] = '1';//product quantity
        $_product = $this->product->load($pId);
            if ($_product) {
                $this->cart->addProduct($_product, $params);
                $this->cart->save();
             }
        ### Code should continue here :-)
    }else {
        $logger->info("No or invalidURL-parameter");
        return $this->resultRedirectFactory->create()->setPath('catalog/');
    }
  }
}

I am just getting a white page and no logging.
Any ideas what´s wrong with this?

Thank you :)


texts: What happens when Elasticsearch is restarted with Magento 2.3.x

texts:
May seem like a simple question, but what are all of the impacts when ElasticSearch is restarted in a running Magento 2.3.x store?

Do indexes need to be reindexed?

Any other items that have to be run/redone?


texts:
We have a client who is now providing prices to 4 decimal places. These are stored against the product and indexed correctly. When the product is added to the cart, the price in sales_flat_quote_item is rounded to 2 decimal places (but stored as 4).

This is done in the roundPrice function

# app/code/core/Mage/Core/Model/Store.php

public function roundPrice($price)
{
    return round($price, 2);
}

Is anybody aware of any consequences of changing this to 4 decimal places? Is it known to cause issues elsewhere?


texts:
I am using the following contact form

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

When someone completes the form and sends it where will the contact message be sent to?


texts:
I have created a module with admin grid i want to show data on frontend with breadcrumb. but i am getting error ..

  Fatal error: Call to a member function addCrumb() on boolean in D:\xampp5.6\htdocs\Magento2.1.0\app\code\Tenx\Faq\Controller\Index\Index.php on line 26

Tenx\Faq\Controller\Index\Index.php

<?php
namespace Tenx\Faq\Controller\Index;
use Tenx\Faq\Controller\Faq;

class Index extends Faq
{
    public function execute()
    {
            echo "Sarvesh";

        $resPage = $this->_pageFactory->create();
        // Add title which is got by the configuration via backend
        $resPage->getConfig()->getTitle()->set(
            $this->_dataHelper->getHeadTitle()
        );
        // Add breadcrumb
        /** @var \Magento\Theme\Block\Html\Breadcrumbs */
        $breadcrumbs = $resPage->getLayout()->getBlock('breadcrumbs');
        $breadcrumbs->addCrumb('home',
            [
                'label' => __('Home'),
                'title' => __('Home'),
                'link' => $this->_url->getUrl('')
            ]
        );
        $breadcrumbs->addCrumb('faq',
            [
                'label' => __('Faq'),
                'title' => __('Faq')
            ]
        );
        return $resPage;
    }
}


texts: Install Magento 2 and add to Git and deploy and install on Staging server

texts:
For my client I have to install Magento 2 on a Staging server from a Git remote repo (on Beanstalk). So all the Magento code has to be deployable.

I see all kind of different approaches (comparing to Magento 1)? Where do I have to start and what workflow/strategy do I have to choose to make my code versionable in Git and deploy this code to the staging server?

I am working on a Mac. I also discovered some problems with Mamp and the MySQL version. Because Magento 2 requires MySQL 5.6.

I just want a good workflow so I can version my code and deploy it to the staging server.


texts: Set custom shipping method for selected product only

texts:
I want to create a new custom shipping method which will be my own delivery method. I would like to show this shipping method for some of the selected products only.
Is this possible to do? Currently, I am using this extension: shipping cost per product tp work on it. But I didn't get the result that I am looking for.


texts: Magento 2 how to create a Plugin for before Admin Product Grid loads?

texts:
I want to set a beforeProductGrid or something that exists, so I can enable or disable the Add Product Button.
The only thing I have found so far is this Model
Magento\Catalog\Block\Adminhtml\Product\Grid

It has a lot of methods and I don't know what method to choose and what parameters to receive in my plugin, something like
beforeProductGrid($subject){
}

Greetings!


texts: Magento Admin Extensions: Stand Alone PHP Script

texts:
I'm creating a custom Magento extension that includes a custom management area in Magento admin (a new tab under product management). As part of this new management area I would like to allow users to 'preview' a block of content based on data entered. Ideally this would be an  in the management window that can reload a php script, sending the management attributes to that script so it can react accordingly.

My question is: What is the 'correct' way to setup and call on a custom PHP script from within Magento to fill this pop up?

It should have it's own URL within the Magento framework (I can pass attributes via the query string). The window.location for the  would be updated to this URL (with query string) as triggered by the user to 'refresh' the content. What is the best way to incorporate the custom PHP script that produces the window content into Magento Admin so that I can call on it?


texts:
I am trying to connect to my Magento API but keep getting an invalid signature response after authorizing. My long term goal is to have an external app that will be modifying select product details.

I have created the following on Magento ($remoteHost).

REST Role:

Role Name: Product Updater
User Type: Admin

OAuth Consumers:

Consumer Name: Product Updater Consumer
Callback URL: not provided
Rejected Callback URL: not provided

Admin user is assigned to the REST Role.

<?php
/**
 * Example of update product record via Magento REST API. OAuth authorization is used
 */
error_reporting(E_ALL);
ini_set("display_errors",1);
/**
 * Example of retrieving the products list using Admin account via Magento REST API. OAuth authorization is used
 * Preconditions:
 * 1. Install php oauth extension
 * 2. If you were authorized as a Customer before this step, clear browser cookies for 'yourhost'
 * 3. Create at least one product in Magento
 * 4. Configure resource permissions for Admin REST user for retrieving all product data for Admin
 * 5. Create a Consumer
 */
// $callbackUrl is a path to your file with OAuth authentication example for the Admin user

$remoteHost = "https://magentostore.com";
$localHost = "https://givememagentodata.com";
$callbackUrl = "$localHost/dev/testApi.php";
$temporaryCredentialsRequestUrl = "$remoteHost/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
//My magento does not use /admin/ as the admin path it uses backend2015
$adminAuthorizationUrl = "$remoteHost/backend2015/oauth_authorize";
$accessTokenRequestUrl = "$remoteHost/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$apiUrl = "$remoteHost/api.php/rest";
$consumerKey = '646d1690082f151323c4...';
$consumerSecret = '05c09cee74c0f49c39...';

session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
    $_SESSION['state'] = 0;
}
try {
    $authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
    $oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);
    $oauthClient->enableDebug();

    if (!isset($_GET['oauth_token']) && !$_SESSION['state']) {
        $requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
        $_SESSION['secret'] = $requestToken['oauth_token_secret'];
        $_SESSION['state'] = 1;

        header('Location: ' . $adminAuthorizationUrl . '?oauth_token=' . $requestToken['oauth_token']);
        exit;
    } else if ($_SESSION['state'] == 1) {
        //die($_GET['oauth_token']."-----".$_SESSION['secret']);

        $oauthClient->setToken($_GET['oauth_token'], $_SESSION['secret']);
        $accessToken = $oauthClient->getAccessToken($accessTokenRequestUrl);
        $_SESSION['state'] = 2;
        $_SESSION['token'] = $accessToken['oauth_token'];
        $_SESSION['secret'] = $accessToken['oauth_token_secret'];
        header('Location: ' . $callbackUrl);
        exit;
    } else {
        $oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);
        $resourceUrl = "$apiUrl/products";
        $oauthClient->fetch($resourceUrl, array(), 'GET', array('Content-Type' => 'application/json'));
        $productsList = json_decode($oauthClient->getLastResponse());
        print_r($productsList);
    }
} catch (OAuthException $e) {
    var_dump($e);
    print_r($e->getMessage());
    echo "<br/>";
    print_r($e->lastResponse);
}


texts: Adding one associated product to multiple configurable products at once

texts:
here is an explanation of what we have:

multiple simple products for each t-shirt, we use an attribute set with color, size and sex.

The end product is a designed t-shirt, it has a pattern image and must take the t-shirts from the inventory (that's why we use a configurable product)

So, we have around 100 different simple products - but even more configurable products (each pattern gets it's own so the number is huge).

But what when we create a new simple product - let's say a blue t-shirt L sized which we didn't have prior to creating the configurable products. Is there a way to add the associated product to multiple configurable products at once - and not have to go into all products to add it?


texts: Magento2 get all the currencies for default store

texts: I have more than 5 currencies for my default store, I want to fetch all those currencies codes and symbols programmatically.


texts: Magento performance went dow by 50% after upgrading from 2.1 to 2.2

texts:
I've upgraded Magento 2.1.11 to Magento 2.2.6 and after the upgrade the CPU utilization and CPU load duplicated. Is was a simple and straight forward upgrade.

No server changes were made regarding software or hardware. No PHP upgrade, MySQL, disk, memory, nothing.

No changes were made to any Magento setting.

I have no idea what could have happened. The number of visitors stayed the same, visit hours, etc. No changes there.

All caches are enabled, redis is working as expected... What could I possibly be missing?


texts:
Inside System > Scheduler > Job Configuration: then you click on a specific cronjob.

What does the button reset overlay do inside that panel?

Magento ver. 1.14.1.0


texts:
I have a website in Magento 2.3.2. This morning the website was in production mode.
I added a custom module (I don't think is related to this problem)
run bin/magento setup:upgrade, bin/magento c:f, bin/magento c:c

Then I deleted generated/code/* and generated/metadata/*
and run bin/magento deploy:mode:set production

When the compilation is in progress I receive an error in step 5/7
In ClassReader.php line 35:
Class Magento\Sales\Model\Order\Email\Sender\OrderSender does not exist
First, I thought the problem could be the new module, so I deleted...
But the problem still remain. I cannot set the production mode.


texts: Magento 2 Default JS doesn't load proper

texts:
Magento 2 is broken in admin panel and add to cart does not work.

I have checked both pub/static/frontend/Magento/Theme/en_US/mage/dropdown.js

and

pub/static/adminhtml/Magento/backend/en_US/Magento_Ui/js/lib/knockout/bindings/i18n.js doesn't load proper.


texts: I want to load ajax loader image after clicking save button

texts:
I am using magento 1.9 version. After clicking save or any button then I want to show progress by ajax loader. I found a div having ID "loading-mask". If i will change its style display:none to block then it all working fine. But I want to change this after validation pass. Where should I can place this condition for proper result ?

document.getElementById("loading-mask").style.display="Block";


texts: How to use third party jquery libraries in magento along with requirejs?

texts:
I am bit new to requirejs and currently learning AMD pattern in requirejs.I want to use custom third-party jquery libraries in magento.

I have two questions:

How to use jquery scripts that are dependent on newer version of jquery as Magento comes preinstalled only with jquery v-1.12.4.Whenever I want to use libraries that depends on version 3.3.1 I can't use them.
How to define those third party libraries as AMD module so that I can use them in any template file?

After doing some googling, I came to know that to define any component as dependent on jquery I have to use shim config of requirejs.For example here is my code

var config = {
            'map': {
                '*': {
                    'somecomponent': 'js/somecomponent'
                }
            },
            'shim': {
                'somecomponent': {
                    deps: ['jquery']
                }
            }
 }

I have done all these things and still I can't use the function from somecomponent.Is it that to use code from somecomponent.js , I have to use define inside somecomponent.js and return/export some object so as to use in template files?

Is it that I have to do modifications inside somecomponent.js jquery library? If yes then what?

Script inside template looks like below.

<script type="text/javascript">
    require(['jquery','somecomponent'],function($, somecomponent) {
        somecomponent.init({
            //options object
        })
    })
</script>

And browser is giving an error-
Uncaught TypeError: Cannot read property 'init' of undefined

Note:- Somecomponent is already using $ inside it.


texts: OnePage Checkout - Hide Payment method depending on Shipping Method

texts:
I'm using CE 1.9.0.1 and have correctly created and registered my module, but I can't seem to detect the shipping methods. Basically, I want to hide Cash on Delivery if Flat Rate or Free Shipping is chosen. Here is the code I have for my observer class:

class Kol_PaymentToggle_Model_Observer
{
    public function paymentMethodIsActive(Varien_Event_Observer $observer) {
        $event  = $observer->getEvent();
        $method = $event->getMethodInstance();
        $result = $event->getResult();
        $quote = $observer->getEvent()->getQuote();
        $shippingMethod = $quote->getShippingAddress()->getShippingMethod();
        if($shippingMethod == "standardshipping" || $shippingMethod == "free") {
            if($method->getCode() == 'cashondelivery' ) {
                $result->isAvailable = false;
            }
        }
    }
}

I'm guessing that I haven't used the correct shipping method code names or payment method code names, but I'm unsure. Anyone has any advice?

EDIT:
I only have 3 shipping methods enabled:

Collect In Store Title = Collect in Store Method Name = Collect In Store (Extension link)
Flat Rate Title = Standard Delivery Method Name = Standard Shipping
Free Shipping Title = Free Delivery Method Name = Free

Hopefully this extra information can prove useful towards helping me!


texts:
Magento2.3 Everything looks going over https but we still have a frame with origin error.

Uncaught DOMException: Blocked a frame with origin "https://domain.com" from accessing a cross-origin frame.

    at contents (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/jquery.js:3123:47)
    at Function.map (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/jquery.js:484:14)
    at jQuery.fn.init.jQuery.fn.(anonymous function) [as contents] (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/jquery.js:3128:21)
    at lookup (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/Magento_PageCache/js/page-cache.js:27:24)
    at HTMLIFrameElement.<anonymous> (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/Magento_PageCache/js/page-cache.js:30:25)
    at Function.each (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/jquery.js:370:20)
    at jQuery.fn.init.each (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/jquery.js:137:18)
    at lookup (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/Magento_PageCache/js/page-cache.js:27:35)
    at HTMLDivElement.<anonymous> (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/Magento_PageCache/js/page-cache.js:30:25)
    at Function.each (https://domain.com/static/version1551124171/frontend/Sm/mytheme/nl_NL/jquery.js:370:20)

        **

  with this line tagged in jquery.js

**

  contents: function( elem ) {
                return jQuery.nodeName( elem, "iframe" ) ?
                elem.contentDocument || elem.contentWindow.document :
                    jQuery.merge( [], elem.childNodes );
            }

There is no such error on our clone web-store without https.
Ideas how to solve this error?


texts: Transaction Failed Issue:- Able to redirect to success page automatically(Hacked My Site)

texts:
Yesterday someone made attacked my site, he was able to produce order id without out any Transaction.

I have founded why this happened, but don't know how to resolve this critical issue.

Here are the steps-

Login to Your account.
Buy the item, it will redirect to the payment page.
select any bank with net banking option.
confirm the amount, it will ask for OTP, but don't put any OTP
You all need to found SUCCESS method of site,

once you will get that simply put URL into the browser it will redirect to success page in my case www.mysite.com/checkout/onepage/success/

At admin panel, I am getting Payment Completed message, but I have received Transaction fail mail from my merchant.

Also, I have installed all security patches given by Magento. and my Magento version is- 1.7.0.2.


texts: How to override adminhtml template file in magento 2.3.2

texts:
I want to override account.phtml file located at /vendor/magento/module-sales/view/adminhtml/templates/order/create/form
How can i do that?


texts: How does catalog_category_product ( Category Products ) reindexer works according to mysql in Magento 2

texts:
I want to know about catalog_category_product ( Category Products ) indexer in Magento 2 like how it will work according to mysql.
Like in which table's it will enter the data then further which table is used to show the data after reindexing ?
Any help is appreciated.


texts:
I have some problem since several month, with Google Chrome Browser, when someone want to make a checkout, paypal return us an error 500.  The error given are "POST [lang]/paypal/transparent/response/ HTTP/1.1" 500.
After some tests, i don't get this error with Firefox, Opera or Microsoft Egde, i've found some hint on google, but nothing work. My current Magento version are 2.2.8. I know it's a bit old.
Someone get this problem and found a way to resolve it?


texts: Uncaught exception 'Exception' with message 'User Error some transactions...'

texts:
I'm getting this error when i try to save to my db an employee.

> Fatal error: Uncaught exception 'Exception' with message 'User Error:
> Some trans actions have not been committed or rolled back in
> C:\wamp64\www\magento1\vendor\
> magento\framework\DB\Adapter\Pdo\Mysql.php on line 3774' in
> C:\wamp64\www\magent
> o1\vendor\magento\framework\App\ErrorHandler.php:61 Stack trace:
> #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(256, 'Some t
> ransactio...', 'C:\\wamp64\\www\\m...', 3774, Array)
> #1 C:\wamp64\www\magento1\vendor\magento\framework\DB\Adapter\Pdo\Mysql.php(3774
> ): trigger_error('Some transactio...', 256)
> #2 [internal function]: Magento\Framework\DB\Adapter\Pdo\Mysql->__destruct()
> #3 {main}   thrown in C:\wamp64\www\magento1\vendor\magento\framework\App\ErrorHandler.php
> on line 61

Here is the code

public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
        $setup->startSetup();

        $salesDepartment = $this->departmentFactory->create();
        $salesDepartment->setName('Sales');
        $salesDepartment->save();

        $employee = $this->employeeFactory->create();
        $employee->setDepartmentId($salesDepartment->getId())
            ->setEmail('john@sales.loc')
            ->setFirstName('John')
            ->setLastName('Doe')
            ->setServiceYears(3)
            ->setDob('1983-03-28')
            ->setSalary(3800.00)
            ->setVatNumber('GB123456789')
            ->setNote('Example note!')
            ->save();

        $setup->endSetup();
    }
}

The sales department has been saved to database though.


texts: Magento2:custom module add new form action after not save data

texts: I have create new custom module click add new form after data fill up than save not working but if in existing  record edit after save working please let me know hows problem?


texts: I would like to post a good review for this plugin, but its not allowing me?

texts:
https://marketplace.magento.com/ebizmarts-magento2-magemonkey.html

Anyone here can help me on how to post a good review for this team.
I cannot post a review.


texts:
I created module that include this view:

<form class="add-to-cart-form" action="<?php echo $this->getUrl('testTask/index/AddToCart')?>">
    <input title="sku" class="sku-area" name="sku" type="text">
    <input type="button" class="add-to-cart-button" value="Add to cart">
</form>

My layout:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">
    <head>
        <css src="css/custom.css"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="task" template="Amt_TestTask::firstTask.phtml" />
        </referenceContainer>
    </body>
</page>

I was creating js file, that include ajax query:

(app/code/Amt/TestTask/view/frontend/web/js/custom.js)

define([
    "jquery"
], function ($) {
    "use strict";

    return function () {
        var form = $('.add-to-cart-form');
        var url = form.attr('action');

        $(document).on('click', '.add-to-cart-button', function () {
            var param = form.serialize();
            alert(param);
            $.ajax({
                showLoader: true,
                url: url,
                data: param,
                type: "POST"
            }).done(function (data) {

            });
        })
    };

});

And I added requirejs-config.js:

var config = {
    map: {
        '*': {
            custom: "Amt_TestTask/js/custom"
        }
    }
};

Develop mode is enable. This file was adding in static directory.

pub/static/frontend/Magento/blank/en_US/Amt_TestTask/js

I know, that i can create link to this js file in layout.
Like that: <script src="Webkul_Grid::js/grid.js"/>
but I think, that it must work without it.


texts: How to fix Error: unexpected '' (T_STRING), expecting ')' error?

texts:
How can I fix this error in my code:

  Parse error: syntax error, unexpected '' (T_STRING), expecting ')'
  error

Code:

public function productDataToJson(Varien_Event_Observer $observer)
{
  $array = array();
  $category = Mage::registry('current_category');
  # $category = Mage::getModel('catalog/category')->load(41);
  $products = $category->getProductCollection()
      ->addAttributeToSelect('*');

  foreach ($products as $product) {
      $array[] = $product->getData();
  }

  $jsonData = Mage::helper('core')->jsonEncode($array);
  # save json file for each category
  file_put_contents('c_' . $category->getId() . '_node.json', $jsonData);
}


texts: Home page error - How to solve Element 'block', attribute 'destination': The attribute 'destination' is not allowed

texts:
My homepage getting the following error,
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 953

Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 988

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 953

Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 988

<pre>#1 Magento\Framework\Config\Dom->__construct('<layout xmlns:xs...', &Magento\Framework\App\Arguments\ValidationState#0000000058d80d55000000006a5c4095#, array(), NULL, 'C:/xampp/htdocs/...', '%message%\nLine: ...') called at [vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php:121]
#2 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Framewor...', array('<layout xmlns:xs...', &Magento\Framework\App\Arguments\ValidationState#0000000058d80d55000000006a5c4095#, array(), NULL, 'C:/xampp/htdocs/...', '%message%\nLine: ...')) called at [vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php:66]

How to solve this error?
Log error:
[2021-03-01 04:07:53] report.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_5161502e12d09aab87e298d5a11fd6c6e_page_layout_merged and handles default, cms_index_index, cms_page_view, cms_index_index_id_home, am_mega_menu_layout: Please correct the XML data and try again. Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 953

Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 988
 [] []
[2021-03-01 04:07:53] report.ERROR: Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 953

Element 'block', attribute 'destination': The attribute 'destination' is not allowed.
Line: 988
 [] []


texts: What parameters do we need to use for our shopping cart to pull revenue and order ID into Adwords and Kenshoo?

texts: We want to track revenue and order ID for Kenshoo and AdWords pixels that are currently placed on our Checkout Success page.  What parameters to we need in order to pull this data into these two platforms?


texts: How to run n98-magerun with Magento on Wampserver?

texts: I am being asked to wipe the contents (cache) of linux specific locations within Magento on Wampserver/Windows using n98-magerun. How specifically do I run n98-magerun in this situation? Please be specific. Thank You.


texts: Is the Component Manager in Magento 2 A Real Thing, or a Tech Demo?

texts:
The Magento 2 dev docs make reference to a Component Manager -- but it's pretty confusing what the component manager is supposed to be.  Is this a tech demo, or is this something that end-users are actually supposed to use?  If the later, how?

The installation instructions are a little bizarre -- they recommend you clone a GitHub repository and then copy part of that repository into your Magento installation.  This GitHub repository is also bizarre in that is has a root level composer.json that includes the meta package (good), but then in the update folder where the application lives there's a second composer.json, and a committed vendor source tree (weird).

As an "outside the company" Magento 2 developer, I'm not sure what I'm supposed to do with this.  Is this a tech demo?  Something that ships with some version of Magento 2 (EE? The downloadable package? Something else?) and provided so developers can have a version to test against?

Is there documentation on how to use the component manager?

What the component manager actually doing behind the scenes?

Is this something that's marketplace related?

Specifics are great, but even a general overview from someone who's been paying more attention to this would be appreciated.


texts: Magento 2 - Product names with number/digits & special characters are not searchable

texts: I have product names like ' 8" X 6" cards ' they contain measurements i.e. numbers and characters. when I try to search these products on the frontend. the Ajax search returns the product fine and product with that name is displayed in the dropdown but when I try to search it with MYSQL search gives "Your search returned no results.". Is there a way to make products with these type of names searchable ?


texts: Magento 2 Shortcut/GUI tool to perform commandline tasks for windows

texts: I know, that the command line tool for magento 2 is very useful, but when in development,we need to perform some common tasks like clear the cache, deploy static content, upgrade db, enable extension to name a few, but for that we need to run command manually, is there any possibility to create  a GUI tool for the same?


texts: remove social networking icons from some pages

texts:
visit this link : http://4.videomergerapp.com/marketplace/

we are using an extension to display social networking links on right side of the page.

on right side, you can see "social networking links" : fb, google + ...etc.

I want to remove those links from some .phtml pages


texts: Magento2 - Change placeholder size at product edit

texts:
We have magento 2.1.9ce.

And we need to add a lot of new products in the next few weeks>
That's why I would like to easy up some little things.

There are 2 attributes when making the product where I would lik eto change the placeholder size.

Current situation:

When I inspect the code I can change the place holder size to:

<select multiple="" class="admin__control-multiselect" data-bind="
    attr: {
        name: inputName,
        id: uid,
        size: size ? size : '6',
        disabled: disabled,
        'aria-describedby': noticeId,
        placeholder: placeholder
    },
    hasFocus: focused,
    optgroup: options,
    selectedOptions: value,
    optionsValue: 'value',
    optionsText: 'label'" name="product[kleur]" id="HL7HO0G" size="17" aria-describedby="notice-HL7HO0G" placeholder="">

and:

<select multiple="" class="admin__control-multiselect" data-bind="
    attr: {
        name: inputName,
        id: uid,
        size: size ? size : '6',
        disabled: disabled,
        'aria-describedby': noticeId,
        placeholder: placeholder
    },
    hasFocus: focused,
    optgroup: options,
    selectedOptions: value,
    optionsValue: 'value',
    optionsText: 'label'" name="product[soort]" id="A4PDRTU" size="12" aria-describedby="notice-A4PDRTU" placeholder="">

That gives this wanted result:

Now I can select much faster all the right options.

How can I do this?


texts: Magento 2.2.5 JS and font not loading 404 error

texts:
In my Magento 2.2.5 store there is JS and fonts 4040 error.
I am using centos with lamp and webserver user and group name is daemon
I have run below commands but still issue exist.
alias mage="/opt/lampp/bin/php -d memory_limit=-1 bin/magento"

sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
sudo chown -R :daemon .
sudo chmod u+x bin/magento

mage s:s:d
mage c:c
mage c:f


texts:
So, I create + 2 websites with store and store views. I need to set all my products to all this web sites. Possible ways:

Manually per product(but I have more than 200 000 products)
In Manage products -> select all and update attributes (but I it will take a lot of time)
Make a query to DB

Is any one resolve this problem with query? what tables should I take?


texts: Magento 2: How can I use ifconfig or something similar to layout component

texts:
I created a boolean option (Yes / No) in Store -> Configuration, with which I can display or not the checkout sidebar.

The configuration path is: vendorname_sidebar/display/enabled.

Below is a part about sidebar from the layout XML from checkout_index_index.xml of the Checkout module.

How do I show or not show the sidebar in checkout depending on this setting in Store -> Configuration?

<item name="sidebar" xsi:type="array">
    <item name="sortOrder" xsi:type="string">50</item>
    <item name="component" xsi:type="string">Magento_Checkout/js/view/sidebar</item>
    <item name="displayArea" xsi:type="string">sidebar</item>
    ...
</item>


texts: Magento2: An error has happened during application run

texts:
I created in backend multi language on different website.

example:

mainwebsite.pl
additionalwebsite.com

on .pl everything work but when I enter .com then:

An error has happened during application run. See exception log for details. Could not write error message to log. Please use developer mode to see the message.


texts:
I need to ship overseas and use USPS(whose shipping API I am yet to test) and some other carriers that don't have APIs for quoting shipping rates.

There used to be a module that allowed setting a custom shipping rate from the Admin interface.  However, this module isn't available for version 1.7.x.x.

Is there a replacement for this module or some other module that will allow me to do this?


texts: Magento 1.7.0.2 Catalog -> google site-map giving 404 page

texts:
My store in magento ver 1.7.0.2 and when i clicked on catalog -> google site page it just gives me 404 page .

I can't find what happen. i find that change file permission but which folder not specified any one can help me .


texts: Magento 2.3 How to validate all checkout fields at once

texts: Is it possible to validate all fields in the checkout at once? Currently, if you dont fill in anything, only the email field will be validated. All the other fields are only validated if the email field is filled. I want to have all fields validated at the same time, so the customer doesn't have to click the "Place Order" button 3 times before all validations have passed. See screenshot for visual explanation.


texts: Magento cart is always empty on chrome and opera

texts:
After i add some products to card and i open cart page it shows "the cart is empty". it just happens in chrome and opera; but every thing is ok in firefox.
i have checked cookie management and every thing was fine there. what is the problem?
*my magento is running on local server.


texts: Magento 2 custom module select query doesn't work

texts:
I have the following query:

SELECT `main_table`.*, `secondTable`.* FROM `table_one` AS `main_table`
LEFT JOIN `table_two` AS `secondTable`
ON main_table.blog_id = secondTable.blog_id
WHERE (store_id = '3') OR (store_id = '0');

Now take this query and run in CLI it Works perfect it gives all the data you need but in magento it doens't. I Think there is something preventing it but not sure. So blog_id are in both tables could be why it isn't returning so if it is how could I add alias for the columns blog_id for both tables?

UPDATE:

index.php:

public function getBlogs(sort)
    {
        if (is_null($this->blogs)) {
            $this->blogs = $this->blogCollectionFactory->create()
                ->setOrder(empty($sort)?'position':$sort, 'ASC');
             $this->blogs->getSelect()->reset(\Zend_Db_Select::WHERE)->where('secondTable.store_id = ?', $this->_storeManager->getStore()->getId())->orwhere('secondTable.store_id = ?', 0);
             echo $this->blogs->getSelect();
        }
        return $this->blogs;
    }

So if I don't add the last statement ->orwhere('secondTable.store_id = ?', 0) then it works but I need to return everything including those that belongs to store_id=0 hence why added but in magento doesn't like it;

index.phtml:

print_r(get_class_methods($block->getBlogs('position')));
print_r($block->getBlogs('position')->getSelect());
die;


texts:
I downloaded megento with composer and installed it,ther app/code directory for creating module, So i just created this directory and my module directory like this :

And etc\modules as the same,i created it. But the module its not in Magento module list.
The app/code/community/Shareino/SyncModule/etc/config file like this :

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Shareino_SyncModule>
            <version>0.0.1</version>
        </Shareino_SyncModule>
    </modules>
</config>

The app/etc/modules/Shareino_SyncModule like this

<?xml version="1.0"?>
<config>
    <modules>
        <Shareino_SyncModule>
            <active>true</active>
            <codePool>community</codePool>
        </Shareino_SyncModule>
    </modules>
</config>

But this module isnot in magento's module list.


texts: Magento 2 Elastic Search enable but not showing search results

texts:
Magento 2 enable elastic and the connection is successful

but when search from the frontend it is not showing results
Even our elastic search status is green and the index key is also generating
Can anyone know how to fix this?


texts: Magento 2 - add prefix before category and products urls

texts:
I want to add prefix in category and product urls of Magneto 2.3.4.
I was able to add prefix in product urls but not working on category urls.
Please guide.


texts: Where can I see a different between cacheable="true" and "false" in layout?

texts:
I know this is seem stupid question but I'm a newbie in Magento 2. So I want to ask you guys that Where can I see a different between cacheable ='false' and cacheable='true'?.

I checked in Local Storage in Chrome but it didn't show me anything different.


texts: scconnector_google_feed_cl error after product save (just upgraded to 2.3.5-p2)

texts:
I just upgraded Magento to 2.3.5-p2, now I'm getting the following error after saving products:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mg2.mg_scconnector_google_feed_cl' doesn't exist, query was: UPDATE `mg_catalog_product_entity_decimal` SET `value` = ? WHERE (entity_id = 204) AND (attribute_id = '77') AND (`store_id` = '0')

Any ideas why this table does not exist and how to fix this issue?


texts: What's the logic of inherited constructor order parameters

texts:
I have this module class

namespace VendorName\Module\Block\Magento\Framework\Pricing;

use Magento\Framework\Pricing\Amount\AmountInterface;
use Magento\Framework\Pricing\Price\PriceInterface;
use Magento\Framework\Pricing\SaleableInterface;
use Magento\Framework\Pricing\Render\Layout;
use Magento\Framework\View\Element\Template;
use VendorName\Module\Helper\Data;

/**
* Class Render
* @package VendorName\ModuleName\Block\Magento\Framework\Pricing
*/
class Render extends \Magento\Framework\Pricing\Render
{

/**
 * @var \Cart2Quote\Not2Order\Helper\Data
 */
private $dataHelper;

public function __construct(Data $dataHelper, Template\Context $context, Layout $priceLayout, array $data)
{
    $this->dataHelper = $dataHelper;
    parent::__construct($context, $priceLayout, $data);
}

}

So i got this error

  Uncaught TypeError: Argument 4 passed to VendorName\Module\Block\Magento\Framework\Pricing\Render::__construct() must be of the type array, null given

The correct constructor is

public function __construct(Template\Context $context, Layout $priceLayout,array $data = [], Data $dataHelper)
{
    $this->dataHelper = $dataHelper;
    parent::__construct($context, $priceLayout, $data);
}

But i don't know why it's correct, which is the logic for the constructor parameters order

This is the main class '\Magento\Framework\Pricing\Render.php' constructor

 public function __construct(
    Template\Context $context,
    Layout $priceLayout,
    array $data = []
) {
    $this->priceLayout = $priceLayout;
    parent::__construct($context, $data);
}


texts: Magento 1.9 How to use old database while installing fresh magento

texts:
I wish to install fresh magento 1.9.2.3 using the same database of magento 1.9.2.2
During installation process when I give the same database name as of magento 1.9.2.2 It shows error as"Database connection error". Is it possible to use the same old database or should I create a new one?


texts:
When i trying to install data migration tool then getting this error in SSH

  PHP Fatal error:  Uncaught TypeError: Argument 1 passed to
  Symfony\Component\Console\Helper\ProgressBar::setFormat() must be of
  the type string, null given, called in
  /var/www/html/xyz/vendor/magento/data-migration-tool/src/Migration/App/ProgressBar/LogLevelProcessor.php
  on line 88 and defined in
  /var/www/html/xyz/vendor/symfony/console/Helper/ProgressBar.php:230


texts: Display Gift Wrap on Product Detail page for EE 1.12

texts:
I've searched through the forum here but haven't found anything related to being able to display the built-in giftwrap module that comes with EE versions of Magento.

Has anyone tried doing this before?

Thanks


texts: Magento returns 404 after switching language on SOME product pages

texts:
I have problem with a Magento site I haven't been able to solve Googling my way around. On I have 3 store views (NL, EN, DE). When on a product page and I want to switch language sometimes I get a 404 error but other times the product switches correctly to the right language. I have observed the URL behavior closely and came up with this:

In case of a successful switch the URL changes from for example www.example.com/supplies_nl/product.html to www.example.com/supplies_en/product.html?___from_store=supplies_en

However in other cases when the switch in unsuccessful the URL is changed from
www.example.com/supplies_nl/product.html to www.example.com/supplies_nl/product.html?___from_store=supplies_en resulting in a 404 error.

Has anyone encountered such behavior and what can be done to have this working correctly al the time?

Using Magento 1.8.0


texts:
I am facing 500 Internal Server Error on /checkout/onepage/saveOrder/form_key/xxxx at the time of clicking place order button at checkout page.
I have tried the solutions link 1 and link 2

When i print mystore/info.php it shows mbstring is enabled.
When enabling  ini_set('display_errors', 1); at index.php it doesn't prints any of the errors.

How to solve this.


texts:
Inside a transactional email whe print a date attribute, using the following code: {{var quote.followup}}

This only displays the date as 2017-12-11 00:00:00

How can I change that into Mondag 11 December 2017?


texts: Abandoned Cart in Magento 1.9.2.4 showing error Access Denied in backend

texts: I installed the extension. But it shows Access Denied in backend


texts:
Which is the best way to use database connection in phtml file in Magento 2

Only for fetching single result from the custom table table
because most of the time I am facing error like "User mysql_user already has more than 'max_user_connections' active connections"
server guy not supporting me they told me to upgrade your server will upgrade the server later.

In ViewModel File

<?php
namespace Satish\Addaction\Catalog;

class SqlConnection{

    /**
     * @var \Magento\Framework\App\ResourceConnection
     */
    protected $resourceConnection;

    public function __construct(
        \Magento\Framework\App\ResourceConnection $resourceConnection
    ) {
        $this->resourceConnection = $resourceConnection;
    }

    /**
     * Get Table name using direct query
     */
    public function getTablename($tableName)
    {
        /* Create Connection */
        $connection  = $this->resourceConnection->getConnection();
        $tableName   = $connection->getTableName($tableName);
        return $tableName;
    }
}

in phtml file

<?php

$viewModel = $block->getViewModel();
$tableName = $viewModel->getTableName('custom_table');
$query = 'SELECT * FROM ' . $tableName;
/**
 * Execute the query and store the results in $results variable
 */
$results = $this->resourceConnection->getConnection()->fetchAll($query);
echo "<pre>";print_r($results);


texts: Migrated Customers not able to complete the purchased

texts:
Before is started in this company they migrated a lot of customers from Magento 1.9 to Magento 2.3.
The issue we are seeing with customers that is from Magento 2 is when they go to checkout they receive this error message ("The shipping information was unable to be saved. Verify the input data and try again.
Where it shows "Payment Method" it is blank and a spinning loading wheel.
But the strange thing is if i click on the "add new address" button and type in the same iformation and hit save everything seams to work again. Error message gone and payment method loads perfectly...
Edit: I found this error in Magento exception log:
[2020-09-14 20:31:06] main.CRITICAL: Invalid customer address id 1667 {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): Invalid customer address id 1667 at /chroot/home/xxxxx/rodin.etailhandel.no/html/vendor/magento/module-quote/Model/QuoteAddressValidator.php:79)"} []
Anyone have any ideas what can cause this?


texts: What is the structure of the $data array in Magento 2?

texts:
I am studying/developing a module for Magento 2.
I created an observer for a specific event and now I'd like to collect some data such as Customer information and Product information. I know I can use the magic metods get*Something* to navigate through the $data array and get specific values but how do I know what values are stored in the array? Is there a resource/documentation that lists at least the default parameters? I know it contains a lot of custom parameters from the different modules.

Thank you!


texts: Some settings not changing anything on the frontend

texts:
I have a newsletter popup that won't stop coming up. I've changed it to disabled, and it doesn't change.
I also can't change the look of my product image gallery. I reached out to the support theme at Porto, and, as usual, they claim that it's not the theme issue.
All of the static content is generating ok, and things seem to be functioning normally, it's just a couple of settings that seem messed up. Any idea why?
I've run setup:upgrade, setup:di:compile, static-content:deploy, indexer:reindex, cache:clean, cache:flush, and cleared the varnish cache

Thanks


texts:
I am stuck since a few days on this.

I want to create a new dictionary for Magento. And I followed the instructions here :
https://wiki.magento.com/display/MAGE2DOC/Using+Translation+Functionality#Dictionary

Command to create the dictionarly

  php -f generator.php -- -d  [-m y] [-o ]
  php -f generator.php -- --directory= [--magento=y] [--output=]

But when I do launch this command, it shows 'no input file specified'

I run it with a php file containing :

  $out = shell_exec("php -f generator.php --directory=temp");

Is it to do that it can't find the generator.php file ?
Or is it something else ?

Help very much appreciated !
Thanks in advance
Kim


texts:
On our Magento 1 store log cleaning is not working, even though we have Enabled Log Cleaning in System > Configuration > Advanced > System.

Also, when I run php -f shell/log.php clean from the terminal it does not work either and gives no error messages.

$ php -f shell/log.php clean
Log cleaned

Our site is hosted on AWS with a seperate webserver & mysql server.  Could it have something to do with this? Although, all other webserver DB interactions are working fine.

I could find no error messages in our system & exception logs.

What else could it be?


texts: Magento2 Assign company name to customer while placing an order

texts:
I would like to assign a company name to the customer when place an order. Here I have tried using the below logic and able to assign it to the customer. But I am unable to view that particular orders in the customer dashboard and it's showing company/accessdenied in the URL.
If I comment on this code that respected order I am able to view.
Note:

This logic in the helper file and I am calling this method from another file bypassing the customer id as parameter. Can anyone face this kind of issue? Please advise.
I have logged into the company profile dashboard and provided roles and permissions but no luck.

Magento verision is : 2.3 (B2B)
<?php
namespace Demo\Test\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Psr\Log\LoggerInterface;
use Magento\Framework\App\ResourceConnection;
use Magento\Company\Model\ResourceModel\Customer;
use Magento\Company\Api\Data\CompanyCustomerInterface;

class Data extends AbstractHelper
{
/**
 * @var CompanyManagementInterface
 */
private $companyRepository;

 /**
 * @var Context
 */
public $context;

/**
 * @var ResourceConnection
 */
protected $resource;

/**
 * @var CompanyCustomerInterface
 */
protected $companyCustomerInterface;

/**
 * @var Customer
 */
protected $customer;

public function __construct(
    Context $context,
    LoggerInterface $logger,
    ResourceConnection $resource,
    CompanyCustomerInterface $companyCustomerInterface,
    Customer $companyCustomerResourceModel
) {
    $this->logger = $logger;
    $this->resource = $resource;
    $this->companyCustomerInterface = $companyCustomerInterface;
    $this->companyCustomerResourceModel = $companyCustomerResourceModel;
}

public function assignCompany($customerId) {

try {
        $companyId = 2;
        if ($companyId && $customerId) {
            $connection = $this->resource->getConnection ();
            $select = $connection->select ()->from (['co' => 'company_advanced_customer_entity'])
                ->where ('co.customer_id = "' . $customerId . '" AND co.company_id = ' . $companyId . '');
            $checkMapping = $connection->fetchRow ($select);
            if ($checkMapping) {
                return true;
            } else {
                $companyMapping = $this->companyCustomerInterface;
                $companyMapping->setCustomerId ($customerId);
                $companyMapping->setCompanyId ($companyId);
                $companyMapping->setStatus (1);
                $companyMappingObject = $this->companyCustomerResourceModel->saveAdvancedCustomAttributes ($companyMapping);
                if ($companyMappingObject):
                    return true;
                endif;
            }
        }
        return false;
     } catch (\Exception $e) {
        $this->logger->warning('Something went wrong when assign customer to company' . $e->getMessage());
    }
}


texts: Session ID is not preserved, Magento starts a new session

texts:
I am trying to save a $_GET value in my custom session by using observer.

So I have this method that fires on custom_front_init_before

public function checkLocationId() {
  $location = Mage::app()->getRequest()->getParam('location');
  if(!empty($location)) {
    if (strlen($location) > 15) return;
    $location = (int) $location;
    Mage::getSingleton('core/session')->setLocationId($location);
  }
}

When I visit www.mymagentostoreaddress.com/?location=234 value 234 is saved in session. Once I click on any other link on the page Magento starts a new session (session_id changes) and my value is no longer available.

Why Magento starts a new session and how can I fix this? Or maybe you have suggestions what to test to find out what's happening? I'd appreciate your input.

EDIT

Calling the same code from header.phtml saves the value to a session and it doesn't get reinitialized on reload. This leads me to a conclusion that perhaps I've attached it to incorrect event.

So now I'm looking for an event that gets called on every page just before template files get processed.


texts: Magento 2: Custom input field values not saved in product form

texts:
I have to add a more complex input to the product form. For this, I have added the following UI configuration

<fieldset name="fieldset_name">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">A Label</item>
            <item name="collapsible" xsi:type="boolean">true</item>
            <item name="sortOrder" xsi:type="number">30</item>
        </item>
    </argument>
    <container name="fielset_name_container">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">10</item>
            </item>
        </argument>
        <htmlContent name="html_content">
            <argument name="block" xsi:type="object">Vendor\Module\Block\BlockClass</argument>
        </htmlContent>
    </container>
</fieldset>

The block class itself loads a .phtml template containing an input field with the name attribute product[<attributeCode>]. When I now enter a value and push the save button, the new value I entered in the input does not get saved.

What do I have to do to get it to save?


texts: How to change the number of items per row in products grid Magento 2.3.5

texts:
How to modify magento 2 to show 3 items per row in product grid instead of the default 4?
I tried to play with /var/www/magento2/vendor/magento/theme-frontend-luma/Magento_Catalog/web/css/source/module/_listings.less but nothing changed.
but still showing 4 items per row!!!
Any suggestions?


texts: magento 2 trace payment page issue array to string conversion

texts:
I am getting issue on check out page when place order button.It display

"An error occurred on the server. Please try to place the order again."

whaen checking log file then error is displaying

  main.CRITICAL: Notice: Array to string conversion in
  /var/www/html/v1/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on
  line 2999 {"exception":"[object] (Exception(code: 0): Notice: Array to
  string conversion in
  /var/www/html/v1/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on
  line 2999 at
  /var/www/html/v1/vendor/magento/framework/App/ErrorHandler.php:61)"}

I am not able to to trace the issue.Please let me know how to trace the issue.


texts: magento 2 main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size

texts:
I have Magento 2.3.1 on digitalocean plesk panel

It shows error like bellow

  [2019-04-22 11:36:49] main.WARNING: Memory size allocated for the
  temporary table is more than 20% of innodb_buffer_pool_size. Please
  update innodb_buffer_pool_size or decrease batch size value (which
  decreases memory usages for the temporary table). Current batch size:
  100000; Allocated memory size: 130000000 bytes; InnoDB buffer pool
  size: 134217728 bytes. [] []


texts: Magento 2: get product through api using id?

texts: I want to get product information using API call. I have product id of that product is it possible to do that.


texts: How to determine when to create an attribute and an attribute set

texts:
What questions do I need to ask myself for when creating attributes and attribute sets?

My physical shop sells many cake accessories and baking products, and I feel I don't comfortably know Attributes vs Attribute Sets enough in order to make a decision when creating these.

Any useful reading on this would be greatly appreciated.

Thank you


texts: Which compilation commands are needed in developer mode and when?

texts:
Can somebody give me instructions when to run which compilation commands in Magento 2 developer mode? I'm not sure if I understand it right yet.

In the devdocs, developer mode is described as follows:

  Static view files are not cached; they are written to the Magento pub/static directory every time they’re called

Does that mean, each individual file in pub/static is generated when it is requested and you never need to call setup:static-content:deploy? This contradicts my experience. Or can I delete any files and they will be regenerated? Also, images, CSS and JS files seem to be treated differently.

The developer mode documentation page says nothing about code compilation, but I think there was a difference as well, so it was not necessary to run setup:di:compile after all changes in di.xml files. Is this correct and if so, how does code generation work in developer mode?

In other words: cache aside, which commands do I need to run after which changes?


texts:
i have a function which sets the correct price for calculation:

$_product->getSpecialPrice() ? $_product->getSpecialPrice() : $_product->getCustomUnitAmount()*$_product->getPricePerCustomUnit()

if we have special price set it should return special price and otherwise normal product price based on calculation.

however special price from and to dates are way in the past and $_product->getSpecialPrice()  returns original price back instead of null / false

is there a correct way to check if product has special price set or not ?

or it's a magento 2 bug ?


texts: Magento 2 Install error: "There is no such engine:"

texts:
I tried to install Magento 2.2 EE on my local with MySQL 5.7.21 and PHP 7. On the command "bin/magento setup:install" it starts to populate the database until a point when it crashes with the following error:

   Progress: 434 / 801]
   Module 'Magento_CatalogSearch':
   Installing data...

       [LogicException]
       There is no such engine:

That's all I got. I tried to modify the table 'core_config_data' where path is 'catalog/search/engine' to 'mysql', realised that it wasn't even there, had to add it manually, but it didn't work at all, at the "bin/magento setup:upgrade" it also crashes at Magento_CatalogSearch with the same error "There is no such engine:".

Any ideas how can I get rid of this error?


texts: Magento 2 Custom Table Auto Increament Column value disorder

texts:
In my custom module, I have a database table with auto increment col. The columns values initially work fine but when I delete any record the value increased like this order
1,2,3,4,5,6,10,11,110,115,220,10004,1567899 etc (example).

if anyone knows what can be the issue will be appreciated.

table schema screenshot:

Inserted Records:


texts: Magento Enterprise Admin Login Not Working Suddenly

texts:
I am using magento enterpise. My Admin was not working suddenly.

If logged in with wrong username and password, It's showing "Invalid username/password", but when I tried to logged in with correct username and password(It was redirecting to the same login page).

It was worked for the past 1 year and I didn't do any changes in the server and I didnt apply any patches. Could you please help me in fixing the issue. I am using memcached(aws) for storing the sessions and redis for cache.


texts: How to retrieve all payment methods using magento api v1

texts: I am using magento api and i want to retrieve all payment methods which are enabled. When i am using cart_payment.list API, it's giving me only one method for quote id but in my back end there are four enabled methods. How can i get all payment methods?


texts: What is difference between official Magento 2 and github Magento2?

texts: Because when I see offical Magento2 there is no Core in the the app/code but when you see in the github there is Core Code app/code/Magento


texts: Retrieve your password from admin panel does not work

texts:
I've forgotten my admin login pass and using .../index.php/admin/index/forgotpassword does not do anything. I do not get any email! How to fix this.

Edit:

By debugging the ...app\code\core\Mage\Adminhtml\controllers\IndexController.php I noticed in line 225 public function forgotpasswordAction() the  $params = $this->getRequest()->getParams(); is empty! As it does not wait to enter the email address. In other words, this function checks the $params = $this->getRequest()->getParams(); before loading the forgotpassword form for entering an email!


texts:
I would need to manage on the Magento 2.3 e-commerce (Community Edition) a tax calculation according to consumption (separate from the VAT calculation that is managed with the Magento Tax Rate Percent Standard).
The tax is a parameter associated with a class of products and is calculated at the time of order based on the quantity of product purchased:
- X products have a consumption tax of a€ per milliliter purchased
- Y products have a consumption tax b of b€ per milliliter purchased
etc ...

This calculated consumption tax has to be shown in the order (at details level, calculated for each purchased product, and at the final total level as a summary of all single calculated taxes), as in the invoice, just for a group of customers. For this reason, it should be managed as a Tax Rule.

Has any of you ever had to handle a similar problem?
Do you know extensions that could facilitate this implementation?

Thank you very much!


texts: How to solve Installation is incomplete error in Magento 2?

texts:
I have got below error while install Magento 2.3. I am not a programmer, I'm just newbie and try to learn.

    [ERROR] PDOException: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint in /home/jm4viwna9q3f/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228
    Stack trace:

#0 /home/jm4viwna9q3f/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/jm4viwna9q3f/public_html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(93): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/jm4viwna9q3f/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#3 ,

Can anyone help me to solve this issue.

Any help would be appreciated.


texts: Magento 1.9.1.0 - Upload PDF File Type in Wysiwyg Editor and show PDF Icon

texts:
I made a custom module allowing user to upload .PDF file type in CMS > Pages. The code used is below:

app/etc/modules

<?xml version="1.0"?>
<config>
  <modules>
    <Pdf_WysiwygFiles>
      <active>true</active>
      <codePool>local</codePool>
    </Pdf_WysiwygFiles>
  </modules>
</config>

app/code/local/Pdf/WysiwygFiles/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <Pdf_WysiwygFiles>
      <version>1.0.0</version>
    </Pdf_WysiwygFiles>
  </modules>
  <adminhtml>
    <cms>
      <browser>
        <extensions>
          <allowed>
            <jpg>1</jpg>
            <jpeg>1</jpeg>
            <png>1</png>
            <gif>1</gif>
            <pdf>1</pdf>
          </allowed>
        </extensions>
      </browser>
    </cms>
  </adminhtml>
</config>

This works in CE-1.9 and does allow to upload PDF file when you click on Insert Image button and does not allow to link it.

Also, how to add a pdf preview icon for each file uploaded ? The result would be like below image


texts: Magento 2 How To Preview Adminhtml Email template in Frontend

texts:
I'm trying to preview email adminhtml template to front-end but its not working, I have tried below code.

{{block class='Magento\\Framework\\View\\Element\\Template' area='frontend'  template='Magento_Sales::email/shipment/track.phtml' }}


texts: Programmatically update and persist bundle option quantity

texts:
I want to programmatically update the quantity of a bundle option of a item in the users cart.

Currently in the cart, a bundle with the option "12 x DIN A4 page".

This is what I have done so far

class ItemInfo [...]

/** @var \Magento\Quote\Model\Quote\Item */
protected $quoteItem;

public function updateNumberOfPages($pages)
{
    $qtyOptions = $this->quoteItem->getQtyOptions();
    assert(count($qtyOptions) == 1);
    $option = reset($qtyOptions);

    $qty = $pages * $this->getNumberOfCopies();
    $this->quoteItem->updateQtyOption($option, $qty);
    $this->quoteItem->save($this);

    $this->quoteItem->getQuote()->setTotalsCollectedFlag(true)->collectTotals();

    return $this;
}

So I call this function updateNumberOfPages(4);

A bit later in the same request, I want to fetch and the new totals:

/** @var \Magento\Quote\Api\CartTotalRepositoryInterface */
protected $cartTotalsRepository;

...

$totals = $this->cartTotalsRepository->get($quoteItem->getQuoteId());

But here, the just updated item still reports "12 x DIN A4 page" - even I have set the qty above to 4.

What is going wrong?

Bonus question: $this->quoteItem->save() is deprecated - what to use instead?

Update I wrote a failing integration test for this:

public function testCanIncreaseNumberOfPages()
{
    $cart =  $this->cartBuilder->withProductRequest("proof", 1, $this->options)
        ->build();
    $quote = $cart->getQuote();
    $quoteItem = $quote->getItemsCollection()->getFirstItem();

    /**
     * @var $itemInfo ItemInfo
     */
    $itemInfo = $this->itemInfoFactory->create(['quoteItem' => $quoteItem]);
    $this->assertEquals(1, $itemInfo->getNumberOfPages());

    $itemInfo->updateNumberOfPages(2);

    $quote = $cart->getQuote();
    $quoteItem = $quote->getItemsCollection()->getFirstItem();
    $itemInfo = $this->itemInfoFactory->create(['quoteItem' => $quoteItem]);
    $this->assertEquals(2, $itemInfo->getNumberOfPages());
}

It fails the second assertion

Failed asserting that '1' matches expected 2.

Upate3

New update function:

public function updateNumberOfPages($pages)
{

    $qty = $pages * $this->getNumberOfCopies();

    $requestInfo = $this->orderOptions['info_buyRequest'];

    $requestInfo[self::OPTION_NAME_PAGES] = $pages;
    $requestInfo[self::OPTION_NAME_QTY] = $qty;

    $buyRequest = new \Magento\Framework\DataObject($requestInfo);
    $this->cart->updateItem($this->quoteItem->getId(), $buyRequest);
    $this->cart->save();

    $this->quoteItem->getQuote()->setTotalsCollectedFlag(false)->collectTotals();

    return $this;
}

New test:

public function testCanIncreaseNumberOfPages()
{
    $cart =  $this->cartBuilder->withProductRequest("proof", 1, $this->options)
        ->build();
    $quote = $cart->getQuote();
    $quoteItem = $quote->getItemsCollection()->getFirstItem();

    $this->assertEquals(6.0, $quote->getGrandTotal());

    /**
     * @var $itemInfo ItemInfo
     */
    $itemInfo = $this->itemInfoFactory->create(['quoteItem' => $quoteItem]);
    $this->assertEquals(1, $itemInfo->getNumberOfPages());

    $itemInfo->updateNumberOfPages(2);

    $quote = $cart->getQuote();
    $quoteItem = $quote->getItemsCollection()->getFirstItem();
    $itemInfo = $this->itemInfoFactory->create(['quoteItem' => $quoteItem]);
    $this->assertEquals(12.0, $quote->getGrandTotal());
    $this->assertEquals(2, $itemInfo->getNumberOfPages());
}

Fails in         $this->assertEquals(12.0, $quote->getGrandTotal());
 (expects 12, gets 6)


texts:
I'm trying to setup shipping method aliases for the checkout process.

for example for USPS, instead of the end-user seeing

"Priority Mail 1-Day Small Flat Rate Box"

I'd like to display

"Standard Ground"

thanks


texts: Can't upload product images on Magento 2 Xampp

texts:
I cannot upload product images on Magento 2 in Xampp. When I try to upload the product image, it gives me an error. Please see the following image:

I have also tried it again but the same error appeared.

Please help me to resolve this issue.

Looking forward to your reply.


texts: How to know the module coding well , good quality?

texts:
This question is from the store owner point of view without any coding knowledge

When I want to purchase a paid module, for example, 'one step checkout', I found there are a LOT of similar module

Popular module have similar feature, service (support, update) and some good reviews

Usually, there are few issue and I have to get support and it finally works well.

but while I'm using many modules for our store, I have no idea it's made well, good quality module and I can't judge I'm using right, correct module

How to know the module is code well or have good quality?

(Btw, what is the exact meaning 'coding well' or necessary point to be good module?)


texts: Magento2 modify success message of add to compare products list & display it in popup

texts:
Magento2 How can I modify the success message of add to compare products list

You added product Urban twist 2 to the comparison list.

& display it in popup modal


texts: How can I edit the height of my tables in Magento?

texts:
I'm trying to change the height of my table which is located in the product-shop class.
catalog - > product -> view.phtml. The problem is that I can set the height to higher numbers but not to lower ones.

The height is always fixed if I want to set it to lower numbers but I can increase the high. What can I do to set the height to lower numbers? I tried to set the height to lower numbers in css and in html code but it doesn't work - the table will always stay at this height.


texts:
Our magento shop is currently very big and we've got a lot of products. Products that are sold out are being kept in the shop for seo reasons.

In order to minify the database we want to get rid of those sold out products. Is there any plugin of some sort, that creates static html pages of those products? After that we could redirect the old product url to the new static one.

Or do you know any other method to achieve a similar behaviour?

The primary goal is to minify the database while sold out products are still visible for visitors and search engines.


texts:
I know how to manage the grid/list view in the back end, and set pager limits via the XML but is it possible to remove the grid view from just the catalogsearch result page preferably via the XML?

I've had a search and can't seem to find a way to do this anywhere.

Thanks for any help.


texts: Magento 2 - Install category attribute not work

texts:
I created a custom form for creating some attributes for the category.
My code is this but it doesn't work:
InstallData.php
<?php
namespace Create\Attribute\Setup;

use Magento\Framework\Module\Setup\Migration;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Catalog\Setup\CategorySetupFactory;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * Category setup factory
     *
     * @var CategorySetupFactory
     */
    private $categorySetupFactory;

    /**
     * Init
     *
     * @param CategorySetupFactory $categorySetupFactory
     */
    public function __construct(CategorySetupFactory $categorySetupFactory)
    {
        $this->categorySetupFactory = $categorySetupFactory;
    }
    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
         $installer->startSetup();

        $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
        $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Category::ENTITY);
        $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
        $categorySetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'my_attribute',
            [
                'type'         => 'varchar',
                'label'        => 'Title my attribute',
                'input'        => 'text',
                'sort_order'   => 100,
                'source'       => '',
                'global'       => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'visible'      => true,
                'required'     => false,
                'is_html_allowed_on_front' => true,
                'user_defined' => false,
                'default'      => null,
                'group'        => 'General Information',
                'backend'      => ''
            ]
        );
$installer->endSetup();
    }
}
?>

and this is my category_form.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="general">
        <field name="my_attribute">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">100</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">Title my attribute</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

Thanks for any help


texts: How to fetch UI Grid Component data from external REST API

texts:
We are trying to create a admin grid using UI Component and need to fetch data from external rest API, not able to figure-out the exact file from where we can inject this json data
Any help is highly appreciated
Thanks in Advance.


texts: Magento 1: Which ACL is related to the editor handle?

texts:
I'm using the following observer to add the editor handle to a System > Configuration section:

Partial config.xml:

<adminhtml>
    <!-- Events -->
    <events>
        <!-- Triggered before layout load -->
        <controller_action_layout_load_before>
            <observers>
                <digitalpianism_test_controller_action_layout_load_before>
                    <type>singleton</type>
                    <class>test/admin_observer</class>
                    <method>addEditorHandle</method>
                </digitalpianism_test_controller_action_layout_load_before>
            </observers>
        </controller_action_layout_load_before>
    </events>
</adminhtml>

Then my Admin/Observer.php file looks like this:

class DigitalPianism_Wall2time_Model_Admin_Observer
{
    /**
     * Add the editor handle to the system configuration Test section
     * @param Varien_Event_Observer $observer
     */
    public function addEditorHandle(Varien_Event_Observer $observer)
    {
        $layout = $observer->getEvent()->getLayout();
        $params = $observer->getAction()->getRequest()->getParams();
        // We add the editor handle when viewing the section where the chooser widget is displayed
        if (array_key_exists('section',$params) && $params['section'] == "test")
        {
            $layout->getUpdate()->addHandle('editor');
        }
    }
}

That works perfectly fine as a full administrator, I can use the editor handle to use widget in that specific section of my module.

However, if I use an user with a role limited to the System > Configuration > Test section only, I get the following error in the JS console:

  ReferenceError: WysiwygWidget is not defined

When I check the resources loaded, I find that the mage/adminhtml/wysiwyg/widget.js is not getting loaded from the editor handle, I assume it has something to do with the resources I assigned to my user role but I can't find which ACL is related to this specific editor handle.

NB: user allowed with another configuration section allowed access won't face the problem, it only happens if the user can only access the System > Configuration > Test section.


texts: How/Where does Magento Convert a RequireJS module Name into a URL?

texts:
In Magento 2, you can use RequireJS to include a javascript module with code that looks something like this.

#File: app/code/Package/Name/view/frontend/requirejs-config.js
var config = {
    map: {
        '*': {
            modulename: 'Package_Name/js/path/to/file'
        }
    }
}

While the requirejs-config.js file is a bit of Magento 2 magic, this appears to be standard RequireJS.   You're basically mapping the short name modulename to the javascript module named Package_Name/js/path/to/file.

What's not clear is where or how Magento 2 converts the javascript module name above

Package_Name/js/path/to/file

Into the HTTP(S) url

//magento.example.com/static/frontend/Magento/luma/en_US/Package_Name/js/path/to/file.js

In a stock RequireJS system, RequireJS would try to load the following URL

//magento.example.com/Package_Name/js/path/to/file.js

So clearly Magento's doing something to ensure the above URL is converted into a Magento frontend URL.  What's not clear is

Where this happens (PHP layer? Javascript layer?)
What the rule for that conversion are. The RequireJS module doesn't look like a standard Magento file identifier (Package_Name::js/path/to/file)

So, how/where does Magento 2/RequireJS convert the module into a path.


texts: magento 2 view model set payment additional data before place order

texts:
I am adding a token in payment additional data

 getData: function () {
            return {
                'method': "pay_cc",
                'additional_data': {
                    'token_code': this.getToken(),
                }
            };
        },

setting this 'token_code' with function

            getToken:function(){
            return this.paymentToken;
        },

before place order I am generating token and setting setting this before calling 'self.plcaseOrder()' function

this.paymentToken = response[0];
console.log("TOKEN CODE");
console.log(this.paymentToken);
self.placeOrder();
return true;

When I access this in magento payment method authorize function I am getting null.

How Can I set this token_code??


texts: PHP - How to get session current shipping method title

texts:
This is code i use for getting current session shipping method code:

<?PHP echo Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod(); ?>

But this code is only giving me the current session shipping method code not the shipping title.

How can i get the current session shipping method title ?


texts: Which Search Criteria are available in Magento2?

texts:
While compiling a filter-set for a repository search criteria, I was wondering if I can make use of all known Magento 1 methods or if there are any differences.

Where are theses defined in the code (if), is there some kind of list maybe?


texts: Constrain the add of only one product between associated products of a Grouped Product

texts:
In Magento 1.9.0.1, I have a product that I can ship or I can download so I created 1 simple product and 1 downloadable product with no visibility in Catalog. Then I created a Grouped product and I associated the above mentioned products.

This works, but customers in product page must manual insert "1" in quantity field of interest product and then finally add to card.

I'ld like constrain customers so they choose one of the 2 products simply by clicking over and then add to cart the selected product.

How can I do?


texts: How to theme customer/account/logoutSuccess page

texts:
In Magento 2, when a user logs out of their account, they are redirected to customer/account/logoutsuccess page, which then redirects to the homepage after 5 seconds.

How can I temporarily disable this redirect so that I can theme it with custom CSS?


texts: Not able to display text Total in CSV for custom grid

texts:
I have created a custom grid in Magento admin and have also added the total at below the grid .However I am not able to get the text "Total" when the grid is exported to CSV or XML.

 $this->addColumn('created', array(
        'header' => Mage::helper('extension')->__('Date'),
        'index' => 'center',
        'index'     => 'created_at',
        'type' => 'date',
        'align' => 'left',
        'width' => '90px',
        'format'    => 'MM-dd-Y',
        'totals_label'  => Mage::helper('extension')->__('Total'),
    ));


texts: Need help with configurable product pricing (2 variable)

texts:
Somewhat new to Magento, and using it for a current business to create a web store.

I'm in need of help for how to create a configurable product with some specific pricing information that I cannot get right. Here is my best explanation of the situation (using an example product).

The product is being configured over two variables: Color (ish) and an optional addition I'll call LB [yes/no similar].

My issue is that the price differences are different for ALL variations of the item, as in they are not all comparable. The LB option is not the same price cost addition for each color option.

Example: M1900
M1900 Black..... no LB = 252.31, w/ LB = 312.58 [60.27 difference]
M1900 Galv...... no LB = 269.25, w/ LB = 330.52 [61.29 difference]
M1900 Red....... no LB = 260.82, w/ LB = 321.59 [60.77 difference]
ect...

Right now, when I create the Configurable Product, I'm setting the price to 0.00 (as you cannot buy a "base" M1900, it needs color / LB?). When created the associated child products, I start running into the issue with pricing. I'll use the example again. When creating the M1900 Black I set the color price to 252.31, and leave the other price off as there is no LB. When creating the M1900 Black LB the color price is already set, and I use the 60.27 difference as the yes LB price.

After creating this, however, the next LB item I create is using that 60.27 price which is not correct.

How do I go about setting individual prices for each combination... that will show up when configuring the product?


texts: Magento 2 Remove test data that is generated from Performance Toolkit?

texts:
I tried to test Magento 2 performance on my local computer by using the Magento Performance Toolkit,

php bin/magento setup:perf:generate-fixtures /var/www/html/magento2/setup/performance-toolkit/profiles/ce/extra_large.xml

I wasn't aware that this command added almost a million products into the database, which made my testing site extremly slow. I would like to remove all the testing data that is generated from this Performance Tookit, but I couldn't find out how.


texts: Magento 2 payment method not showing in checkout

texts:
I have used this module in many stores https://marketplace.magento.com/ontap-module-mastercard.html.
But for some reason in a new instance of Magento that I installed, it's not showing the payment methods from this module. The payment methods are enabled, I have run these commands:

1- php bin/magento setup:upgrade
2- php bin/magento setup:di:compile
3- clear and flush cache
4- Reinstall the module with different versions

Nothing seems to work.
In Backend, I can see the module installed and the config options for the payment methods, but in frontend just the default Magento payment methods are shown.
Please help.
Greetings!


texts: Magento2 - How to add multiple radio option in custom payment method?

texts:
I have created a custom payment method by default single option coming on checkout page which is a name of payment method but I want to give three different option in single payment method like a Credit card, Debit Card, Etc all must be Radio Button.

How we can achieve the same? based on selected option redirect to
payment getaways...


texts: Magento : Get Lifetime Total Sales Direct Query

texts:
this is my query:

SELECT
   FORMAT(SUM(`s`.`grand_total`), 2) AS `sum`
FROM `sales_flat_order` `s`
WHERE
      `s`.`grand_total` > 0 AND
      `s`.`state` =  'complete'
ORDER BY SUM(`s`.`base_total_invoiced`) DESC

but result of this query does not match Lifetime Sales from dashboard page. Any idea why ?

Thx


texts: Update store product prices on catalog_product_save_before

texts:
On catalog_product_save_before event I've got handler that should update prices for product. On save I need to update prices for every store, not one price for Default.

$sellerslist = Mage::getModel('mpassignproduct/mpassignproduct')->getCollection();
$sellerslist = $this->getSellersList();
$data = $sellerslist->getData();
if (!empty($data) && count($data) > 0 && !empty($data[0]['mpassignproduct_id']) && $data[0]['mpassignproduct_id'] + 0 > 0) {
    $stores = Mage::helper('advox_core')->getStoresByWebsiteId($websiteId);
    foreach ($stores as $storeId) {
        // Previously I tried to load this product to new variable.
        //$product = Mage::getModel('catalog/product')->setStoreId($storeId + 0)->load($product->getId());
        $product->setStoreId($storeId + 0);
        $product->setMinPrice($data[0]['minprice']);
        $price = $data[0]['minprice'];
        if ($price === null) {
            $price = 0;
        }
        $product->setPrice($price);
    }
}

I can't load product again for specific store because on save there is once again called catalog_product_save_before so infinite event observer is called.
How to change product prices for specific store.

Update:

I changed to:

$websiteIds = $product->getWebsiteIds();
foreach ($websiteIds as $websiteId) {
    $sellerslist = $this->getSellersList();
    $data = $sellerslist->getData();
    if (!empty($data) && count($data) > 0 && !empty($data[0]['mpassignproduct_id']) && $data[0]['mpassignproduct_id'] + 0 > 0) {
        $product->setWebsiteId(array($websiteId + 0));
        $product->setMinPrice($data[0]['minprice']);
        $price = $data[0]['minprice'];
        if ($price === null) {
            $price = 0;
        }
        $product->setPrice($price);
    }
}
$product->setWebsiteIds($websiteIds);

as you said that prices should be changed only for websites. I tried with catalog_product_prepare_save event but still not updating.

Update 2:

While saving product in admin panel I've got only global product model. Is there any simple way to load website specific data to this product model and then change this details?


texts:
for a multistore I want to edit the titles of my products... like a download a csv file and then edit fast (search and replace). And then upload.
Do you know if it’s possible?
Thanks!


texts: How to create a shipment pdf programmatically?

texts:
I found how to create an invoice programmatically but nothing about to create a shipment pdf.
So far I can create the shipment for items but I have no clue how create the pdf.


texts: How to set UiComponent imageUploader Width and Height in Magento 2.3.4?

texts:
I'm using Magento 2.3.4, and now I'm extending the category form to add new field input image like this:

app/code/Vendor/Module/view/adminhtml/ui_component/category_form.xml

  <field name="banner_io" sortOrder="40" formElement="imageUploader">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">category</item>
            </item>
        </argument>
        <settings>
            <elementTmpl>ui/form/element/uploader/image</elementTmpl>
            <dataType>string</dataType>
            <label translate="true">Banner IO</label>
            <comment translate="true">Dimension: 900px X 354px</comment>
            <visible>true</visible>
            <required>false</required>
            <scopeLabel>[STORE VIEW]</scopeLabel>
        </settings>
        <formElements>
            <imageUploader>
                <settings>
                    <required>false</required>
                    <uploaderConfig>
                        <param xsi:type="url" name="url" path="catalog/category_image/upload"/>
                    </uploaderConfig>
                    <previewTmpl>Magento_Catalog/image-preview</previewTmpl>
                    <openDialogTitle>Media Gallery</openDialogTitle>
                    <initialMediaGalleryOpenSubpath>catalog/category</initialMediaGalleryOpenSubpath>
                    <allowedExtensions>jpg jpeg gif png</allowedExtensions>
                    <maxFileSize>4194304</maxFileSize>
                </settings>
            </imageUploader>
        </formElements>
    </field>

in here I can set the max file size, how I can set minimum/maximum width and height?


texts:
I have added categories to search, so it displays categories matching to search term(s) and below them products.

I can not get category image. I know these categories have images because they are shown in subcategories when navigating in categories.

How I can loop these categories found through and get image to it ?
This search works and displays correctly category name but $_imgHtml is currently empty

    echo "
";
    echo "Categories found:";

    foreach ($categories as $category) {
        if ($this->helper('catalog/category')->canShow($category) && stripos($category->getName(), $searchTerm) !== false)
        {
            $_helper    = $this->helper('catalog/output');
            if ($_imgUrl = $category->getImageUrl()) {
                $_imgHtml = '
escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" />
';
                $_imgHtml = $_helper->categoryAttribute($category, $_imgHtml, 'image');
        }
            echo $_imgHtml;
            echo "
getUrl()."'>".$category->getName()."

";
        }
    }
    echo "
";

print_r from $category:

Mage_Catalog_Model_Category Object ( [_eventPrefix:protected] => catalog_category [_eventObject:protected] => category [_cacheTag:protected] => catalog_category [_useFlatResource:protected] => [_designAttributes:Mage_Catalog_Model_Category:private] => Array ( [0] => custom_design [1] => custom_design_from [2] => custom_design_to [3] => page_layout [4] => custom_layout_update [5] => custom_apply_to_products ) [_treeModel:protected] => [_urlModel:protected] => [_defaultValues:protected] => Array ( ) [_storeValuesFlags:protected] => Array ( ) [_lockedAttributes:protected] => Array ( ) [_isDeleteable:protected] => 1 [_isReadonly:protected] => [_resourceName:protected] => catalog/category [_resource:protected] => [_resourceCollectionName:protected] => catalog/category_collection [_dataSaveAllowed:protected] => 1 [_isObjectNew:protected] => [_data:protected] => Array ( [entity_id] => 169 [entity_type_id] => 3 [attribute_set_id] => 3 [parent_id] => 99 [created_at] => 2016-01-18 17:20:04 [updated_at] => 2016-04-18 17:20:04 [path] => 1/2/99/169 [position] => 1 [level] => 3 [children_count] => 0 [is_active] => 1 [include_in_menu] => 1 [request_path] => test1/testdeep.html [name] => Test deep 1 [url_key] => test_deep [path_ids] => Array ( [0] => 1 [1] => 2 [2] => 99 [3] => 169 ) ) [_hasDataChanges:protected] => 1 [_origData:protected] => Array ( [entity_id] => 169 [entity_type_id] => 3 [attribute_set_id] => 3 [parent_id] => 99 [created_at] => 2016-01-12 17:20:04 [updated_at] => 2016-04-18 17:20:04 [path] => 1/2/99/169 [position] => 1 [level] => 3 [children_count] => 0 [is_active] => 1 [include_in_menu] => 1 [request_path] => test1/testdeep.html [name] => Test deep 1 [url_key] => test_deep ) [_idFieldName:protected] => entity_id [_isDeleted:protected] => [_oldFieldsMap:protected] => Array ( ) [_syncFieldsMap:protected] => Array ( ) )


texts: Get products by a particular manufacturer

texts:
I want to display all the products which belongs to a particular manufacturer.

Here is my code:-

$manufacturerId = 2;
$attributeCode = 'manufacturer';
$products=Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToFilter($attributeCode, $manufacturerId);

echo $products->getItems();

It displays nothing. How can I get this??


texts: Assign images to products programmatically

texts:
I want to assign images to products in my store. The images name the same SKU product name.
I put my PHP file in root/pub and tried this code:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

/*
 * Assumes doc root is set to ROOT/pub
 */
require_once dirname(__DIR__) . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

class AssignImages extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
    public function launch()
    {
        $state = $this->_objectManager->get('Magento\Framework\App\State');
        $state->setAreaCode('adminhtml');

        $galleryReadHandler = $this->_objectManager->create('Magento\Catalog\Model\Product\Gallery\ReadHandler');
        $imageProcessor = $this->_objectManager->create('Magento\Catalog\Model\Product\Gallery\Processor');
        $productGallery = $this->_objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Gallery');

        /**
         * Assumed images are named [sku].[ext] and reside in ROOT/pub/media/[image_dir]
         */
        foreach (glob(__DIR__ . "/media/img/*.{jpg,png,gif}", GLOB_BRACE) as $image) {
            $imageFileName = trim(pathinfo($image)['filename']);
            $sku = $imageFileName;
            try {
                $product = $this->_objectManager->create('Magento\Catalog\Model\Product')->loadByAttribute('sku', $sku);
                if ($product) {
                    $galleryReadHandler->execute($product);

                    // Unset existing images
                    $images = $product->getMediaGalleryImages();
                    foreach($images as $child) {
                        $productGallery->deleteGallery($child->getValueId());
                        $imageProcessor->removeImage($product, $child->getFile());
                    }

                    /**
                     * Add image. Image directory must be in ROOT/pub/media for addImageToMediaGallery() method to work
                     */
                    $product->addImageToMediaGallery('img' . DIRECTORY_SEPARATOR . pathinfo($image)['basename'], array('image', 'small_image', 'thumbnail'), false, false);
                    $product->save();
                    echo "Added media image for {$sku}" . "\n";
                }
            } catch (\Exception $e) {
                echo $e->getMessage();
            }
        }
        return $this->_response;
    }

    public function catchException(\Magento\Framework\App\Bootstrap $bootstrap, \Exception $exception)
    {
        echo $exception->getMessage();
        return false;
    }
}

/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('AssignImages');
$bootstrap->run($app);
?>

But display this error:

Fatal error: Declaration of
AssignImages::catchException(Magento\Framework\App\Bootstrap
$bootstrap, Exception $exception) must be compatible with
Magento\Framework\App\Http::catchException(Magento\Framework\App\Bootstrap
$bootstrap, Exception $exception): bool in
/home/tabasheermedia/public_html/no-limits/pub/importimage.php on line
12

My Magento version 2.3.3


texts:
How can I add additional sort by: price, newest and most popular?

Thanks.


texts: M2 - How to get attribute on Product Page showing above title

texts: I am using custom theme inherit from blank theme, i want to display my attribute on product page above title, how to do that?


texts: Magento2 How to expand basket by default in order summary on checkout page?

texts:
on checkout page, can anyone help me, how do i by default expand product in order summary.

Thanks


texts: How to add success mesage on click of add to cart buttton in custom module in Magento 2

texts:
I want to display success message on click of add to cart button in magento 2.
I am developing custom module in which i can develop functionality of add to cart and i want to  add success and error messages on click of add to cart in Magento 2.
so anyone can have idea then please share with me.
Thank you in Advance.