I am trying to get my head around csp after upgrading Magento to 2.4.7. Prior to this, it was disabled. I have installed a custom module successfully and added a csp_whitelist.xml file with the following: <?xml version="1.0"?> <csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd"> <policies> <policy id="font-src"> <values> <value id="cloudflare" type="host">*.cloudflare.com</value> <value id="twitter.com" type="host">*.twitter.com</value> […]
Magento1
I have a plugin/interceptor hooking into a Vendor webhook function. This vendor webhook handler has an MagentoSalesModelOrder model where they add comments through the addStatusHistoryComment function. When my plugin function is called, I then call $order->getStatusHistoryCollection(true), to receive the comments. However the comments that are added by the Vendor webhook […]
I have a custom collection for ordered products for a customer. $connection = $this->resourceConnection->getConnection(MagentoFrameworkAppResourceConnection::DEFAULT_CONNECTION); $customerSession = $this->customerSession->create(); if ($customerSession->isLoggedIn()) { $customerId = $customerSession->getId(); $result1 = $connection->fetchAll('SELECT distinct(product_id) FROM `sales_order_item` as soi INNER join sales_order as so on so.entity_id=soi.order_id WHERE so.customer_id = ' . $customerId); if (empty($result1)) { $this->messageManager->addWarningMessage(__("You don't have […]
I’m working on a Magento 2 project where I need to display custom reports under the order grid on the Sales Orders page. Specifically, I want to show the following fields: Total (totals sum) Subtotal (subtotals sum) Shipping (shipping sum) VAT (VAT sum) Quantity (quantities sum) Number of Orders Number […]
I am including a variable email in my template. But it does not format to be clicked and open in the recipients email app (specifically gmail). I have figured out how to do this with a hardcoded email, but not a variable formatted email. Looking for assistance in how to […]
I have around ~10k of products to create programmatically. I also have around 20 custom attributes. Saving the stock, the price, special price, those 20 custom attributes it takes around < 50 min. Once I added the image part, from 50 mins its jumps to 8 hours. The images are […]
when admin filters orders in sales->orders page. Reports should be displayed for following fields (under the order grid): Total (totals sum) Subtotal (subtotals sum) Shipping (shippings sum) VAT (Vat sum) Quantity (quantities sum) Number of Orders Number of Canceled Orders Please fell free to ask if you have additional questions.
Via the api, multi select options were accidentally inserted as duplicates. So instead of 11111,22222 being stored in catalog_product_entity_text.value it was submitted as 11111,22222,11111,22222 and stored as such. This causes the indexer to break with duplicate errors. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '681306-12156-1-7638991-681306' for key 'PRIMARY', query was: […]