New answers tagged

0 votes

Get configurable's items quantity SUM using mysql

SELECT SUM(csi.qty) FROM catalog_product_entity AS parent_cpe JOIN catalog_product_relation AS link ON link.parent_id = parent_cpe.entity_id JOIN catalog_product_entity as child_cpe ON ...
user avatar
0 votes

Magento : How to Implement Automatic Related Products and Category Based Upsell Products

Below is a nice extension to automate your cross-sell and upsell https://amasty.com/automatic-related-products-for-magento-2.html
user avatar
0 votes

Remove special character from input form at checkout?

Try this for your postcode field: Postcode: <input type="text" id="myText"> <p>Click the button to change the value of the text field.</p> <script> ...
user avatar
0 votes
Accepted

Magento 2 - Add column to a table by using the declarative schema

I figured it out. It actually worked all the time !!! The problem was my SQL Viewer Software HeidiSQL (v12.0.0.6468) which has a bug and is not showing new data even after refreshing, you need to ...
user avatar
  • 2,402
1 vote

Magento 2 - Add column to a table by using the declarative schema

Check your extension order, It should be after Magento_Sales. etc/module.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
user avatar
  • 1,049
1 vote

PHP and MYSQL versions for Magento 1.9.4.0, 2.4.2-p1 and 2.4.4

It's not possible to run these Magento instances in one Hosting with the same PHP Version. The reason is simple: Magento 1.9 was released in 2014, 8 years ago. Magento 2.4 was released in 2020. PHP ...
user avatar
0 votes

There has been an error processing your request: Error log record number: d11d948cb3596b359566fa162df65dbf6baef2446fe384f4476057675f3dd95f

You have to run cat var/reports/d11d948cb3596b359566fa162df65dbf6baef2446fe384f4476057675f3dd95f in your project root directory. Connect to your server with ssh. In your case with putty. Then, ...
user avatar
0 votes

There has been an error processing your request: Error log record number: d11d948cb3596b359566fa162df65dbf6baef2446fe384f4476057675f3dd95f

you must have enter incorrect column name, or while inserting data you must have wrong filed data. please check once and you will good to go.
user avatar
0 votes

Magento 2 : Ui component displaying wrong date

Try adding the <item name="timezone" xsi:type="boolean">false</item> to the date column. In my case it seems to have fixed the issue. <column name="start_date&...
user avatar
  • 3,131
1 vote
Accepted

How is working insertOnDuplicate() in magento 2

Use of insertOnDuplicate query using Magento 2, You need to create a Connection object first to run the query using ResourceConnection class. When you insert any new row into a table if the row ...
user avatar
2 votes
Accepted

Magento 2.4.4 error in setup:upgrade

I had same issue after migrate of Magento version. I was used insertOnDuplicate . Update magento file. vendor/magento/module-catalog/Setup/Patch/Data/UpdateMultiselectAttributesBackendTypes.php ...
user avatar
  • 1,049
0 votes

Magento 2: In which database table are the payment methods stored?

Magento does not save payment methods, In core_config_data you will find your custom payment method's settings but list of payment method you could not find. Check your third party payment module's ...
user avatar
  • 1,049
0 votes

Magento 2 Order Cancel foreign key constraint error

This seems to be fixed in the current develop branch. So this fix can be used instead of custom solutions. The easiest way to implement this is trough a composer patch until it will be released. https:...
user avatar
  • 1,280
0 votes

Multiple SQL queries in Magento 2 can't be executed

You can use like. $sql = "CREATE SQL SECURITY INVOKER VIEW {$viewToLegacyIndex} AS SELECT DISTINCT ...
user avatar
  • 1,049
0 votes

Magento 2.2.5: How to join a table with a repository

This is a beautiful post about joins in repositories... https://fishchenko.com/blog/magento-2-join-table-in-orderrepositorygetlist-custom-field/ Credits: VLADIMIR FISHCHENKO - https://magento....
user avatar
0 votes

Prevent saving the default value for category attribute

<?php namespace Moazzam\MaterialCount\Model\Config\Backend; use Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend; use Magento\Framework\Exception\AlreadyExistsException; use Moazzam\...
user avatar
  • 13
0 votes

How to save data to Magento2 database?

<?php declare(strict_types=1); namespace Moazzam\ManageModels\Controller\Index; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\Action\HttpPostActionInterface; ...
user avatar
  • 13
0 votes

1146 Table 'mage.flag' doesn't exist

Create flag Table using below query CREATE TABLE `flag` ( `flag_id` int UNSIGNED NOT NULL COMMENT 'Flag Id', `flag_code` varchar(255) NOT NULL COMMENT 'Flag Code', `state` smallint UNSIGNED NOT ...
user avatar
0 votes

Magento 2.3 data insert using Data patch

<?php declare(strict_types=1); namespace Moazzam\AddPatch\Setup\Patch\Data; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\Patch\DataPatchInterface; use ...
user avatar
  • 13
0 votes

How to convert install/upgrade schema scripts to db_schema.xml files?

Please follow the following steps to successfully Migrate yours install/upgrade scripts to declarative schema Go to your database search for setup_module table and delete all the modules for which ...
user avatar
0 votes

1146 Table 'mage.flag' doesn't exist

Trying to run the setup:install again I found this issue below related to the database permission. I solved it with these commands in my database, directly from my MySQL Docker container. CREATE USER ...
user avatar
0 votes

Magento 2 – Item with the same ID already exists

Check your report result collection query, may be it would return multiple records with same id (primary key entity_id). Use group by for id ( primary key Id) in your result collection. Ex: getSelect()...
user avatar
  • 1,049

Top 50 recent answers are included