Jump to content

ps_facebook does not update status correctly on Facebook Catalogues


apollux

Recommended Posts

Prestashop 1.7.6.9

Official Facebook by Prestashop does not update stock as per original settings. There are currently 3 different stock features in facebook cataloge: In stock, Out of stock, Available for order and Discontinued.

So, when the product is out of stock, but orders are allowed, it should have the status Available for order so it can be ready for Ads and showing in the Facebook Shop, instead, Prestashop lists it as Out of stock and that's it.

I discussed with Prestashop help, but they got stock at not responding anymore by email. It seems that they have not checked the entire feature themselves, they just pushed a module without checking the actual feature.

 

So, somehow, this is very wrong (modules/ps_facebook/classes/Provider/ProductAvailabilityProvider.php):

public function getProductAvailability($productId, $productAttributeId)
    {
        $product = new Product($productId);

        if ((int) StockAvailable::getQuantityAvailableByProduct($productId, $productAttributeId)) {
            return ProductItemAvailabilityValues::IN_STOCK;
        }

        switch ($product->out_of_stock) {
            case 1:
                return ProductItemAvailabilityValues::AVAILABLE_FOR_ORDER;
            case 2:
                $isAvailable = Product::isAvailableWhenOutOfStock($product->out_of_stock);

                return $isAvailable ? ProductItemAvailabilityValues::AVAILABLE_FOR_ORDER : ProductItemAvailabilityValues::OUT_OF_STOCK;
            case 0:
            default:
                return ProductItemAvailabilityValues::OUT_OF_STOCK;
        }
    }
}

I could edit myself, but since Prestashop pushes updates once per day, I will not know if what I updated is actually valid.

Link to comment
Share on other sites

51 minutes ago, yarik121 said:

I believe Prestashop needs to add these options to their free module

https://faq.businesstech.fr/en/faq/262-how-to-indicate-the-availability-of-my-products-on-facebook

 

Still looking  how to solve the problem in their existing module....

 

14 hours ago, yarik121 said:

I am in the same situation as you. Can you please let me know if you found a solution ? 

With regards to your comment of pushing the updates once per day maybe we can change it somewhere in code to make them once per hour or so ? 

I did found a solution. I removed the catalogue feature from their script and bought a paid module that can do feeds for almost any platform.

 

Anyway, Facebook won't let you advertise your catalogue since the items will not be "In stock".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...