Questions tagged [quote]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
30 views

Magento 2.3 How to get Quote Data on product detail page

i want to get this quote data on product page but that not return any data ... only return below array instead of all quote data On other page it working fine issue only on product page. array(4) { ...
0
votes
1answer
20 views

Magento which model is correct for getting the quote in the cart?

I have tried every different combo of model that returns a quote in order to try and find the one that has the quote for the current customer's cart. So far none of them work, and I can't figure out ...
2
votes
1answer
51 views

Customers Cannot checkout as guest in Magento 2.3

Several of our customers have complained that they cannot checkout as a guest. The issue seems to have started around the time we upgraded to Magento 2.3.2. I have tried to checkout as a guest ...
0
votes
1answer
19 views

Get Last Added Product ID of Cart without using checkout session

I am using RESTful APIs of Magento and I want to get the last added product id of in the cart. All of my searches are using the Checkout Session method of Magento which is $this->checkoutSession-&...
0
votes
0answers
31 views

Magento 2.2.3 How to change GrandTotal

var billingAddress = quote.billingAddress(); var billingCountryId = (billingAddress.countryId); // console.log(billingCountryId); console.log({billing: ...
0
votes
0answers
69 views

Apply discount amount on cart line items in Magento 2

I am trying to set discount amount on each cart item in the cart with some condition. I have followed like this to achieve that. Vendor/Module/etc/sales.xml <config xmlns:xsi="http://www.w3.org/...
0
votes
0answers
13 views

Quote Items are showing only if flush cache - Magento 2

I am trying to get cart quote items by the following code: File: app/code/Essence/Fcf/view/frontend/templates/packages.phtml I called this file in my cms page by following code: {{block class="...
0
votes
0answers
12 views

Change Shipping method in quote before magento validation occurs on admin order create

I am creating order from magento admin side but I want my custom method to be set in the quote before the order is submitted I have tried the following code. di.xml <preference for="Magento\...
0
votes
0answers
15 views

How can I know if reward points are used in quote

How can I know if reward points are used in current cart and also how can I remove them?
0
votes
1answer
33 views

Magento 2: Change quote base currency programmatically?

I am creating orders programmatically in Magento 2 and want to change the order base currency as well as current currency to my custom currency, irrespective to currency available in Store as I don't ...
0
votes
0answers
21 views

Magento 1 get quote id of current user

I've gone through a number of questions on here relating to retrieving the current quote for the current browsing user, but each one yields the same result: Mage::getSingleton('checkout/cart')->...
0
votes
2answers
66 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="...
0
votes
0answers
29 views

Add product point to quote, order and invoice magento 2

I have a voucher point custom attribute for each of my product. I need to keep track of this point across each quote_item, sales_order_item and sales_invoice_item (Meaning I need a voucher_pts ...
1
vote
0answers
26 views

Updated address not reflecting at Checkout in Magento 2

I have customized the Checkout, Where I split the checkout into 3 steps. Cart section. Shipping Payment. In the Shipping section, I am showing the customer address details with an edit button to ...
0
votes
0answers
23 views

Add product with customized option in the cart through API

I'm having a problem adding a product with custom options in the Magento cart 2.3.1. After defining a custom option as multiple selection, I tried to add the product to the cart with the following ...
2
votes
1answer
28 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
47 views

magento 2 remove shipping amount from cart total

I want to remove shipping amount from cart page because we do not provide estimate shipping amount calculation block. Also, when customer add product to cart then its display grand total without ...
1
vote
0answers
16 views

Selected payment method in quote not get changed to default when reload the onepagecheckout in magento 2

I am having two payment methods Online payment and COD in Magento 2. But the default one is an online payment. When I reload the page, the online payment option gets selected by default(even if I ...
0
votes
1answer
72 views

set discount amount while creating order progrmmatically in magento2

I am creating order pro-grammatically. I have referred below code https://www.rakeshjesadiya.com/how-to-create-order-programmatically-in-magento-2/ My requirement is to set discount amount for each ...
1
vote
1answer
31 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/...
2
votes
0answers
11 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
0
votes
2answers
57 views

Fatal error: Uncaught Error: Call to a member function getQuote() on null

I'm trying to get store information from Shopping cart page To do so I have created a module Following is my block file <? namespace Magento\History\Block; class ViewQuote extends \...
1
vote
0answers
26 views

How to display data from 2 tables that already have data on Magento 2.3

How to display data from two tables quote_item and sales_order_item from the database to .phtml file. Can anyone help me step by step, I am new to Magento, if someone can help me, it's very useful ...
0
votes
1answer
41 views

Magento2 : Which Magento Event for Update cart quantity only?

I have work on the task in which I need to handle quote item, here I have use two event checkout_cart_add_product_complete checkout_cart_update_item_complete here it work fine, But when I ...
1
vote
0answers
18 views

How to transform a quote into an order from CALLBACK HOOKS, MAGENTO 2.3

I'm trying to integrate a payment gateway. And they provide a callback hooks i've set for them to return me the CartID (Quote's entity_id). But from here on, it feels like it isnt right for me to ...
4
votes
0answers
35 views

Unable to add multiple Products to cart in magento2

I have used below code in my controller. use Magento\Framework\Controller\ResultFactory; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; class Addtocart extends \...
2
votes
0answers
31 views

Magento 2.3 Convert Quote from store to another store

I need to convert a quote from one store in GBP to another website store in EUR dynamically on the fly, but i can save the item with the new store_Id and the quote with the correct store_id but ...
0
votes
1answer
9 views

SetBillingAdress not working (prog) on quote

I'm creating orders programmaticaly but my billings address are not updating. I can set the shipping address that I want (another from the connected user) but the billing is still the one from the ...
5
votes
2answers
81 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
0answers
17 views

Why is guest customer billing information NULL - Magento 2 checkout and quote?

I'm trying to get guest customer billing information during the checkout session as I need to save it to the quote before redirecting to placeOrder but the billing information is always null. How do ...
0
votes
1answer
60 views

Unique constraint violation found when creating order programmatically

I've been trying to create an order programatically in Magento 2.3 and the order is created but my code dies and I get the error : "Unique constraint violation found". What do I need to add or change?...
0
votes
1answer
19 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->...
0
votes
2answers
73 views

How to adding Custom Attributes to Magento 2 Quotes and Orders

I have followed this: https://www.siphor.com/adding-custom-attributes-to-magento-2-quotes-and-orders/ It works well when creating custom attributes and adding data quote but after checkout, quote ...
0
votes
2answers
45 views

Magento 2 add to cart programmatically not working

Here am have a custom api at that API call am trying to add a product to cart but am not getting it. namespace Vendor\Cart\Model; use Magento\Framework\Data\Form\FormKey; use Vendor\Cart\Api\...
0
votes
1answer
32 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 ...
2
votes
1answer
26 views

Magento 2 - Share customers but not cart between multiple websites or stores

We have a Magento 2.2.8 multi-store setup with 3 websites. One has 2 stores which allows us to share customers between them. However I don't want to share carts between the stores (different ...
0
votes
0answers
34 views

Override PlaceOrder and change Grand Total

I am modifying the placeOrder function of the QuoteManagement class, based on some information I found through searches, I was able to change the method so that an order is generated for each seller, ...
3
votes
1answer
48 views

How to rewrite QuoteManagement in magento 2

I'm trying to extend the class "QuoteManagement", but when I try to make the payment, an error is returned. My code: di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
1
vote
1answer
22 views

Custom product option not added in quote (prog)

Hi I'm creating a quote manualy. This quote contains a virtual product (so related to a configurable product). My quote is submitted, but the options from the parent product is not added to the ...
0
votes
1answer
11 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
17 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 ...
2
votes
1answer
70 views

Change quote currency before place order

I want to change my quote currency code to EUR when an order is placed in any other currency. I tried writing event and observer of event sales_order_place_before. In my observer I have this code ...
0
votes
1answer
37 views

Add options to quote programmaticaly

I'm creating quote and order programmaticaly. I can't figure out why options product are not added to my order / quote. See : $superAttr = $item["super_attribute"]; if(!empty($superAttr)){ $...
1
vote
1answer
46 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 ...
0
votes
0answers
8 views

Add option on product quote

How do I add option to product quote ? $quote=$this->quote->create(); //Create object of quote $quote->setStore($store); //set store for which you create quote $customer= $this->...
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 ...
3
votes
3answers
193 views

Magento 2 - Cart empty after successful payment

I have a custom payment method, after successful payment; payment page return to a controller where it updates order status and truncate current cart items like this: $this->quote->load($orders-...
0
votes
0answers
80 views

How to merge guest cart into customer cart manually using REST API

I need to create a REST API which merges guest cart into customer cart. The body of this API request is, Body { "customer_id": "15", "guest_cart_id":"4563535gggy9mcw857yn9cwu578o3u" } The ...
1
vote
1answer
36 views

Efficient method to load/get and assign multiple custom options/attributes from quote item?

Is there a more efficient way to load and assign quote item custom options/attributes? This is code in my Observer: public function MyFunction(Varien_Event_Observer $observer) { $QuoteObject = Mage::...
1
vote
0answers
49 views

Magento 2 Remove cart content when user log-out | Empty cart when logged back in

Correct me if I'm wrong, but completely removing the cart content on customer log-out is not native to Magento 2 is it? I read about the "Persistent cart" but it seems to work only for removing the ...