Questions tagged [quoteitem]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

How to show the cart products in email template - Magento 2.3.4

How to show the cart products in the email template i can't loop into email template, and i can't pass the products into email template, I want send mail with the current cart products so I'am working ...
0
votes
2answers
29 views

Get Quote_item table data

How can I fetch the data in the quote_item table for a specific item ? I'm trying to get the product name with "gift" at the end.
0
votes
0answers
23 views

getItemById not returning the correct data

I'm trying to get the quote_item table attribute 'name' of my product inside my cart view. So I extended the default block used for the cart template and modified the template accordingly. But when I ...
1
vote
2answers
33 views

Can't copy data from quote_item to sales_order_item

I have a custom value (In a Magento 2.3.3 installation )that gets added to the quote_item table when I add an item to the basket. When I go to checkout I want to pass that value to the same-named ...
0
votes
0answers
18 views

Mqagento2 - Custom price not copying to newly created quote after order gets cancelled

I have a hiring site on Magento2.3.3 that offers multiple prices depending on how long an item is hired for. When the item gets added to the basket the price is recalculated. The totals are then ...
1
vote
1answer
19 views

Fetching Quote Items of Inactive Cart (Abandoned cart)

I am trying to fetch all the items of a Quote. First i am load the quote using \Magento\Quote\Api\CartRepositoryInterface with get() method i am getting Magento\Quote\Api\Data\CartInterface using ...
1
vote
0answers
16 views

quoteCartRepositoryV1 serach by nested field

I would apply searchCriteria to /V1/carts/search in order to get all carts which contain specific sku. I've performed this query https://shop.dicanio.it/rest/all/V1/carts/search?[filterGroups][0][...
0
votes
1answer
32 views

Unable to get cart item when FPC is enabled Magento 2.3.2

I'm trying to get all cart items in a custom block but unable to get all items, it's throwing an error: Fatal error: Uncaught Error: Call to a member function getAllItems() on null in Block ...
0
votes
1answer
26 views

Magento 2 - Get all options from a quote item

I need to get all the configurable items related to an item in the cart. For example, if the cart item is of a size "XL", then I need to get all the other options like "S", "M" and "L" together with ...
1
vote
0answers
20 views

What is replacement of this function for converting order item to quote item

As magento/module-checkout/Model/Cart class is deprecated /** * Shopping cart model * * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @deprecated 100.1.0 Use \Magento\Quote\Model\...
0
votes
1answer
66 views

How to get is_active column value from quote table ? Magento2

I want to get the value of the is_active column through the method $this-> getQuoteCollection ($customerId) -> getLastItem (), I used getColumnValues('is_active'), but it doesn't return the last ...
0
votes
2answers
68 views

Magetno 2: update custom column values for quote item during add to cart

I am calling ajax request and performing add to cart functionality. Here is my controller code, use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\...
0
votes
1answer
15 views

Magento 2: How to decrements item qty?

I want to decrements item qty programmatically. $item = $this->cart->getQuote()->getItemById($itemId); $qty = $item->getQty(); if($qty > 0) { $newqty = ($qty - 1); ...
0
votes
0answers
561 views

Magento 2 Add extension attributes in Quote Item

I want to add custom attribute in quote items Magento\Quote\Api\Data\CartItemExtensionInterface <extension_attributes for="Magento\Quote\Api\Data\CartItemExtensionInterface"> <attribute ...
0
votes
2answers
323 views

Magento 2 Unable to set custom Price in cart item by API

I'm trying to add an item by API.every thing are working except item price It's Magento Bug that not take price from API https://devdocs.magento.com/redoc/2.3/admin-rest-api.html#operation/...
0
votes
2answers
317 views

Item not deleting from quote in Magento2

I have used observer to delete the quote item. Used this event controller_action_predispatch_checkout_index_index This is the code of my etc/events.xml. <event name="...
2
votes
1answer
90 views

How to get product price from \Magento\Quote\Model\Cart\Totals\Item $item

I need to get the product price from \Magento\Quote\Model\Cart\Totals\Item $item. I tried this but it doesn't work /** @var \Magento\Quote\Model\Cart\Totals\Item $item */ $item->getProduct()-&...
0
votes
0answers
33 views

Get custom attribute from product in ToOrderItem convert method

I'm implementing a plugin for Magento\Quote\Model\Quote\Item\ToOrderItem public function aroundConvert(\Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \...
0
votes
2answers
239 views

Get data from Quote_items table in Magento 2

I am new to Magento 2 so I do not understand much about select data from the table in Localhost also which file I need to create I want to display data from Quote_item table in the .phtml file, and ...
2
votes
0answers
26 views

Why cart ID is null even though i can see the id from \Magento\Checkout\Helper\Cart

I am trying to get the cart value, i can get the quote id when i do x-debug. if i try to get the id i get NULL Anyone know why i get this
2
votes
3answers
81 views

Display data from Quote_item error

I have tried to display the data from Quote_item table in the database to file .phtml but it shows this error the code in Magento/MyHistory/Block/View.php <?php namespace Magento\History\Block;...
5
votes
2answers
482 views

How to Delete Quote item Based on the condition in magento 2

I have requirement like below. I need to read all quote items and their sku, against the custom table, If value matched, need to delete that quote item and update qty 1 for remaining items but this ...
0
votes
1answer
662 views

How to update custom column value in quote_item table magento 2

Actually i created custom column in quote_item and trying to update the value once product added to the cart programmatically magento2 custom module using Model. If Anyone have idea please ...
0
votes
1answer
74 views

Update all quote items with qty 1 in magento2

I am trying to update all the quote item qty as soon as we navigated to the cart page. by using below code. $quote = $this->checkoutSession->getQuote(); $quoteItems = $quote->...
1
vote
0answers
81 views

Why V1/guest-carts/{cart-Id}/ PUT api is not move guest cart item to customer cart in magento-2.2.7?

I want to move guest cart item into customer cart by using this [PUT] /V1/guest-carts/{cart-Id}/ . But it give {"message": "Cannot assign customer to the given cart. You don't have permission for ...
0
votes
1answer
190 views

Quote Item level manual Discount - Magento 2

I need to give Quote Item level manual Discount for selected cart items. After giving discount Cart Item row total will change. As can't modify the product price so custom price solution is also not ...
0
votes
1answer
13 views

How can I get all data from cart

Is it possible to get check if cart has any product been added in. I want to check if a product been added to the cart in a phtml page. If the user click the page I want to show how many product they ...
0
votes
1answer
44 views

How to get quote details in helper

I want to see if there is anything exists in the cart if I am in a phtml page I have tried to use session and cart but I am getting null When I tried to use session I wasn’t sure how to get the ...
1
vote
3answers
173 views

Magento 2 get custom product attribute

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->get('Magento\Catalog\Model\Product')->load('YOUR PRODUCT ID'); echo $product->getAttributeText(...
1
vote
1answer
252 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
34 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
432 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
15 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
38 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
468 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
1answer
130 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
408 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
195 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
2answers
369 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
634 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 ...
4
votes
1answer
245 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
546 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
1answer
227 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
116 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 ...
2
votes
2answers
482 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
46 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
2k 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
85 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
1k 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 = $...
2
votes
2answers
2k 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-&...