How to resolve Magento product count errors? - e-commerce

I am working on a Magento website. I have been adding products for a while now. Now the website is about to go live in a few days just working on finishing touches.
There are several categories.. Suppose Stools. In the admin it shows it has 989 Products but in the Front End it shows it has 677 Products. The problem is coming up with many categories.
I thought there is some problem so I added another Category named :- Ottawa Senators under Stools -> NHL Logo Stools. I selected 15 products that has to be there. But in the front end it shows 7 Products only.
I have attached a screenshot which best describes the issue well.!
screenshots

Check (or better do batch update) that all of your products:
are in stock (inventory tab)
have positive qty (same tab)
have correct website selected (websites tab)
PS: Senators are chokers.

Ofcourse the count is different because not everything in backend shows in the frontend
Examples :-
Out of stock products ( if you configured to hide out of stock )
Disabled products Not Visible individually products Products which
Product not assign to website
Product not assign to some category so you can only see them with direct url
You have to re-index catalog flat products and categories ( if you
are using Flat Tables in configuration )

You need to be concious about the cache management , Goto System > Cache management (Flush magento cache and Flush cache Storage).
Index Management should be ready to use.

Yes, I found the solution:
Take a backup of your database first and then run this query
DELETE FROM catalog_category_product where product_id NOT IN (SELECT entity_id FROM (catalog_product_entity))

Related

Adding new product with category tree - specific price problems

I installed an add-on for bulk action (called ba_importer v 1.1.24), I upload an Excel file with my data and create a group of products.
I can set the categories' tree or manually add ID of main categories and associated. I tried with no luck to use the tree features (like Home/Products/etc) and so I use all the ID of main category and all the associated. The result is a product with the correct categories set, but with no specific price from the customer group linked to a category.
I tried to edit a single product, remove all categories and set it one by one (set one, save, set one, save etc.) and then the specific price from the group linked to a category appears to the product.
Is there a better solution? I'm thinking about make a personal PHP page that reads an Excel file and sets all the information about the product, but I'm scared to face the same problem with the specific price. 
There is no such thing as "category-related specific price",
if you have specific prices tied to customer groups , these are created as a result of the add/update product action with ps_specific_price DB entries having id_group with your restricted ID.
It is likely that the bulk module acts directly with DB queries to speed up things and bypasses this operation, I've seen this behaviour with those kind of modules in the past.
Since you are talking of a paid add-on, I would definitely seek help from the developer.

Product pricing based on price zones for a store-pickup grocery chain website

I am in the process of building a e-commerce website for a small local grocery chain to allow their customers to order online and pickup at store. I will be integrating with the in-store POS system to pull the category & product data and push back the order data.
As I am new to Prestashop I am wondering if the following setup is possible out-of-the-box:
The POS system uses price zones which can be shared by stores (e.g. price_zone_1 is used by the 3 stores in San Francisco for pricing, price_zone_2 is used by 2 stores in Los Angeles for pricing).
The POS system have a pricezone_productprice table
product_id pricezone_id price
1 1 14
1 2 12
Then there is store_stock table
product_id store_id stock
1 1 98
1 2 45
And the store table has a pricezone foreign key that ties everything together
store_id pricezone_id
1 2
2 1
I need to have a similar setup on the Prestashop side to exchange data and display correct pricing and stock information for different stores.
Is such a structure/feature available out-of-the-box? If not are you aware of any module that might help with this? And finally if nothing is available how feasible do you think this is to develop under prestashop?
I explored multistore feature but as far as I understand that would not do what I am looking for as it separates order history, etc. I want customers to be able to see their order history from different stores in one page.
This might deserve an entire Override for Product Class with a Module. But honestly, you should better do a multishop website based on the zone you want to deliver, then ask the client when he enters the website.
It will cost you 10 minutes and fine tuning instead of hours of dev and lot's of debug.
If you still want to use a Module, just overide Product class and following methods : getPriceStatic and getProductPrice
NB : Another idea would be to consider price by ... country and tell each as a separate one. But this can be dangerous :).

Prestashop 1.6 How to allow out of stock orders in Multistor

V1.6.0.9 Multistore, Advanced Stock Management
Hi,
I need to show the add to cart button on items even when they are out of stock so that they can still be ordered. This was fine before I changed the site to Multistore.
At the moment, when an item is out of stock there is no add to cart showing.
In the Admin -> Preferences -> Products I have the "Allow ordering of out-of-stock products" set to true for all stores and the store manly in concern.
In Admin -> Catalog -> Products I have option Available for Order set as true and the product set to available everywhere.
I thought out of stock ordering needed be be set for each product as well in Products but I can't see where. Also, this did work for these products before the site was transformed to a multistore, however, it may be the issue.
Any ideas?
Thanks
You must go to The product page (Catalog>Products)
Go to Quantities (from that specific product) and make sure that When out of stock is set to Default: Allow orders as set in the Products Preferences page.
1) Setting the default behavior;
on the Admin -> Preferences -> products [PRODUCTS STOCK] section you can set the default behavior for shops as to how to handle out of stock products:
Yes (cart will be shown for Out of stock)
No (no cart for out of stock)
2) Setting products out of stock behavior for each shop;
much easier doing on the DB table there is a table called (ps_)stock_available; where for each product in each shop the out of stock behavior can be defined on column (out_of_stock) with below values;
0 : no cart on out of stock
1 : out of stock order-able (cart will be shown)
2 : following the shop default behavior (as set in first step above)
setting to 2 might be preferred since updating shop behavior will be much easier whereas setting to 1 will require another DB update on each product in case of modifying your shops' out of stock behavior.
columns (id_shop) and (id_product) address each product in each of the shops, and column (id_product_attribute) accordingly will allow setting similar behavior on products with various models / attributes

Only show in stock products OpenERP

When I open the location structure of the warehouse and check the current inventory of a particular location, it shows me all products (even when stock is 0).
Is there a way to hide the products that are not in stock in that particular location (or remove them from being able to show in that location)?
To achieve this functionality, you have to customize addons side code of stock and product,
You have to implement funt_search method in qty_available function of product, to search product based on codition.
And in the wizard you have to pass domain, of qty_avalable > 0 at wizard,.
For refrence you can see in openerp latest trunk stock module code.
Hope this help

Assign Tax Class to Products

I have (what I think is) a simple problem with my Magento tax classes. I have around 400 products in my shop and only 20 of them have a tax class assigned to it. I checked my database and the table "catalog_product_index_price" and all the products with the working tax have tax_class_id = 1 and all the not working ones have tax_class_id = 0.
So I thought I'll just update every product to tax_class_id = 1 and I'm done, but as soon as I re-indexed my prices in the Magento back-end the products got tax_class_id = 0 again.
Somewhere there must be a default, but I can't find it anywhere.
catalog_product_index_price is an index table, which is populated during reindexation process. It means that it pulls data from other tables and group them in this table for further use. That's why your changes were overridden after the reindex.
If you want to change tax_class_id for your products, the easiest option would be to use Mass Update* functionality in your admin panel. Open Manage Products section, select all products (select all), choose Update Attributes from action dropdown, and you'll be able to change Tax Class for all the products at once.
Try change it by hand by going to Catalog -> Manage Product -> Click on one -> Prices -> Tax Class.
Then have a look how it changes in the back end.
select * from catalog_product_index_price where entity_id = [[product_id]];
Best bet from here is to trace the SQL statement by changing pdo debug on by logging the sql statements: http://yauhen.yakimovich.info/blog/2011/03/21/log-all-sql-queries-in-magento/