reclipse3 Posted January 13, 2009 Share Posted January 13, 2009 Ever since upgrading to 1.1, newly added products always show the Home Featured Products in the Same Category area of a product's page, instead of the products that are actually in the same category.Anybody know if this is a bug or an issue with my shop?? If it's my shop, any ideas for a fix?? Link to comment Share on other sites More sharing options...
Dave Egerton Posted January 13, 2009 Share Posted January 13, 2009 I dont know before 1.1, but you need to have products in the Home category for them to be included in Home featured ProductsSo each product you want on featured would be in home category and also its own category. On each product, as you will know, you ca set the default category. But I dont understand - If you are using default theme I think categories names are not shown. just product detail in featured products on home page, or are you talking about something else. Its not clear Link to comment Share on other sites More sharing options...
reclipse3 Posted January 13, 2009 Author Share Posted January 13, 2009 Sorry, I will try to be more clear.My shop has many product in many categories and sub-categories. I also currently have 6 featured products that are properly shown on the home page.Since upgrading to 1.1, when I add a new product to a category that already has products, then view that new product's page, instead of seeing all the other products that are in the same category (just below the product photo), I'm seeing the products that are featured.I'm thinking that something went wrong during the upgrade. Does anyone know how to SAFELY re-install PS and preserve all settings, products, etc.?Thanks,Robert Link to comment Share on other sites More sharing options...
reclipse3 Posted January 14, 2009 Author Share Posted January 14, 2009 I see what's happening now (only with version 1.1).Now, when you create a new product and you click that new product from the Home page (from within the New Products block), it's not updating the Navigation URL correctly and showing, Home > "Product Name"...as opposed to showing the correct Navigation URL path, Home > Directory > Subdirectory > "Product Name"...so it's acting like that product's category is Home and therefore showing any product listed on the Home page (Featured Products) as being in the Same Category.This is a big problem because most people visiting your store see the New Products block and immediately and click them. Once they're on that product's page, they'll be confused why irrelevant products are stated as being in the Same Category. And if they click any of those Featured Products, they're shown that product's CORRECT Same Category products.Needless to say, I have the Products Category v1.2.1 Module turned off until this issue can be fixed. I'm sure this was overlooked when coding the new version. Hopefully they fix it soon! Link to comment Share on other sites More sharing options...
SaDJ0KeR Posted February 11, 2009 Share Posted February 11, 2009 Hello. This is fixed in the SVN. Anyone knows how to fix it by hand... or SVN Revision when it was fixed? I can`t find it. Link to comment Share on other sites More sharing options...
Kelvin Situ Posted February 13, 2009 Share Posted February 13, 2009 After I put my effort on troubleshooting this, I found the cause. When add a new product, the default category is alway “Home”, if you forgot to manually change it to the correct category, it caused above problem. You need to modify each product to save its correct default category. You can do that using phpMyAdmin to modify the MySQL table “product”, edit the “id_category_default” to the correct one, now you see all “1” in the “id_category_default”. I compared the version 1.0 and 1.1, the cause is: In admin\tabs\AdminProducts.php file, line 1627: Category::recurseCategory($categories, $categories[0][1], 1, $this->getFieldValue($obj, ‘id_category_default’)); For new item, the id_category_default is always 1, which is the Home category. Therefore, you need to change the line 1627 to: Category::recurseCategory($categories, $categories[0][1], 1, $this->getFieldValue($obj, ‘id_category’)); Change “id_category_default” back to “id_category”!!! Then for next new added products, works fine. It isn’t the Products Category v1.2.1 module problem, you can turn that module on again. But above fix isn't the best solution, it can't track what is the default category in the database table if you modified it. But if you don't move you default category, it is ok. Link to comment Share on other sites More sharing options...
SaDJ0KeR Posted February 14, 2009 Share Posted February 14, 2009 One more bug with your solution. First click on some category. id_category is set to this number category. Try to click a product from Last Viewed (which must be product from other category) and when u click that product in the block, the “Other products from this category” module loads the products from the category you clicked before. i.e. the wrong category. I don`t know if u can understand and reproduce.For example. I visited a product from category 35. It appears in the Last Viewed block. Then i click on a category different from category 35 in the category block, for example category 26. Then i click the last viewed product from category 35 in Last viewed block link and the module with "Other products from this category" loads the products from 26 not from 35 where is this product. Link to comment Share on other sites More sharing options...
ruilong Posted February 14, 2009 Share Posted February 14, 2009 Acctually, to get it to work in your shop you probobly only need to go into admin, open the products detail page, select correct default category in the dropdownlist. (selecting something else than "home") and then save. it should work after that. Link to comment Share on other sites More sharing options...
Kelvin Situ Posted February 14, 2009 Share Posted February 14, 2009 OK, this is the best solution i can provide.In the line 1627 again, replace it with this:Category::recurseCategory($categories, $categories[0][1], 1, (($this->getFieldValue($obj, 'id_category_default') > 1)? ($this->getFieldValue($obj, 'id_category_default')) : ($this->getFieldValue($obj, 'id_category'))));It works perfectly for new products. You have to modify the old products id_category_default to the correct in database.Or, simply open that old product and save it again after you patch my code. Link to comment Share on other sites More sharing options...
jolvil Posted February 14, 2009 Share Posted February 14, 2009 thanks to write code like this using code tags Category::recurseCategory($categories, $categories[0][1], 1, (($this->getFieldValue($obj, 'id_category_default') > 1)? ($this->getFieldValue($obj, 'id_category_default')) : ($this->getFieldValue($obj, 'id_category')))); Link to comment Share on other sites More sharing options...
SaDJ0KeR Posted February 14, 2009 Share Posted February 14, 2009 @ruilong... all the products are with the correct category already... not "Home". And it shows them as "Home". Link to comment Share on other sites More sharing options...
SaDJ0KeR Posted February 14, 2009 Share Posted February 14, 2009 For this new bug... i just changed the next thing:In modules/productscategory/productscategory.phpi commented lines: 40, 41, 42, 43 and just left: $category = New Category(intval($product->id_category_default));For now it works. Link to comment Share on other sites More sharing options...
pedes Posted April 21, 2009 Share Posted April 21, 2009 i have the same problem, but this last solution doesn't work for me?anyone know how i can solve this problemkind regardsPeter Link to comment Share on other sites More sharing options...
pedes Posted April 21, 2009 Share Posted April 21, 2009 Acctually, to get it to work in your shop you probobly only need to go into admin, open the products detail page, select correct default category in the dropdownlist. (selecting something else than "home") and then save. it should work after that. just like RUILONG said, this is the only correct way to solve this problem... this is not a bugproblem solvedKind regardsPeter Link to comment Share on other sites More sharing options...
___d Posted February 9, 2010 Share Posted February 9, 2010 Thank You! It work! Link to comment Share on other sites More sharing options...
Riv3n Posted February 25, 2010 Share Posted February 25, 2010 After I put my effort on troubleshooting this, I found the cause. When add a new product, the default category is alway “Home”, if you forgot to manually change it to the correct category, it caused above problem. You need to modify each product to save its correct default category. You can do that using phpMyAdmin to modify the MySQL table “product”, edit the “id_category_default” to the correct one, now you see all “1” in the “id_category_default”. Thanks Kelvin Situ, that really solved my problem.cheers Link to comment Share on other sites More sharing options...
Recommended Posts