Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8111127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:59:40+00:00 2026-06-06T01:59:40+00:00

There are two variables which are required in the tracking pixel which needs to

  • 0

There are two variables which are required in the tracking pixel which needs to be placed on category, product info, cart and confirmation page.

I’ve managed to get the Prod list and Prod working, however, the second two are causing me problems.

I can echo out the sku in the cart, however, the products are configurable products so it’s duplicating the sku in the output. The code I’m using is below:

<?php
// $items = Mage::getModel('checkout/cart')->getQuote()->getAllItems();
$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();foreach($items as $item) { echo ''.$item->getSku().'&nbsp;';}
?>

How do i change this to just display the one configurable SKU?

The second element is the Category name that the product exists in, Any one got any ideas on that? I’ve tried multiple variations but they’ve either broke the page or returned nothing.

Any help would be appreciated. If someone could also give me examples of how these would work on the confirmation page as well, that would be great.

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:59:41+00:00Added an answer on June 6, 2026 at 1:59 am

    Check for the products visibility (simple products attached to a configurable would not be visible):

    $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
    foreach($items as $item) {
        if ($item->getProduct()->isVisibleInSiteVisibility()) {
            echo ''.$item->getSku().'&nbsp;';
        }
    }
    

    With regards to the category name, a product can appear in multiple categories so im not sure how you want to handle that. Also, there is a concern that you are beginning to duplicate code across several template files. You will want to consider moving this all out to a block.

    Anyway, to get the category names that the product belongs to here is at least one method of doing this…

    $categoryCollection = $item->getProduct()->getCategoryCollection()
                                ->addAttributeToSelect('name');
    
        foreach($categoryCollection as $category) {
           echo $category->getData('name') . "<br/>";
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to compare two variables in which are usually strings. These variables
There are two variables in our database called OB and B2B_OB . There are
Possible Duplicate: Passing only two variables between controller and view - best practice? There
In struts I notice there are two different ways to access variables. I am
Let's say I have these two variables $number = 1; $word = one; and
t = Time.now d = 10.minutes.from_now Using these two variables, how do I output
Here is the question: write a method that swaps two variables. These two variables
I have these two functions (with Point2D & LineVector (has 2 Point2D member variables)
I have two tables (using table variables for illustration. You can run these directly
I'm confused as to how to accomplish this. I have a page which, has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.