New answers tagged

0

To get order details <h1 class="greeting">{{trans "Hello %name," name=$order.getCustomerFirstname()}}</h1>


0

Dont think you need to create a source class for simple yes/no. You can use Magento\Config\Model\Config\Source\Yesno <column name="is_prebook" component="Magento_Ui/js/grid/columns/select" sortOrder="80"> <settings> <addField>true</addField> <options class="Magento\Config\Model\...


0

try { $orderId = preg_replace('/000+/','',$this->getRequest()->getPost('order_id')); $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $order = $objectManager->create('\Magento\Sales\Model\OrderRepository')->get($orderId); if(...


0

I developed a simple code and it works well, please take a look: <!-- language: lang-php--> <?php declare(strict_types=1); namespace Vendor\Module\Model; use Magento\Quote\Api\CartManagementInterface; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Psr\Log\LoggerInterface; class ...


0

You can follow magento reorder functionality. E.g: vendor/magento/module-sales/Controller/AbstractController/Reorder.php The following line will create new quote: $reorderOutput = $this->reorder->execute($order->getIncrementId(), $order->getStoreId()); You can open vendor/magento/module-sales/Model/Reorder/Reorder.php, where you can found more ...


1

Add following code outside of try...catch block $returnValue = null; Your code looks like: <?php namespace StripeIntegration\Payments\Plugin\Sales\Model\Service; class OrderService { public function __construct( \StripeIntegration\Payments\Helper\Rollback $rollback, \StripeIntegration\Payments\Helper\GenericFactory $helperFactory ...


0

You need to set your custom data in transport data object, for that you can use below observer app\code\Vendor\Module\etc\events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name=&...


0

First, you need to create “events.xml” file inside your extension folder. app\code\Mital\EmailSubjectItems\etc\events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="...


Top 50 recent answers are included