fitgura Posted March 31, 2015 Share Posted March 31, 2015 Hi all! I just wondering how is my shop show a different quantity on a product page, that in the ps_product table / quantity column?! As I investigate, the showed qty is in ps_stock_available table, but I do not understand why?? Could someone explain me how to show the qty from the originlal ps_product table? I do not use multistore or advanced stock management function! Link to comment Share on other sites More sharing options...
fitgura Posted April 1, 2015 Author Share Posted April 1, 2015 Pelase help me switch off ps_stock_available I need to get back the basic ps_product table to show prices and stock! This is very urgent! Is someone can elp me? Link to comment Share on other sites More sharing options...
unlimitedgrain Posted April 3, 2015 Share Posted April 3, 2015 You have to give more details: version prestashop url or screenshots of BO and FO do you use attributes? if yes, quantity is per attribute of the product!! Link to comment Share on other sites More sharing options...
doekia Posted April 3, 2015 Share Posted April 3, 2015 ps_stock_available is not an option. You have to consider the quantity column on ps_product to be an historical artefact of no use. Not a single piece of Prestashop core updates it, and not a single module should update or rely on it. If you need to knwo the quantity available in a single query: select p.id_product, coalesce(pa.id_product_attribute,0) as id_product_attribute, if (pa.reference = '',p.reference, coalese(pa.reference,p.reference) as reference, sa.quantity, <other field you may find usefull> from ps_product p left join ps_product_attribute pa on p.id_product = pa.id_product inner join ps_stock_available sa on ( sa.id_product = p.id_product and sa.id_product_attribute = coalesce(pa.id_product_attribute,0) and sa.id_shop = 1 ) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now