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 9137967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:11:44+00:00 2026-06-17T09:11:44+00:00

On an observer file I need to detect if the loaded page corresponds to

  • 0

On an observer file I need to detect if the loaded page corresponds to a product. I’ve been using a similar method to the one used on the checked answer on this question:

if (!(Mage::registry('current_product'))) return;

But until now we were testing on development. From today we are testing on pre-production servers, with lot of modules and plugins. Until now it worked seamesly but now it does not work, it does not detect when a product page is loaded. I think is related with the url rewrite to show a more “friendly” url’s but can not detect how to solve it. I took a look into Alan Storm tutorial In Depth Magento Dispatch but I still can get what is wrong or what do I need to change.

Any idea? Or some other solution on how to detect when a product page is loaded?

  • 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-17T09:11:44+00:00Added an answer on June 17, 2026 at 9:11 am

    You’ve verified that the observer is being hit? Make sure that for the event you are triggering on has a unique name for that event. For example in the following code the name “catalog_product_set_price” must be unique in regards to “catalog_product_load_after” event. I’m assuming you’re getting into the observer, but just in case. This risk becomes possible if you add a bunch of new modules to an instance.

            <catalog_product_load_after>
                <observers>
                    <catalog_product_set_price>
                        <type>singleton</type>
                        <class>NamespaceModule_Model_Observer</class>
                        <method>set_price2</method>
                    </catalog_product_set_price>
                </observers>
            </catalog_product_load_after>
    

    You could use the following array to check where you are:

    $currentPageArray = array(
                'request_string'=> Mage::app()->getFrontController()->getRequest()->getRequestString(),
                'uri'           => Mage::app()->getFrontController()->getRequest()->getRequestUri(),
                'route'         => Mage::app()->getFrontController()->getRequest()->getRouteName(),
                'action'        => Mage::app()->getFrontController()->getRequest()->getActionName(),
                'controller'    => Mage::app()->getFrontController()->getRequest()->getControllerName()
            );
    

    it will output something like:

    Array
    (
        [request_string] => /some-category/some-product-page-url.html
        [uri] => /catalog/product/view/id/64806/category/17
        [route] => catalog
        [action] => view
        [controller] => product
    )
    

    You could try a different observer.

    • controller_action_layout_render_before_catalog_product_view
    • controller_action_postdispatch_catalog_product_view
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to save a file after a succesfully checkout. So I'm using the
I've found a great class to extend the abstract File Observer class... import android.os.FileObserver;
I have a application and i need to user Observer to resolve. Since the
My app needs to download a file after the file has been cached and
When a new simple product is added (via CSV or manually) we need to
I have a following usecase. A process serializes certain objects to a file using
I want to include an external configuration file in a Magento Observer Model My
I need to use JQuery in order to detect the changes on a text
I tried to merge different tab delim files into single file using the following
I want to create a signature for a file using OpenSSL. I believe that

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.