Questions tagged [quote]

Denotes questions related to the quote on Magento (creation, management, modification, relations)

Filter by
Sorted by
Tagged with
44
votes
5answers
112k views

How to get all items in cart currently?

I want to get a collection of all the items in cart currently. How can I do this ? Any suggestions will be appreciated.
2
votes
1answer
386 views

How to create duplicate new quote from old order quote Magento 1.7?

I want to create a new order programmatically by copying an existing order's quote. Here is what I have tried: <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); ...
47
votes
7answers
17k views

Price re-index causes DB deadlocks during checkout

I'm experiencing an issue where I believe the Product Price re-indexing process is causing a deadlock exception in the checkout process. I caught this exception in the checkout process: Order ...
1
vote
2answers
4k views

How to copy one quote (only cart items) to other quote (only items )

i want to copy one quote (only cart items) to other quote (only items ). Only want to copy cart products to other new quote. Suppose: i have old quote,which id is 5,have 4 items i have another ...
11
votes
4answers
23k views

Watching Add to Cart Event - quote item id is empty

I am trying to catch the event that fires once an item is added to the cart. I'm currently watching the following event: checkout_cart_product_add_after According to magento source this event is ...
15
votes
3answers
9k views

Copy custom data from quote to order and order item once order is placed in magento2

I am building a custom module in magento 2 that have a custom discount. I am trying to copy the discount from quote, quote item to order and order item. In magento 1, I declare in config.xml like this:...
9
votes
2answers
10k views

Magento 2 : Updating quote item

I am trying to update quote item in magento2. But every time i am saving the item its creating a new item with the same quote id rather than updating it. Here is my code public function ...
4
votes
2answers
10k views

Get all abandoned carts in Magento

How could I get all the abandoned carts with customer's email (programatically)? What does Magento consider as being abandoned? Not updated in the last day?
3
votes
1answer
3k views

How to get quote object through customer id in magento2?

When customer login through customer id i have to get quote object. In magento i have written this code.but in magento2 how to get quote collection.or quote id of that customer. $quoteCollection = ...
1
vote
2answers
7k views

Programmatically add items to cart and assign to guest user

I got the code working for creating quote object and quote item object, and I'm able to create quote successfully which I could confirm it by checking the database, I also created cookie named front-...
10
votes
1answer
7k views

Custom Convert Quote to Order - “Cannot retrieve payment method instance”

I have seen on occasion the case where an order is placed, an authorization is made for payment on the customer card, the customer receives an order confirmation email - but no order exists in Magento'...
2
votes
1answer
6k views

How quotes work in Magento

I am not sure how quotes work in Magento. I saw that a quote id is assigned to customer when is created. Sometimes I see in sales_flat_quote table that for one customer there are 2 lines there...I ...
3
votes
1answer
269 views

Magento2 : add New address type to customer

I want to Create a new address type "neighbors address / alternate address " . To assign it to customer i have created new customer attribute ( just like "default_shipping" and "default_billing" ) "...
7
votes
2answers
4k views

Update custom column data in quote table Magento 2

