Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [quoteitem]

The tag has no usage guidance.

0
votes
1answer
17 views

How to delete cart Item by SKU or productId in magento 2

I have retrieving all cart items and deleting the quote item by match with the product Sku, Here is my code. protected $checkoutSession; protected $_itemModel; protected $cart; public function ...
2
votes
0answers
20 views

Add css class to item on checkout xml

how can i add a css class eg.: class="myClass" to an item on checkout xml? for example <item name="after-place-agreements" xsi:type="array"> <item name="component" xsi:type="string">...
0
votes
2answers
26 views

Get Quote Item from Product Id

I am trying to get the Lastly added Quote Item using "checkout/session". By I don't know, how to get the last added Item. Hence I have product_id. I believe instead of loading the collection and all,...
0
votes
0answers
12 views

Edit quote qty but price incorrect for mutiple products

I would like to update quote from a order. When I update qty of a item from quotes it make correct subtotal and tax. However, when I update great than 2 items then subtotal and tax get last data ...
0
votes
0answers
26 views

Magento 2 - Add new quote item when quantity changed to > 1

I wanted to add new quote item (new row on cart page) when the product quantity is more than 1. I already tried accepted answer provided here. Whenever I tried to add existing cart item from 'product-...
0
votes
1answer
41 views

Fatal Error: 'Uncaught Error: Call to a member function setCustomPrice() on boolean magento 2.3

Here i am trying to add product to the cart using customerId and productId without customer logged in, it's working fine but its not adding custom Price to that product,please guide me if you have ...
0
votes
0answers
26 views

How to add product to the cart with customer id and product id magento 2.3?

Actually while adding product to the cart with product id and customer id, i am facing one error "We found an invalid request for adding product to quote." If anyone have any idea please guide me. &...
1
vote
1answer
33 views

Magento 2: How to set item Row total?

