Working with Magento Projects & development, we always get some challenging work or task which we really love to solve. Store owners need to work hard and face real-time issue for delivering better service & use experience to their customers. One of our customers came up with the challenge to copy one quote to another programmatically in Magento 2. To save their time & efforts, we have developed a small piece of code that will help to copy one cart product items to another quote (cart items).

Generally, if you are trying to implement this code manually, it creates a problem while copying cart from the new users. But with our code, you don’t need to worry about session, Even after a user is visiting a website for a very first time, this code will definitely work with an empty cart.

All you need to do is to paste below code and it will automatically copy one quote with all product items into another.

Tadda! It’s copied! Now you can use or customize this code according to your need of copying one quote to another one in your Magento store. If you have any questions or suggestions, always feel free to drop a line in the comment section below!
Happy Coding!

Click to rate this post!
[Total: 9 Average: 2.9]