[email protected] Posted October 31, 2018 Share Posted October 31, 2018 Hi all, there used to be a simple script required to fix the category counts when the database was populated manually or loaded with a CSV file. The categories have been created/added and now I have about 11000 products to add and all have their allocated category/sub category number. However, after adding a few products as a test the CubeCart_category_index stays empty and all products need to be manually allocated to their individual category. Is the following work around still the same as at https://swscripts.com/cubecart-mods/fixcatcount.html ? I looked in the forum and to my amazement I could not find anything about this. Thank you for your direction, Pippo Link to comment Share on other sites More sharing options...
[email protected] Posted October 31, 2018 Author Share Posted October 31, 2018 I actually found the answer. Yes the mod remains the same : TRUNCATE TABLE CubeCart_category_index; INSERT INTO CubeCart_category_index (product_id, cat_id) SELECT product_id, cat_id FROM CubeCart_inventory; On a different note, what does the primary field do in CubeCart_category_index ? Thank you Link to comment Share on other sites More sharing options...
bsmither Posted October 31, 2018 Share Posted October 31, 2018 In CubeCart, one can associate a product to more than one category, with one of those categories designated as the Primary category. This designation is indicated by a true-ish value in the 'primary' column. The Primary category (cat_id) is also recorded in each product's record in CubeCart_inventory. The Primary category is what will construct the breadcrumb path when viewing that product, regardless of the path of pages one took to get there (Sale Items, Searches, or secondary category path). Also, if using Shipping by Category, only the Primary category contributes to the list of available shipping options. When deciding to show what products are visible (a logged-in admin overrides this), if any of the associated categories is enabled and not hidden, then the product will be shown. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.