Hot answers tagged

4 votes

Magento 2.4.3 currency symbol not showing on product,cart and checkout page

Its a bug in 2.4.3: src\vendor\magento\module-directory\Model\Currency.php Comment out these lines: if ($this->canUseNumberFormatter($options)) { return $this->formatCurrency($price, $...
user avatar
3 votes
Accepted

Magento 2.4.4 - Unable to place order: There are no source items with the in stock status

Whenever we will upgrade Magento 2.3.X version to Magento 2.4.3 at that time Multi-Source Inventory Issue happens. To solve that issue need to follow the below steps. Step #1 First Disable all MSI ...
user avatar
2 votes
Accepted

How to get Product attribute from Cart Model

There is a new concept in Magento 2 to create a catalog_attributes.xml file in which you can define your custom attribute value using the quote_item group section You Just need to create app/code/...
user avatar
2 votes
Accepted

Undefined index: simple_sku Magento 1.9

When adding a configurable to the cart both the configurable and simple child products will be in the cart, only 1 is visible and represented in the cart on the frontend. So depending on how you ...
user avatar
2 votes

Magento 2 REST API on add to cart "quoteId" is required. Enter and try again

Create a request to create the empty cart POST {{magento_api_url}}/rest/default/V1/guest-carts/ this will return a token which is the cart ID (e.g 'KZepbhhPiGORreBKqIRlMCywGDTyQtR4') Use that cart ...
user avatar
1 vote

Show a Text if attribute is set to "yes"

Based on tags I guess you have an issue with loading product data on checkout cart page and let me explain 2 possible way to solve Magento loads restricted attribute list for category collection or ...
user avatar
1 vote

Add custom option Programmatically in cart its not increasing quantity in cart

/app/code/Namespace/Mymodule/etc/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
user avatar
1 vote

how to get the name of the category that the user used to add the product to the cart. Magento 1.9

magento does not store product category name where user added it. You need to do customise it. For it you need to create custom column in order_item and quote_item table and with observer (...
user avatar
  • 1,319
1 vote

Magento 2 Get In Cart Product Brand, Variant and Quantity

You can get the quantity of an item in the customer's cart by this method $items = $this->cart->getItems(); foreach ($items as $item) { ......... $product = $item->getProduct(); $...
user avatar
1 vote
Accepted

Magento 2.4.3: Cart products not showing

To get more info, try: switching back to Luma and recheck if it works or not. Also try disabling all non-stock modules. This should give you enough information to debug it. (You can also add the ...
user avatar
  • 1,309
1 vote

Error when extend vendor wishlist cart file

This is because optionfactory is private in parent class you need to inject it in child class.change constructor like this. and execute all commands. public function __construct( Action\...
user avatar
  • 378
1 vote

Capture minicart configureable product variant info

Finally able to find ways to obtain the data of the product event by using this code selectedItem = _.find(customerData.get('cart')().items, function (item) { return itemId === Number(item['...
user avatar
1 vote

Magento 2: How to get cart items and its stocks using custom API?

Have you tried, like this ? app/code/VendorName/ModuleName/Model/ManageCart.php <?php namespace VendorName\ModuleName\Model; class ManageCart implements \VendorName\ModuleName\Api\...
user avatar
1 vote

How to add borders on Shopping cart page column header names

You can this code in your less file (_cart.less). You can find the less file here (Template:Luma): vendor\magento\theme-frontend-luma\Magento_Checkout\web\css\source\module Find this code in ...
user avatar
  • 33
1 vote

How to add borders on Shopping cart page column header names

You can add the borders using below code, add this code in your less file: .cart.table-wrapper { .cart thead { tr { th.col { border: 1px solid orange; ...
user avatar
1 vote

Magento 2 How to Override Cart/Item/default.phtml file in my Custom module

Check The Below Code <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="simple" template="Vdcstore_QuantityDropdown::cart/item/default.phtml" /> ...
user avatar
1 vote

Magento 2: Create order without cart

You will have to create cart to create order in Magento but you can always save the existing cart id in the customer session and set it back as customer's active cart once the customer is done with ...
user avatar
  • 4,585
1 vote
Accepted

How can i add $5 Handling fee if free shipping method is selected?

Di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/...
user avatar
1 vote
Accepted

Get all items from cart

To get Custom Attribute at cart item level, you need to define attribute in Vendor/Module/etc/catalog_attributes.xml. refer below Example. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
user avatar
1 vote

Get all items from cart

Please try Below Code Create a catalog_attributes.xml in Vendor/Module/etc <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
user avatar
1 vote
Accepted

How to add item to cart?

create events.xml on the following location. app\code\Vendor\Extension\etc\frontend\events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
user avatar
1 vote

Cart Price Rules to allow discount on limited products

Here we need 2 conditions. Apply the rule only if a valid product is available in cart. Apply rule only to the products with Disallow discount = no For First point: In cart price rules, on the ...
user avatar
  • 23
1 vote

Magento 2 : remove all products from cart

Magento\Quote\Model\Quote::removeAllItems()
user avatar
  • 11
1 vote
Accepted

Magento 2.4.3 Remove products from cart

Delete/remove the quote instead of just removing all items from cart. <?php declare (strict_types = 1); namespace Vendor\ShippingRestriction\Model\Resolver; use Magento\...
user avatar
1 vote
Accepted

I want to select multiple products using a checkbox and add to the cart all in a single click

BSS has this plugin https://bsscommerce.com/magento-2-add-multiple-products-to-cart-extension.html The plugin matches your requirement. Do one thing don't directly buy it. First, contact them via ...
user avatar
  • 1,128
1 vote
Accepted

How to get the information of the items in the cart? magento 1.9

You can do something like this to get cart item. $quote = Mage::helper('checkout/cart')->getCart()->getQuote(); $value = []; foreach ($quote->getAllItems() as $item) { $value[]= array ( 'id' ...
user avatar
1 vote

Magento 2 move tax section in to grand totals in cart page

You Can do this just Configuration. not require any custom code. please go to the below Stores->Configuration->SALES->Sales->General->Checkout Totals Sort Order
1 vote

How to redirect to cart after adding product to cart programmatically

please refere the below links. This may help you. https://magento-qa.com/how-can-i-redirect-to-the-cart-page-programmatically How can I redirect to the cart page programmatically?
user avatar
1 vote
Accepted

Magento 2 how to run reindex for single product or some cart line products

Source / Credit / Main article - How to Magento 2 Reindex one Product Programmatically? Adding code for reference <?php use Magento\Framework\App\Bootstrap; require '../app/bootstrap.php'; ...
user avatar
  • 576

Only top scored, non community-wiki answers of a minimum length are eligible