I want to set a custom row total. I am using 'checkout_cart_product_add_after' event. And want to update Row total. I going to add an extra amount in an item row total. like, $item->setRowTotal($...
0
votes
2answers
27 views

How to get value from sales_flat_order_item table using quote_item_id?

Using the sales_order_place_after event in my custom Observer. I have the quote_item_id value (example 324). How to get the corresponding item_id value from the sales_flat_order_item table? I am ...
0
votes
1answer
32 views

Magnto 2 update the cart custom option value

Currently am using magento 2.2.5, while adding the product to the cart the custom options values are stored in the quote_item_option table correctly. while updating the custom options ...
4
votes
1answer
194 views

Update quote item price without using custom price

We are developing a custom module which applies custom tier prices by product category. Our solution works on frontend checkout so far and consists of observing the sales_quote_item_set_product event ...
0
votes
1answer
32 views

Magento2 - How to lock customer cart?

I have added product to customer cart programmatically with custom prices as quatation. Now customer should not add,remove or update cart items as it is fixed quatation. How can i achieve this?
3
votes
1answer
55 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
2answers
93 views

Magento 2: save item options in quote(quote_item_option)

I need to add new option for item. Now in quote_item_option i have: {"id":"54","product":"54","selected_configurable_option":"","related_product":"","options":{"4":""},"qty":"1"} But wanna {"id":"...
0
votes
0answers
13 views

Apply different shipping methods to each item in cart and get total shipping amount in magento 2

I am facing problem in applying different shipping methods to each item in the cart and then getting total shipping amount for the quote in Magento 2. Can anyone help me with this? Any help would be ...
0
votes
1answer
47 views

Programmatically creating an order: How to add custom options to products in quote?

I'm trying to create an order programmatically. With simple products without custom options it already works like a charm. But when I try to add custom options I get the very specific error: We ...
0
votes
0answers
42 views

How to update product quantity in cart by custom field

I added some custom field(receipent_email) in quote_item table. When user adding item in cart, I m sending custom data to cart item. Data is saving in quote_item table perfectly. Also i split item ...
3
votes
2answers
120 views

getItemById($itemId) for Magento Quote Model not working as expected in Magento 2

Here is my code, where I'm calling Quote model file and getItemById function. public function __construct( \Magento\Quote\Model\Quote $quote ) { $this->quote = $quote; } ...
0
votes
1answer
28 views

Magento2: I want to get customer cart item collection without customer login

How to get customer cart item collection without customer login? I want to also get cart item through item id. Got the null value <?php namespace vendor\module_name\Block\Index; class ...
0
votes
3answers
442 views

Magento2: How to get quote item through item id?

I want to get quote item through the item id on the guest page. Got the null value <?php namespace Codism\Csr\Block\Index; class Approveitem extends \Magento\Framework\View\Element\Template { ...
0
votes
2answers
57 views

Get orderId from quote_item

I have an instance of \Magento\Quote\Model\Quote\Item $item I need to get the order ID of the order in which that particular item has been purchased. For full disclosure, I am using a plugin ...
0
votes
1answer
308 views

How to set additional data to quote_item table from controller in Magento 2?

I have a controller with following code $data = $this->getRequest()->getPostValue(); $item_id = $data['item_id']; $additionalOptions = $data['additional_options']; $itemFactory = $...
0
votes
0answers
81 views

Magento2: Issue in saving custom option to quote

I am saving custom options to the quote programmatically. But custom options are not visible in the backend. On debugging I found that in quote_item _option table rows are missing, entry corresponding ...
1
vote
2answers
1k views

Magento 2 Custom remove item from cart button

I am trying to create a custom button to remove items from the shopping cart. I've tried the following code <a href="<?php echo $this->getUrl('checkout/cart/delete', array('id' => $this-&...
1
vote
1answer
101 views

Magento 2, how to get list of product by item_id?

Using Magento 2.2, REST API. What URI of api for get list of product by item_id? This below get all item without defined item_id GET /index.php/rest/V1/carts/mine/items HTTP/1.1 Content-Type: ...
1
vote
1answer
219 views

get Quote Item ID from event checkout_cart_product_add_after not working

I'm adding product to cart programatically in magento 2 $this->cart->addProduct($product, ['product' => $product->getId(), 'qty' => '1']); I want to get quote item_id using event ...
2
votes
4answers
3k 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 ...
0
votes
1answer
465 views

How to load a quote item via it's id?

Is there a way to load a quote_item directly using current Magento coding standards? Right now I'm loading the cart and then finding the quote item like so: $cart_id = $this->getRequest()->...
0
votes
1answer
270 views

Removing items from quote depending on custom condition

I am trying to use sales_quote_item_collection_products_after_load to remove items from a quote depending on a custom condition. public function filterQuote(Varien_Event_Observer $observer) { /** @...
1
vote
2answers
509 views

Magento2 - duplicate quote item to new row and new price

Is it possible to add the same product (with same configurable options) with different price based on some custom values present in the product page to the shopping cart, but have it appear as ...
1
vote
2answers
821 views

How to clear item in cart in frontend web page programmatically?

Using magento 2.2, I need to remove all items in current cart while going to other root category on my front page. I want some advice for coding this event.
2
votes
1answer
26 views

Product is missing Attibute Text property

I have the following in my custom module: $product = $quote_item->getProduct(); If I then do this I see the product id: var_dump($product->getId()); This though gives me null: var_dump($...
0
votes
0answers
197 views

Magento 2 - Save value from custom input field to quote_item

I have created an extra field Delivery in quote_item, I have also created a input field that customers can type in the delivery date they wished, on product page. How can I save the value from this ...
2
votes
1answer
486 views

M2: Wrong totals, if I change item customPrice after quote->collectTotals()

For example. There is 1 product in the cart with base price 35. Working code: foreach ($this->cart->getQuote()->getAllVisibleItems() as $item) { $item->setCustomPrice(11.11) -&...
1
vote
1answer
293 views

Magento 2 - Disable cash on delivery based on cod

How to disable cash on delivery payment based on cod availability. etc/di.xml <type name="Magento\OfflinePayments\Model\Cashondelivery"> <plugin name="cashondeliveryplugin" type="...
1
vote
1answer
369 views

How can I get a selected child product of a specific option of a bundle quote item?

I have $quoteItem (Magento\Quote\Model\QuoteItem) which represents a bundle product. The order options are fetched via $typeInstance = $quoteItem->getProduct()->getTypeInstance(); $this->...
1
vote
1answer
1k views

Programmatically updating quote items in magneto2

**I'm trying to update quote programmatically. In controller file: public function execute() { $id = 298; $params['id'] = 298; $params['product'] = 6765; $params['...
0
votes
1answer
327 views

Magento 1.9 : Programmatically created cart not showing on frontend

I have below code to create cart and addProduct : $quote = Mage::getModel('sales/quote')->setStoreId(1); $quote->assignCustomer($customer); $product = Mage::getModel('catalog/product')->...
0
votes
1answer
976 views

Get quantity in stock for items added in cart in JS

I need the quantity available for each product in cart in my custom javascript file. Does anyone know how to do this?
1
vote
1answer
372 views

Sort quote items in Magento2

In Magento2, how to sort Quote Items? The code I have is her: <?php require __DIR__ . '/app/bootstrap.php'; use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Api\SortOrder; ...
2
votes
0answers
327 views

Add a quote instance to cart: Magento 2

I am working on a custom module that is creating quotes using the Magento quote module. It is using the \Magento\Quote\Model\QuoteFactory for creating the quotes. Now I want to checkout the items ...
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 ...
0
votes
1answer
651 views

How to get the order items and quote items whenever create order from admin panel?

I would like to get the items that added via admin panel in the order page. I have created the observer to listen to Create New Order button event like this : public function execute(Observer $...
2
votes
1answer
2k views

get total item price in order Magento 2

I want to get total item price from order item, including it's tax and any other additional price. Currently i got total price of an order item in like this: $qty = $_item->getQtyOrdered(); $...
2
votes
2answers
2k views

Get item collection by sku Magento 2

I try to fetch quote item collection and add some filter like this: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of Object Manager $newItem = $objectManager->...
3
votes
0answers
280 views

Magento 2 item data is gone after update custom option value

i have an additional data in my item cart which can be seen with $item->getData(): [item_id] => 319 [quote_id] => 122 [created_at] => 2017-09-29 02:35:42 [updated_at] => 0000-00-00 00:00:...
3
votes
1answer
313 views

Getting data from quote items collection issue in M1

This is my collection: $collection = Mage::getModel('checkout/cart')->getQuote()->getItemsCollection() ->addFieldToFilter('product_type', ['eq' => 'bundle']); $...
1
vote
1answer
4k views

Adding custom attribute to quote item

I want to add custom attribute to quote item called item_delete for example. This attribute it's to know if a a item can or can not be deleted from cart. I've already created an extension_attributes....
0
votes
1answer
219 views

Magento 2 : Get image file from custom_option folder

I have a custom option of type file where I am allowing user to upload photo while adding a product to cart. I am using the REST api to get the cart items. Below is the response for the same. [ {...
0
votes
1answer
671 views

Magento 2: How to add attribute flag to quote item?

I want to add an attribute to quote item to know if an item can be deleted or not from a cart. Any help?