CSV Imported categories not listed in PrestaShop Catolog->Categories - prestashop

I am using PrestaShop Version 1.6.1.4.
I have created a CSV for Categories and uploaded it successfully but the catogories and the sub-categories are not shown in Catolog->Categories. When I configure a Module "Top Horizontal Menu" in that under Available items Categories can be seen and added to UI as well. When I click on the category in UI 404 error pages comes.
Any idea how to fix this?
Thanks in advance.
The below image is from Top Horizontal Menu Module where JEWELLERY is category and the other below them are sub category.
Thw below image shows that the categories CSV is uploaded successfdully
But it is not listed under Catolog->Categories refer the below image for this

First when I added categories from CSV, the categories is not getting displayed in Catalog->Categories but when I add one category manually then it is displayed in Catalog->Categories but cannot add subcategories to it.
I think there should be some issues in Presta Shop.
For example : I manually added "Testing" as one category. It was added as main category by default. Then both "Home" and "Testing" categories can be seen in Catalog ->Categories.
After this I tried to add the subcategories to "Home" categories through CSV, it worked out.
PrestaShop is expecting the category to be listed in Catalog->Categories to add the subcategories to it even if that particular category is in DB.
Now I can add the sub categories to what ever Main Categories needed and also the products are also getting listed under the subcategories through CSV.
But I dont know why it is not getting added to Catalog->Categories initially when I add from CSV.
Now in DB ps_category table the records are as expected as you have listed.

This is the default Prestashop categories (table ps_category). Please check if you have only one row with is_root_category = 1. This must be a category ID 2 (id_category = 2), your site Home category.
And please check if all three categories ID 1, 2, 3 in your table looks the same in columns id_parent, id_shop_default, level_depth, is_root_category.

Related

In Strapi i can get a specific product but how do I get ALL products?

I set up a product collection type, added three records and in the browser type
localhost:1337/api/products/2 and it correctly displays record 2:
{"data":{"id":2,"attributes":{"title":"Gillette Razor","price":9.99,"description":"/assets/product-images/product-2.png","featured":true,"createdAt":"2022-08-20T12:23:10.685Z","updatedAt":"2022-08-20T12:29:45.062Z","publishedAt":null}},"meta":{}}
(also works for /1 and /3, showing those products).
But, when I try to see ALL products by typing:
localhost:1337/api/products I get:
{"data":[],"meta":{"pagination":{"page":1,"pageSize":25,"pageCount":0,"total":0}}}
I have given "public" access to "find" and "findOne". Server is running. Why is it not producing a list of the three products entered?
The solution was the data has to be "published" (default is "draft") for the /api/products to show all records, even though the /api/products/x had no issue revealing product x details without being published.
After marking the data as published localhost:1337/api/products now gives me ALL of my products:
{"data":[{"id":1,"attributes":{"title":"razor blade","price":1.99,"description":"/assets/product-images/product-1.png","featured":false,"createdAt":"2022-08-20T12:22:12.498Z","updatedAt":"2022-08-20T15:37:08.598Z","publishedAt":"2022-08-20T15:37:08.597Z"}},{"id":2,"attributes":{"title":"Gillette Razor","price":9.99,"description":"/assets/product-images/product-2.png","featured":true,"createdAt":"2022-08-20T12:23:10.685Z","updatedAt":"2022-08-20T15:37:01.649Z","publishedAt":"2022-08-20T15:37:01.648Z"}},{"id":3,"attributes":{"title":"Barber Razor","price":7.99,"description":"/assets/product-images/product-3.png","featured":null,"createdAt":"2022-08-20T12:23:52.749Z","updatedAt":"2022-08-20T15:36:52.579Z","publishedAt":"2022-08-20T15:36:52.577Z"}}],"meta":{"pagination":{"page":1,"pageSize":25,"pageCount":1,"total":3}}}

Add sub categories under categories in shop page

I want to know if that possible to have :
1 section with main categories + 1 section with sub categories under
That mean : I click on 1 category > the sub-category section show all sub-categories of the category.
Natively you can setup the native Category Tree Links module to always show the full
category tree in a single block (with expandable sub-categories of course) despite the context category you are visiting, like follows :
If you want to create two separate blocks, you'll need to heavily modify the module logic.

Showing different price on category page and single product page in variable product in bigcommerce

Showing different price on category page and single product page in variable product in bigcommerce. I just want to show the lowest price on category page.
This is the category page: https://hilineelectronics.com/portable-audio/. In the first product price is showing $112.99 and after checking it quick view and single product page it is showing $83.99. I want $83.99 (varibale amount) amount there.
How can we do this? Any variable or code for this?
Thanks in advance.
Go to your CategoryProductsItem.html check the code
<em class="p-price">%%GLOBAL_ProductPrice%%</em>
Is there %%GLOBAL_ProductPrice%% call same or different with product details page.
ProductDetails.html
<span class="ProductPrice VariationProductPrice">%%GLOBAL_ProductPrice%%</span>
Compare both files global varriable.
The second way makes the backup and of the files and then revert it to the original.

Grails - 2 domains and 1 form create/update/edit issues

Having some mega frustration set in.Maybe Im trying grails too much like rails and active record.
I have 2 domains.The parent is called 'report' and the child 'category'.
The user creates a new report and if they like they can add a category. The report can only have one category. However I would like to allow reports to be sorted by category or listed by category or even counted by category. Yes this column could go into the reports domain but I would like separation for future cases. so below I have my domains;
Domain 1 = Report
class Report
string reportname
string reportype
Domain 2 = category
class Category
Report report
string categoryname
I have 2 controllers, 1 for report 1 for category both with crud methods and no scaffold.
How do I set the view to create/edit/update the category domain while in the report _form?
I have read through the gorm docs, grails docs, others but still am stumbling on this.
Do I need to edit my report controller to handle the category domain? i.e import category and supply category def with each method for /edit/update/create.
Do I need to edit the report form to get the report params and pass this into a hidden field for the category name field so that when a save action is called the category domain commits the cat name and reportId.
Is my model all wrong? I have tried hasone, hasmany belongsto however I need to keep the category separate from the reports because I want to be able to show a page of reports separated by categories and allow only unique category names for a bunch of reports to reduce spelling mistakes in category names. i.e. I want to set a category name and associate it to a report.
New to grails so forgive me. Maybe I need to sit and have a beer and read more.
cheers
There are many ways to handle your scenario. One way to do this is to use redirect in your ReportController and pass in the params to CategoryController.

Expression Engine Related Categories

I've been trying to get a sub navigation going for quite some time, and can't seem to find a solution to my problem.
First things first, here is the closest example of what I'm trying to get my sub nav to do. (the TVs sub nav) http://www.bestbuy.com/site/TV-Home-Theater/Televisions/abcat0101000.c?id=abcat0101000
For example, if I have 3 category Parents (Central, Portable, and Brands), If click on "Central" I would like all of the categories associated with "Centrals & Brands" to appear, leaving out anything to do with "Portable".
Another example, if I click on "Brands" I would like to be able to shop by brand, and have only the "Central & Portable" products related to that brand.
I am currently using GWcode Categories & GWcode CatMenu, to try and get this working.
Thanks in advance!
You may have more luck by replacing the native categories with a Channel Entries + P&T Playa approach.
Create a 'Categories' channel
Add a Playa field to it with related categories (entries) from the categories channel
In your product channel, add a Playa field with categories (entries) from the categories channel.
The TV subnav on the Best Buy site would be recreated by displaying the related categories (mentioned in step 2) to the current viewed category.
{exp:playa:children entry_id="{current_page_category_id}"}
...
{/exp:playa:children}
Your mileage may vary.