Adding SKU information to Shopping Cart in Magento

magento 2 order summary template
magento 2 display sku in cart
magento add item to cart
shopping cart rest api example
magento 2 manage shopping cart
magento 2 aftergetconfig
magento 2 shopping cart page
magento 2 add to cart

My client needs to have the sku number, next to the Product Name in the Magento Shopping Cart. I tried adding this code:

<?php echo $this->__('Style Number : %s', $_product->getSku()) ?>

but I get this message:

"Fatal error: Call to a member function getSku() on a non-object."

I would appreciate any help.

Thank you.

If you edit DOCROOT\app\design\frontend\default\themename\template\checkout\cart\item\default.phtml and add

<?php echo $_item->getSku() ?>

That should work.

JD

Managing a Shopping Cart, next to its name. To display information about the product, Magento already adding Sku into checkout json. so you need to make Data on products in the cart are stored in the following object: window.checkoutConfig. To offer assisted shopping. In the Admin sidebar, click Customers . Choose All Customers . In the list, open the customer record in edit mode. To find the customer record in a hurry, use the Filters control. In the customer profile under To enter assisted shopping mode, click Manage Shopping

http://www.woolleydesign.net/2011/05/magento-adding-short-description-to-the-shopping-cart/

Got some assistance from here as well, great post for any others interested

Show SKU on checkout, If you add a product to the shopping cart as a registered customer, quantity: 1 sku: "simple-product" } } ] } ) { cart { items { id product { sku� Add a configurable product to a cart. To add a configurable product to a cart, you must specify the sku as well as the set of option_id/option_value pairs that make the product configurable. In this example, we’ll add the Chaz Kangeroo Hoodie (sku: MH01) configurable product to the cart. This product comes in three colors (black, gray, and orange) and five sizes (XS, S, M, L, XL).

The line:

<?php echo $_item->getSku() ?>

inserted in:

app\design\frontend\default\themename\template\checkout\cart\item\default.phtml

exactley above line:

<?php if ($_options = $this->getOptionList()):?>

as per the above Mike answer solved for me one of the main problems. Is working well also with SCP installed. I got, in the cart, the SKU of the selected simple object associated to a configurable product.

I am on Magento 1.6.2. PERFECT.

Thanks Jonathan, thanks Mike, thanks to all.

Step 3. Add products to the cart, When complete, click Add to Cart. If any of the products have additional options, you will be prompted from the shopping cart that the product� At the end of the article you will find the code of the developed module. The module creates a page in the Magento administration panel with an interface for adding items to the cart with an indication of the SKU (if necessary) and quantity. The action to add goods to the basket is performed in the action Index.

Works perfect - only one piece of advice for some uncertain where to drop this code.

I added it after line 37 in default.phtml after the closure

Reason being is in the wrong place it won't show up under the product name if I add it after line 27.

My lines 37-39 on Magento 1.5 for default.phtml mentioned above

</h2>
    <?php echo $_item->getSku() ?>
<?php if ($_options = $this->getOptionList()):?>

Order by SKU, Next, we'll create a cart and add the items that we modified in Step 5. Sign in as the customer at http://<host> and click on the shopping cart. Magento add sku or product number to shopping cart item in the checkout page It is not difficult in Magento to add a sku, product number or any other product attribute to the shopping cart item on the checkout page.

Step 7. Create a cart and add products to it, You need to edit the SKU attribute in the backend and make it available for price rules. Go to Catalog->Attributes->Manage Attributes , search for the SKU� Magento is a great eCommerce platform, it comes with so many built in features some of which you will probably never use. However one feature that we hear a lot of complain about is the lack of possibility to have a Shopping Cart Promotion Rule that targets the products custom options.

Can't see SKU as an option on shopping cart price rules, Override one template (simplification of Joey's answer). Bind directly to window object.checkoutConfig.quoteItemData object. Trying to add products to cart from pages which are totally outside Magento, on another CMS. The product information is available to these pages so technically I should be able to add to the cart via API. I'm dealing with a developer who knows his CMS but not Magento, and the API information is not helpful.

Magento2 How to show sku in order summary?, We are an website design company who specializes in Website Design and Development, App Development, Prototyping, Ubuntu Server Administration and � Shopping Cart API. Allows you to create/modify shopping cart and create an order after complete filling the shopping cart. Consists of two main parts: Shopping Cart and Checkout processes. Module: Mage_Checkout. Resource: cart_product. Method: cart_product.add (SOAP V1) shoppingCartProductAdd (SOAP V2) Allows you to add one or more products to

Comments
  • what template are you editing?
  • Thank you very much. It worked like a dream. Funny, the code I initially used worked on Product pages, but it would not work on the shopping cart. If you don't mind, can you point me to the reason behind it? Thank you very much. Now I just need to figure out how to sign up so that I can give you some points for the answer.
  • On the product pages, the variable that holds the product information is called $_product - on the cart page, it's called $_item. Have a look at line 27 (<?php $_item = $this->getItem()?>) in the file you just edited to see where the variable is created.
  • P.S. If it worked for you, please either upvote or accept the answer with the tick, that's how Stack Overflow works :) Great to see you here :)