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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:33:55+00:00 2026-06-17T05:33:55+00:00

I ran into a problem somehow where a product that is in stock and

  • 0

I ran into a problem somehow where a product that is in stock and has a quantity of over 400000 is saying it is not salable. Or rather isSalable is not returning a value.

I pulled up the function to take a look and I noticed something odd.

Here is the function:

public function isSalable(){
    Mage::dispatchEvent('catalog_product_is_salable_before', array(
        'product'   => $this
    ));
    $salable = $this->isAvailable();
    $object = new Varien_Object(array(
        'product'    => $this,
        'is_salable' => $salable
    ));
    Mage::dispatchEvent('catalog_product_is_salable_after', array(
        'product'   => $this,
        'salable'   => $object
    ));
    // echo "variable: ".$salable."<br />object: ".$object->getIsSalable();

    return $object->getIsSalable();
}

The commented echo was to see the value before it was put into the object and the value retrieved from the object. On the problem product I get:

variable: 1
object: 

On other products they both come back as 1.

Does anyone know what would cause this to happen?

—EDIT—

Sorry, the function returns $object->getIsSalable(), not $salable.

This is on Magento Enterprise 1.12

I realize now that the object call is returning false. The effects of posting this at the end of the day.

I moved the echo to before the event dispatch and both came back as 1 so i looked into the event and tracked down where it is setting it to false.

I tracked it to this function in Enterprise/CatalogEvent:

public function applyIsSalableToProduct(Varien_Event_Observer $observer){
    $event = $observer->getEvent()->getProduct()->getEvent();
    echo "<br />".$event->getStatus()."<br />";
    if ($event && in_array($event->getStatus(), array(
                Enterprise_CatalogEvent_Model_Event::STATUS_CLOSED,
                Enterprise_CatalogEvent_Model_Event::STATUS_UPCOMING
    ))) {
        $observer->getEvent()->getSalable()->setIsSalable(false);
    }
    return $this;
}

If I echo $event->getStatus() outside the if, the problem product gives a status of closed, and other products throw an error because $event doesn’t exist.

What is causing the difference?

—EDIT 2—

I’ve found that the closed is coming from the product event.

$event = $observer->getEvent()->getProduct()->getEvent();

I went back to isSalable() and added print_r($this->getEvent()->getData()); after the object creation and got this:

Array([event_id] => 3 [category_id] => 12 [date_start] => 2012-11-28 09:54:00 [date_end] => 2012-11-29 09:54:00 [display_state] => [sort_order] => [status] => closed)

Again, normal products come back with an error because there is no event on the product.

Where does this event come from?

I’ll keep updating as I make progress.

  • 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-17T05:33:56+00:00Added an answer on June 17, 2026 at 5:33 am

    Figured it out. There was a catalog event set that was setting the status to close. Deleted the event and all was well.

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

Sidebar

Related Questions

I ran into the problem that my primary key sequence is not in sync
I ran into a problem that suggests I may be implementing a design pattern
I somehow ran into the issue when I was working on an application that
Developing a little survey webapp, ran into problem that deals with ranges for rating
I ran into a problem with ActiveRecord serialization. Apparently, it has trouble serializing hashes
I am new to jQuery and I ran into a problem that is probably
I ran into a problem using Springsource Tool Suite when writing some groovy scripts
I ran into a problem or maybe even a MySQL limitation. The situation is
I ran into a problem today trying to override an implementation of an interface
Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {

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.