Jump to content

1.5 Homefeatured incorrectly showing out of stock when not


Recommended Posts

We are running on 1.5.6.1 and have been having consistant issues with the homefeatured module showing the "add to cart" button disabled even when in stock.

 

Only after playing for countless hours did I try totally disabling the TPL cache system check in the module itself

 

public function hookDisplayHome($params)
    {
        #if (!$this->isCached('homefeatured.tpl', $this->getCacheId('homefeatured')))
        #{
            $category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
            $nb = (int)Configuration::get('HOME_FEATURED_NBR');
            $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));

            $this->smarty->assign(array(
                'products' => $products,
                'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
                'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
            ));
        #}
        return $this->display(__FILE__, 'homefeatured.tpl'); #, $this->getCacheId('homefeatured'));
    }

 

By totally disabling any check for a cache version of the homefeatured TPL file does stock amounts correctly corrispond to the "add to cart" button.

 

Where is the update time check on the tpl???   Why does it just assume because it exists that it's fine to use?!

 

I'm sure I don't need to mention that a product that LOOKS out of stock will not get as much traffic or added to cart if people are under the impression it's out of stock...

Link to comment
Share on other sites

Cache is normally cleared in hookUpdateProduct(), that means each time a product is updated. You should verify that the module is still hooked to it.

By the way, I think it should also clear cache on actionUpdateQuantity()... but apparently it does not.

Link to comment
Share on other sites

I already checked the hooks exist on the product update, delete etc prior to commenting out use of the cache system. There is no specific hook for action UpdateQuantity.

 

However we do have custom modules that update our stock from a 3rd party resource using prestashops own interface to update stock actions (not direct to sql). So I would of thought these still valid calls would of triggered prestashops actionUpdateQuantity as it was.

Link to comment
Share on other sites

I already checked the hooks exist on the product update, delete etc prior to commenting out use of the cache system. There is no specific hook for action UpdateQuantity.

 

However we do have custom modules that update our stock from a 3rd party resource using prestashops own interface to update stock actions (not direct to sql). So I would of thought these still valid calls would of triggered prestashops actionUpdateQuantity as it was.

I think so too and I think homefeatured module should have a hook on UpdateQuantity

Link to comment
Share on other sites

×
×
  • Create New...