New answers tagged

1

There might be a more straight forward solution. If quote_id is unique in your database it makes more sense to use it as a primary key. So you remove entity_id from db_schema.xml and change the resourceModel accordingly changing _idFieldName to quote_id. You then add this to the _construct(): (check this question how to save data into custom table): $this-&...


0

I faced such error, and having investigated this question it was found out that the problem was that in the third-party module (which place in app/code or vendor/) which uses a patch to add attributes with method $eavSetup->addAttribute(), uses for class the interface \Magento\Framework\Setup\Patch\SchemaPatchInterface instead \Magento\Framework\Setup\...


1

try below code - Another way <?php protected $_companyShippingQuoteFactory; public function __construct( ... \Company\Shipping\Model\QuoteFactory $companyShippingQuoteFactory ) { ... $this->_companyShippingQuoteFactory = $companyShippingQuoteFactory; } ... $quote_id =13718; $quoteModel = $this->_companyShippingQuoteFactory->...


1

Try This Code protected $_companyShippingQuoteFactory; public function __construct( ... \Company\Shipping\Model\Quote\ResourceModel\CollectionFactory $companyShippingQuoteFactory ) { ... $this->_companyShippingQuoteFactory = $companyShippingQuoteFactory; } ... $quote_id =13718; $quoteModel = $this->_companyShippingQuoteFactory->...


0

I am just speculating here.. The error is related to quantity not being set in an array that comes from the data source, this is most likely related to the MSI functionality as it was new in 2.3. If you are not using MSI with multiple stocks you could start to try to disable it, you can follow the instructions on the devdoc for this: https://devdocs.magento....


0

I figured it out. It was not saving because the mage2gen generator added wrong values for the ID in the files, because my table name ends with _quote and it took it to make quote_id to the ID key..., but I am already using quote_id as a field, so it does not work out... Company/Shipping/Model/ResourceModel/Quote/Collection.php Company/Shipping/Model/...


1

It might be related to your: db_schema.xml Try to add: <column xsi:type="int" name="id" nullable="false" unsigned="true" comment="ID" identity="true"/> Adding identity="true" If you check e.g. this example you see they have it on their primary key: https://devdocs.magento.com/...


0

The problem solved itself after i updated to 2.4.1. I am still not sure what was the problem though. It seems kinda strange they need to make bulk updating products so complicated. Magento 2 are over-complicating many simple functions (in my opinion).


1

UPDATE `catalog_product_entity` SET `sku`=TRIM(`sku`)


0

Firstly check if rabbitmq service is running: service rabbitmq-server status (centos) Secondly look at the process ps aux | grep "async.operations.all" if you have kill them(normally you should not have more than one) pkill -f 'async.operations.all' and truncate magento_operation,magento_bulk and magento_acknowledged_bulk tables, flush cache -...


0

Here is snippet if you have the customers e-mail address, just replace $EMAIL below with customers e-mail address and $PASSWORD with plain-text password. UPDATE `customer_entity_varchar` SET `value` = MD5("$PASSWORD") WHERE `entity_id` IN (SELECT `entity_id` FROM `customer_entity` WHERE `email` = "$EMAIL") AND `attribute_id`...


0

I agree that the filter module should be disabled or fixed. A theme/ plugin that cannot handle magento flat catalog should be avoided.


0

You can use the data migration tool to migrate your products and attributes. You will need to set your parameters to exclude all other data. You can migrate your existing M1 Database to M2. If you don't need your setting and other data you can simply export your products from your old database and import them to your new M2 store. You can see for ...


0

Had the same issue on a site that was configured to use the default search engine. A plug-in was used for frontend search, so no real attention was paid. Turned out that Elasticsearch had to be installed and configured, even though there was no obvious application for it. This solved the problem.


0

Okay so I finally figured out how to do this. To convert a virtual product order to simple product order, you need to update sales_order, sales_order_grid, sales_order_item, and sales_order_address. Change is_virtual to 0, add weight, change product type to non-virtual, and add address respectively. Hope this will help someone, cheers.


0

This script is going to help you with it: SELECT sog.entity_id `order ID`, sog.customer_name `Name of the client`, sog.customer_email `Email of the client`, sog.billing_address `Billing informations`, sog.shipping_address `Shipping informations `, sog....


0

Go to vendor\magento\module-msrp\Setup\Patch\Data\ChangePriceAttributeDefaultScope.php comment line no 89 to 94 $categorySetup->updateAttribute( $entityTypeId, $attribute['attribute_id'], 'is_global', \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL ); and in the file ...


0

Running the php bin/setup:config:set fixed the issue.


0

Check your env.php file if your db credentials are correct. Check if dbname has the right database that you are using, username and password are the ones you use to log into MYSQL.I would suggest you keep 'host' => 'localhost'.


0

