I have been trying this to retrieve them and it works fine on Product detail pages.

$data = array();
// PDP
if ($module === 'catalog' && $controller === 'product' && $action === 'view') {

            $customer = Mage::getSingleton('customer/session');
            $product  = Mage::registry('current_product');
            $category = Mage::registry('current_category');

            // Product(s) IDs
            $data['u2'] = $product->getSku();

I've noticed it pulls various styles from configurable and there is lots of them which means there will be lots of style numbers (only shows one).

My question is... is there a way to pull all the style numbers and display them for all various colors in a configurable or just pull the simple sku?

I hope that makes sense. I'll eagerly await for feedback. Thank you.

Magento ver.

try this->

$quote = Mage::getSingleton('checkout/cart')->getQuote();
$sku = array();
foreach($quote->getAllItems() as $item) {

   $sku[] = $item->getSku();  

  • Will this work on all pages? My code above currently works on PDP pages. – Head Way Nov 11 '16 at 14:39
  • in which file you have added this code? – Piyush Nov 11 '16 at 14:50
  • Your code or my code? My code is part of a module I built. – Head Way Nov 11 '16 at 15:54
  • if you want this to work on all pages you have to add this code in a file which is called on every page. – Piyush Nov 11 '16 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.