Hot answers tagged

2

Be safe: make a backup of your SQL first. SET FOREIGN_KEY_CHECKS = 0; Truncate order tables: TRUNCATE TABLE `gift_message`; TRUNCATE TABLE `quote`; TRUNCATE TABLE `quote_address`; TRUNCATE TABLE `quote_address_item`; TRUNCATE TABLE `quote_id_mask`; TRUNCATE TABLE `quote_item`; TRUNCATE TABLE `quote_item_option`; TRUNCATE TABLE `quote_payment`; TRUNCATE ...


2

For cleaning products data : SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE `catalog_category_product`; TRUNCATE TABLE `catalog_category_product_index`; TRUNCATE TABLE `catalog_category_product_index_tmp`; TRUNCATE TABLE `catalog_compare_item`; TRUNCATE TABLE `catalog_product_bundle_option`; TRUNCATE TABLE `catalog_product_bundle_option_value`; TRUNCATE TABLE `...


2

First read this below articles: https://store.fooman.co.nz/blog/an-introduction-to-extension-attributes.html https://devdocs.magento.com/guides/v2.3/extension-dev-guide/extension_attributes/adding-attributes.html If you want to add a field them you need to use extension_atttibutes Extension attribute gives the facility to add a new field to existing API ...


1

Try this class ................. { protected $_productCollectionFactory; protected $_productCollectionFactory; protected $_productRepository; public function __construct( \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, \Magento\Sales\Model\ResourceModel\Report\Bestsellers\...


1

You can customize method Magento\Quote\Model\Quote\Item::representProduct() to return false if the product SKU matches your criteria. Reference post: Magento 2: How to Prevent item's quantity from being added


1

Please try with below code: create custom file in root like ordercreate.php <?php use Magento\Framework\App\Bootstrap; /** * If the external file is in the root folder */ require __DIR__ . '/app/bootstrap.php'; $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); $obj = $bootstrap->getObjectManager(); $state = $obj->get('Magento\...


1

@Sanchit I've used Authorize.net Accept JS payments on our website and have faced the same issues. After debugging, I've found that the SHA512 key is not matched with the generated transaction key. The issue is because of the Float value of the transaction amount. It seems like the issue is with the Magento's core module of AcceptJs payments. I've disabled ...


1

Ok, so the problem was when i set STATE_COMPLETE Magento make the order closed. But if i set STATE_PROCESSING or STATE_PENDING with status Complete then order status show complete but when i view the order details there it show processing/pending. So i tried to figure out when magento make order status complete and it is when a invoice is generated. So i ...


1

Please take note that invoking the the save method of the order would trigger a state check which might explain why you are experiencing the issue. Magento 2 has a separate class for checking the order state. In the Magento\Sales\Model\ResourceModel\Order class you will find the save method invoking state check public function save(\Magento\Framework\...


1

Here is the solution to add a custom attribute in M2epro order. Once the order has been placed in Magento using M2epro, it will trigger one event ess_order_place_success after order success in which you will get order object. You can create an observer using that event. Below is the code for the event.xml <?xml version="1.0"?> <config xmlns:xsi=...


1

For me, sales_order_save_commit_after was the only event that worked well: If you need the event to be triggered in the admin area and also in the frontend, you can add the following code in etc/events.xml. If you need it for the order created from admin only, you need to add the following code in etc/adminhtml/events.xml Code: <?xml version="1.0"?> ...


Only top voted, non community-wiki answers of a minimum length are eligible