I inserted a custom column in quote table like this: if (version_compare($context->getVersion(), '1.0.1', '<')) { $setup->getConnection()->addColumn( $setup->...
4
votes
1answer
5k views

Add a column to quote item table

I want to add a column to the sales_flat_quote_item (and ..._order_item) table through an install script, but when I go to the table sales_flat_quote_item (or ..._order_item) in my database - the ...
5
votes
1answer
1k views

Adding products to cart programmatically with custom price in controller: Magento 2

I am having a module that is creating quotes using the Magento quote module. It is using the \Magento\Quote\Model\QuoteFactory for creating the quotes. Now I have added a button "Proceed to ...
5
votes
4answers
2k views

Issue with quote (wrong items_count): not possible to delete products

For some of the products I got the following error while trying to delete them using the backend: SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '([DB].q....
3
votes
2answers
322 views

Create new row in Database when we click on button

By Default Magento create new row in Database in table sales_flat_quote_item_option once we click on ADD TO CART We are giving an option of uploading custom image on Product image with help of ...
3
votes
1answer
143 views

Overriding Quote Item Weight Programatically

My goal is to alter the weight of a product based on a chosen custom option. I have the custom option part working, but am unable to alter the weight of the item is such a way that affects the ...
1
vote
1answer
5k views

Magento 2 : How to Update cart after cart update event (checkout_cart_update_items_after)

I am trying tho again update cart after update cart action(when cart qty is updated from cart page Or from miniCart) and change the qty if some cases $mappedProductSkus= $this->_helperData->...
1
vote
1answer
4k views

Programmatically create admin order with pre-populated basket & customer

I'm working on a quote system where I want the admin to be able to activate it, which will then forward them to the create new order page in Adminhtml, sales_order_create. I want this page to already ...
3
votes
1answer
4k views

how to get refreshed shipping address in quote object in js - Magento2.2

I am using this one code but once i update shipping info not getting refreshed info they retrieve old info how can i achieve that? require([ 'jquery', 'Magento_Checkout/js/model/quote', ...
7
votes
2answers
375 views

Disable cart sharing between different Stores of website in Magento 2?

My website is with Three different Stores and I'd like to disable the cart sharing feature between stores. So when I switch from one store to the other store, the product in my cart shouldn't be valid ...
16
votes
5answers
9k views

How to check if billing and shipping address are equal?

I'm trying to check if billing and shipping address are equal when creating invoice PDFs. What I've tried so far was: $order = $invoice->getOrder(); if( $order->getBillingAddress()->getData(...
9
votes
2answers
17k views

Magento 2 : How to load quote by quote id

How can I load quote in magento 2 by quote id ?
9
votes
2answers
1k views

merge guest quote with customer quote(if custommer log in) magento 2 rest api

if 2 items in cart if customer login both item should need to add cart , Both quote (before login & after login) merge and create final quote which contain all item of customer quote Refference ...
5
votes
1answer
2k views

Tier price when adding product to basket - where is it calculated?

When adding a product to the basket, where exactly is the price that appears in the quote for each item calculated? (base, special, tier...) My issue is this: I have a simple product with a tier ...
2
votes
1answer
3k views

Create Mage_Sales_Model_Quote from order

I want to create a quote from an existing order and remove some qtys and re apply the discounts. We need to work out the value of an order where we may cancel some of the items but not all. I thought ...
6
votes
2answers
4k views

Same customer places duplicate order

I've observed a strange behavior whereby a customer managed to place three orders in quick succession which had the same order numbers. Each order was based on the same quote_id which in turn ...
4
votes
1answer
3k views

Magento: Quote vs Cart

I want to add dynamically new products in the cart during the checkout process, but I've no clear the differences between the Quote and the Cart. In my catalog pages I'm adding contents directly to ...
4
votes
4answers
5k views

Get quote item collection by using quote item id in Magento 2

I get the quote_item_id like this: $orderItems = $order->getAllItems(); foreach($orderItems as $orderItem){ $qouteItemId = $orderItem->getQuoteItemId(); } I need to load quote item ...
3
votes
2answers
7k views

Is it possible to get the QuoteId that was used once an OrderId has been created

I'm tracking customer movements through the order process by using their QuoteId Mage::helper('checkout/cart')->getQuote() - which is created as soon as a customer ads a product to the cart, ...
3
votes
1answer
9k views

Check if coupon is valid for a quote

I need to programitcally re order an Item. I have achieved this by Cancel the current order Get the cancelled order quote Ammend the Qtys Recalulate the shipping This is all fine... now I need to ...
2
votes
1answer
4k views

Magento 2 Rest API - How to add custom option to Cart Item?

I am using Magento 2 default quoteCartItem restful APIs to add, delete and update items in cart. Things are working as expected. GET /V1/carts/{cartId}/items POST /V1/carts/{cartId}/items DELETE /V1/...
2
votes
3answers
2k views

Disable checkout button in cart

I have added an error in the sales_quote_save_before event, if the quantity of items is more than 500. > Mage::getSingleton('checkout/session')->addError(Mage::helper('checkout')->__('The ...
1
vote
1answer
840 views

Set only last added product in the quote

In my website i have bounded the user to only add one product into the cart , however from the session quote object it loads multiple products. How can i restrict quote object to show only last added ...
1
vote
1answer
47 views

What does “setIsSuperMode” do on Quote Object in Magento 2?

I am creating a Quote programmatically, I have found a field IsSuperMode on Quote object. What effect does it have on the Quote ? Class: /Magento/Backend/Model/Session/Quote.php https://github.com/...
-1
votes
1answer
4k views

How to set customer id for a quote in Magento?

I added a product into the cart and tried to map customer id, email to that quote using the code below $product_id = 123; $qty = 1; $product = Mage::getModel('catalog/product')->load($...
5
votes
1answer
1k views

Customer stuck in an endless loop

Problem: Some Customer (< 0.5%) got stuck in an endless loop if they visit our Shop (v1.9.2.4) or add a Product to cart. If the Customer delete the Cookies, everything works fine. Because I can't ...
4
votes
2answers
5k views

How to create quote and order programmatically in Magento2

I try to create an order programmatically in magento2 using this code snippet found on webkul.com this is the order that i want to create: $tempOrder=[      'currency_id'=> 'USD',      'email'=&...
4
votes
0answers
600 views

Magento-2 : How to update cart total on check-box checked/unchecked

Magento2 - in checkout page, I have one check-box just before the payment method on the checkout payment step. I need to update cart total on check-box check/unchecked. Currently system is working ...
3
votes
1answer
915 views

Magento 2.1.8 Api merge the guest items to customer quote?

I would like to implement am Magento 2 REST api i.e if the customer login then we have to merge the guest items to customer quote. As per the requirement i found one file in the respected path ...
3
votes
1answer
7k views

How to save quote items in magento 2

How to save quote items in Magento 2? I have quote id. I'm able to store quote table data but I want to store products name, sku which is going in quote_item table. I am able to set Data in quote ...
2
votes
1answer
1k views

$quote->setHasErrors(true); not working

I am using code from here to add an observer, get qty available from external source, and then set error true/false. I have the observer set up correctly. I know this as it is doing everything I need ...
2
votes
1answer
759 views

Why is my product's custom attribute not available during this event?

I have a product with a custom attribute, which works fine almost everywhere I use it. However, when I try to get this attribute's value during the catalog_product_get_final_price event, I get null ...
1
vote
2answers
377 views

Quote/QuoteItem addErrorInfo is not persistent

On Magento 1, I'm having an issue where the quote and quote item error messages is not persistent. $item->addErrorInfo('cataloginventory', Mage_CatalogInventory_Helper_Data::ERROR_QTY, $message); ...
1
vote
1answer
2k views

magento2 get quote Id from customer [duplicate]

How to get quote Id from quote table via Customer Id or email. I have Customer id & email & i want to check if quote id exist or not how to do that via create new module or programming What ...
1
vote
1answer
548 views

How to manually convert a series of quotes to invoices (orders)

For about 24 hours yesterday we were experiencing an issue where Magento could not create new invoices. It has since been resolved but I now have a series of orders (22) that are trapped in the ...
1
vote
1answer
646 views

How to set a custom free shipping amount for each quote?

I need to set a custom free-shipping threshold(in config this is carriers/freeshipping/free_shipping_subtotal and can be set in the back-end) for each quote subtotal. So to quotes above this subtotal ...
1
vote
2answers
2k views

Magento 2: Change quote from current quote to other quote id

Please let me know how can I change my current quote to any other quote saved in database using an event observer in magento 2.2