New answers tagged

0

in variable $sales_la_order_address_ship set HTML output that you want to display in email instead of array.


0

Update change the events.xml area from global to webapi_rest use app/code/Nadine/Campaign/etc/webapi_rest/events.xml instead of app/code/Nadine/Campaign/etc/events.xml It will work Better observe the event checkout_onepage_controller_success_action, in case if you want to observe the store front order placement and use one page checkout <?xml version=&...


0

Try This sales_email_order_shipment_renderers.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <...


0

I would suggest you take the customer ID from session. In the same observer class, inject Magento\Customer\Model\Session into the constructor and save it in a private property, say $session and use it like this: $this->session->getCustomerId() Sidenotes you don't need to initialize the order object in the constructor in your above code your observer'...


0

The best (optimized) way to get order id i.e sales_order.increment_id from entity id by creating a custom DB query in Magento2. Create a GetIncrementIdByOrderId class: <?php declare(strict_types =1); namespace Adapttive\SalesOrder\Model\Order; use Exception; use Magento\Sales\Model\ResourceModel\Order as OrderResource; /** * Class ...


0

The best (optimized) way to get order id i.e sales_order.entity_id from increment id by creating a custom DB query in Magento2. Create a GetOrderIdByIncrementId class: <?php declare(strict_types =1); namespace Adapttive\SalesOrder\Model\Order; use Exception; use Magento\Sales\Model\ResourceModel\Order as OrderResource; /** * Class ...


0

you can use below code to get all configurable product options from order $opts=array(); $items = $order->getAllVisibleItems(); foreach ($items as $item) { $options = $item->getProductOptions(); if (isset($options['attributes_info']) && !empty($options['attributes_info'])) { ...


0

$logger->info(json_encode($orderData)); You should encode to JSON the objects or arrays.


0

try:- $date = $this->_localeDate->date(new \DateTime($yourDate))->format('Y/m/d H:i:s');


0

addStatusHistoryComment is deprecated, use addCommentToStatusHistory instead. Here is the sample code: protected $orderRepository; public function __construct( ... \Magento\Sales\Model\OrderRepository $orderRepository ... ) { $this->orderRepository = $orderRepository; } public function saveOrder($orderId) { $order = $this->...


0

Create a basic module and put this in the di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\DB\Sequence\SequenceInterface"> <...


Top 50 recent answers are included