You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On TB 1.1.0:
Updating a product's category on CSV Import does not set the new category as default.
This affects product breadcrumb display - where it still shows the previous category breadcrumb.
Similar ticket on PS 1.7 forum with a solution - the solution was integrated into PS 1.7
There is a temporary solution to modify the code in AdminImportController.php, but this will always update the product's category to default. I've been informed that some users may not want this to happen. The user on the PS forum as well as Ninja on the TB forum have suggested a compromise solution where the User can choose if he wants this to happen. Either by a new column on the CSV file or by a new button on the Import screen.
Tempory solution or code that sets new category as default on CSV Import:
The code has the following effect:
On CSV Import, the product's category is updated, the product's breadcrumb is updated and the "default category" is updated and reflects in the backend 🙂
How to update:
In AdminImportController.php:
Find: // Will update default category if there is none set here. Home if no category at all.
Change code to:
if (isset($product->id_category[0])) {
$product->id_category_default = (int)$product->id_category[0];
} else {
if (!isset($product->id_category_default) || !$product->id_category_default) {
$defaultProductShop = new Shop($product->id_shop_default);
$product->id_category_default = Category::getRootCategory(null, Validate::isLoadedObject($defaultProductShop) ? $defaultProductShop : null)->id;
}
}
As this is one of my first issue posts, please point out any issues or improvements that I can make on future issue posts. Thanks :)
The text was updated successfully, but these errors were encountered:
Acer-ZA
changed the title
CSV Import Update Issue: Updating a product's category on CSV Import does not set the new category as default.
CSV Import Update Issue: Updating a product's category on CSV Import does not set the new category as default [with temporary code solution]
Sep 16, 2019
On TB 1.1.0:
Updating a product's category on CSV Import does not set the new category as default.
This affects product breadcrumb display - where it still shows the previous category breadcrumb.
Similar ticket on PS 1.7 forum with a solution - the solution was integrated into PS 1.7
Tickets on PS:
PrestaShop/PrestaShop#10930
PrestaShop/PrestaShop#10930
There is a temporary solution to modify the code in AdminImportController.php, but this will always update the product's category to default. I've been informed that some users may not want this to happen. The user on the PS forum as well as Ninja on the TB forum have suggested a compromise solution where the User can choose if he wants this to happen. Either by a new column on the CSV file or by a new button on the Import screen.
Link to the original issue on the TB forum:
https://forum.thirtybees.com/topic/3478-should-solution-be-integrated-into-tb-solved-please-help-csv-product-import-problem-moving-category-issue-product-breadcrumb-not-updating-default-category-issue/#comment-30590
Ninja's comment:
https://forum.thirtybees.com/topic/3478-should-solution-be-integrated-into-tb-solved-please-help-csv-product-import-problem-moving-category-issue-product-breadcrumb-not-updating-default-category-issue/?do=findComment&comment=30476
Tempory solution or code that sets new category as default on CSV Import:
The code has the following effect:
On CSV Import, the product's category is updated, the product's breadcrumb is updated and the "default category" is updated and reflects in the backend 🙂
How to update:
In AdminImportController.php:
Find: // Will update default category if there is none set here. Home if no category at all.
Change code to:
As this is one of my first issue posts, please point out any issues or improvements that I can make on future issue posts. Thanks :)
The text was updated successfully, but these errors were encountered: