How to Get Current Quote Id by Checkout Session Magento 2?

To Retrieve the current quote ID from the cart checkout page, You need to use a checkout session to fetch all the information related to quote data.

Use Magento\Checkout\Model\Session to inject the object using the class __construct() method. While you working with the checkout page and need to fetch quote data by current quote id, in this case, this article is useful for you.

The checkout session contains the quote data and using session fetch getQuote(), based on the quote, you can get any quote-related data. Continue reading “How to Get Current Quote Id by Checkout Session Magento 2?”

How to add new field before shipping methods in checkout page Magento 2?

Checkout Shipping Step page, You can display the input field between shipping address and shipping methods.

Magento 2, To display the Input field before shipping methods, you need to create a checkout_index_index.xml file to set the content of the file. Continue reading “How to add new field before shipping methods in checkout page Magento 2?”

How to update customer group programmatically Magento 2?

Update Customer Group in Magento 2 by Customer id for the customer.

If you want to change existing customer groups to different customer groups for the Customer you can do it using Customer Repository interface API.

To Retrieve the Customer Object by customer id, set Group id using the setGroupId() method to the return object and save the customer object to update group id. Continue reading “How to update customer group programmatically Magento 2?”