Create a function in your resourceModel like this namespace Module\Namespace\Model\ResourceModel; class Inventory extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { public function truncateTable() { if ($this->getConnection()->getTransactionLevel() > 0) { $this->getConnection()->delete($this-...


0

mview_state is a table enabling your indexes to feed their index tables. That is the nutshell. Now, I have built a small dummy module with index this week. the index file is as follows: (etc/indexer.xml) <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...


1

Just define the config as per you ES instance: for example: --search-engine=elasticsearch7 --elasticsearch-host=localhost --elasticsearch-port=9200


0

Finally I found solution for this issue: below command is working fine for me. php bin/magento setup:install --base-url=http://localhost/fakshop/ --db-host=localhost --db-name=fakshop --db-user=root --admin-firstname=admin --admin-lastname=admin2 --admin-email=test@email.com --admin-user=admin --admin-password=testing123 --language=en_US --currency=AED --...


0

Magento replaced the database schema system and replaced it by a better one. It works now with etc/db_schema.xml instead of Setup/UpgradeSchema.php app\code\Company\Ui\etc\db_schema.xml <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...


0

Check if the required modules are installed and enabled. In my case (during an update from Magento 2.3 to Magento 2.4) the modules "Magento_Elasticsearch" and "Magento_Elasticsearch6" were disabled. "Magento_Elasticsearch" contains the implementation of the "Magento\AdvancedSearch\Model\Client\ClientOptionsInterface".


1

try this code: select A.entity_id,A.value from catalog_product_entity_varchar A inner join catalog_product_entity_int B on A.entity_id = B.entity_id where B.attribute_id = 97 and B.value = 2 and A.attribute_id=73 in catalog_product_entity_int you have information about status (in my case it is attribute with id = 97). value == 2 means ...


0

If you want to use parameters in and out then you have to run like this to get output $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $resource = $objectManager->get('Magento\Framework\App\ResourceConnection'); $connection = $resource->getConnection(); $connection->query("CALL SomeStoredProcedure($someInParameter1, $...


0

Yeah, I hit the problem also after when I've updated to 2.3.5-p2. During my investigation, I've found out that the problem was caused by the indexer from the "Google Product Feed" module. After a deep dive into the mechanics of indexes and how are they organized, I've found a simple solution. All you need to do is go to: Admin area -> System -&...


0

Now you can add eav_attribute_group table attribute_group_name field group name General defult_id set 1;


0

I would advise activating Memcache through these changes in your Magento root folder > app > etc > env.php. From: 'session' => array ( 'save' => 'db', ) In: 'session' => array ('save' => 'memcached', 'save_path' => '127.0.0.1:11211'), Then remove these files: rm -rf var/cache/* var/page_cache/* var/session/* This will improve your ...


0

I just had this problem as well. Check this answer - it's the right one. You have to delete all the triggers in your database that reference 'scconnector_google_feed_cl'. There's three for each of the catalog_product_entity_*** tables. You can go into phpmyadmin and select your database, then Triggers to see them all on one page. (in my case it was all of ...


0

I also faced this issue. It seems that there's no other solution to it aside from creating an around plugin on the getTableName I would suggest you create an around plugin on Magento\Framework\App\ResourceConnection Since the method getTableName, is the one responsible for adding in the table prefix.


0

Hi it will not add any column ,till you either delete the column created or edit the column and change its default value . ps : after doing this there could be other column for which this error will be thrown edit them too and change the default value . you would be able to add extra columns The same happened to me when i used a table from my m1 ...


0

Note: Please take backup of database prior to run below queries: First we need to get attribute_id for Meta Title, Meta Description and Meta Keywords. We can do this is a subselect. Meta Title: DELETE FROM catalog_product_entity_varchar WHERE attribute_id = ( SELECT attribute_id FROM `eav_attribute` WHERE attribute_code = 'meta_title' AND ...


0

you can import data from csv file https://docs.magento.com/user-guide/system/data-import.html otherwise you can create a command object using Magento\Framework\Model\ResourceModel\Iterator to import huge amount of records. example code: http://www.rosenborgsolutions.com/collection-walk-iterator.php


0

Probably your AUTO_INCREMENT is set wrong for the table. You can check this with: SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'db_name' AND TABLE_NAME = 'table_name'; You can then fix the auto increment by setting it the the highest ID +1 ALTER TABLE table_name AUTO_INCREMENT = start_value;


0

Truncating the log tables does not make sense here, as the CONSTRAINT is in adminnotification_inbox table. You could truncate that table (they just contain notification in admin anyway). However, the issue seems to be that the increment is incorrect (set to 0). You can change this with: ALTER TABLE adminnotification_inbox AUTO_INCREMENT = {HIGHEST id + 1};


0

You are trying to add a row to the eav_attribute_group table that already exists. The link you referenced to is deleting another row from the table. Possibility is to remove the correct row from table delete from eav_attribute_group WHERE attribute_group_name = 'General' AND attribute_set_id = 4; After that, you should be able to run setup:upgrade again. ...


0

Have you tried this one? https://github.com/elgentos/masquerade I'm no developer but even I managed to get it to work.


0

As per this Doc I think you don't have to do anything. Just change the storage system and click on the Synchronize button below Then also take a backup of the entire site and set-up on the local system and do it. And see if it working or not. Thanks Happy Coding


Top 50 recent answers are included