This might be helpful for you:
class Products extends \Magento\Framework\View\Element\Template
public function __construct(
You can get the order collection using this one :
public function __construct(\Magento\Sales\Model\ResourceModel\Order\CollectionFactory $order, \Magento\Sales\Model\OrderRepository $orderRepository)
$this->_order = $order;
$this->orderRepository = $orderRepository;
public function ...
After some trying around I solved it by using the following SQL qeuery:
UPDATE sales_order as SFO
INNER JOIN customer_entity as C
ON C.email = SFO.customer_email
SET SFO.customer_ID = C.entity_id
WHERE SFO.customer_is_guest = 0
Magento 2 how to change order increment id?
Have a look at this answer hope this helps.
accept answer if helps
Open phpmyadmin and Open sequence_order_1 Table
Go to the Operations tab of the sequence_order_1 table, and find the field called AUTO_INCREMENT in the "Table options" box.
Use plugin around the parent Magento\Sales\Block\Adminhtml\Order\Create\Data blocks getChildHtml method. Within the plugin I then check the name of the block being rendered and inject my new block where appropriate. E.g
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Will give you clues how to create it:
First you need to create guest quote:
$quoteId = $this->cartManagementInterface->createEmptyCart();
$quote = $this->cartRepositoryInterface->get($quoteId);
Then add product:
I have successfully extended that using XML file.
These are the files which i have used to extend that in my custom module.
File Path are you package path then view/adminhtml/layout/adminhtml_order_shipment_new.xml
adminhtml_order_shipment_new , adminhtml_order_shipment_view , sales_order_creditmemo_new , sales_order_creditmemo_view , ...
After a complete error testing I found as part of an answer on a different stackexchange question.
The problem with this is that ...