Assign Tax Class to Products - sql

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/

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.

SQL mass updates on Volusion

Right now I am trying to update a field for a lot of products using SQL on Volusion but I can't seem to get it right.
I am trying to update the Package Type to UPS Package for every product but when I update it this way, it just adds another option on the drop down list titled the exact same thing
https://i.imgur.com/MhPmRIJ.png
I imagine what I should be doing is changing things around so that instead of updating every product I'm making every product choose UPS Package from the existing menu? If I manually change a product to UPS Package (correctly) then export all product data the field is displayed as just a '2' on the spreadsheet, but I also can't just put a '2' in on the mass update.
Thanks in advance
1:
Its the space before the SET value that is causing this, which you would need in order to keep this on the same line (otherwise this becomes products_joinedSET). This was a correction made to any SQL that can be run in a store that was made back in mid November. So any queries with a SET value will need a line break in order to remove that space between the table name and the SET.
UPDATE Products_Joined
SET Package_Type = 'UPS Package' WHERE ProductPrice = '0'
Of course, if you want to change ALL your products to UPS Package and have products that are more than $0.00 then you'll need to remove WHERE ProductPrice = '0'

How to hide out of stock products and its categories in Volusion

I have Volusion store I want to do the following, If it is possible??
If Qty = 0 (out of stock) do not display the product as well as it category.
When Qty changes display. (this will eliminate clutter)
If Product in Category = 0. Do not display the category
For example Home > New > Digital Signage has 0 products,
Then do not display the category - Until there are product in the category.
From Volusion's support article.
https://support.volusion.com/hc/en-us/articles/209957467-How-to-Use-the-Hide-When-Out-of-Stock-Option
How to Use the Hide When Out of Stock Option
When an order placed in your store causes the stock status of a product to drop to zero or below, your store will hide the product, provided the Hide When Out Of Stock setting (on the product's Advanced Info > Product Display tab) is set.
This will prevent the product from being viewed by customers on your store front until the product's stock value is incremented (either manually or through processing an RMA or purchase order). You can learn more about using the hide function by reviewing the Marking a Product as Hidden article.
Note that if any of your products have options for your customers to select from, you may wish to hide certain options when the associated product variant is out of stock, while leaving other options visible. The best way to automatically hide out-of-stock product options is by using Smart Match and the Inventory Control Grid.
Automatically Hiding When Out of Stock
Note that the Hide When Out Of Stock function only activates if the stock status of a product drops to zero or below due to a purchase. If you explicitly set the stock status to zero within a product's settings, it will not automatically trigger this setting. To manually hide a product from view on your store front, enable the Hide Product option within the Advanced Info > Product Display tab.
Furthermore, in order for products to automatically be hidden when out of stock, products need to be configured to not allow backorders. To do this, go to Settings > Config Variables and select the Checkout Variables. Make sure the Enable Back Orders check box is not selected. This will prevent Volusion from allowing any products at a stock less than 1 from being ordered and will allow the Hide When Out Of Stock variable to engage for all products.
If you have some products that you want to do this for and some you don't, you can set Enable Back Orders at a global level as described above but select the Do Not Allow Backorders check box for specific products under the Stock tab.
Note on Stock Value Updates
Briefly mentioned above, Volusion's Hide When Out Of Stock will inversely update products: Any product using this function will be automatically unhidden when the stock status for a product is updated to a positive quantity. Product stock can be updated manually from a product's settings page or automatically through the processing of an RMA or purchase order, or even through an import to your Volusion store's products table.
Also, please note that any product with Hide When Out Of Stock and Hide Product checked with a Stock Status set to Null (blank) or a positive value will be unhidden whenever any Stock Status is imported for any product in the store.
Please keep this function in mind when using this feature to prevent products you wish to remain hidden from being made available on your store front after product stock value updates.blockquote

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

How to resolve Magento product count errors?

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))