Add sub categories under categories in shop page - prestashop

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.

Related

CSV Imported categories not listed in PrestaShop Catolog->Categories

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.

How to show category name of classified listing in social engine

i am working on social engine create a form in admin panel to post ad its display in frontend but when i add category all fields are dispaly but category not show how to show category name on my ad listing..
This is my listing frontend...
This is my form to crete ad..in frontend
This is my category which is add from backend and dispaly in frontend form when you create ad then choose category ...
So please suggest me how to show my category in my ad listing..
Hope the below answer will helps you.
$categoryObject = Engine_Api::_()->getDbtable('categories', 'classified')->find($classified->category_id)->current();
$categoryName = $categoryObject->category_name;
** In above code $classified is the object of Classified_Model_Classified class. You can also optimize the above code if you want to use the category name only (you need to fetch the category name only).
** I am assuming that your are using the SocialEngine - Classified module and you did not do any modification in given structure by SocialEngine, because in this case the below answer may leads to error.

Bigcommerce - add category name to product page layout

I'm changing a theme in Bigcommerce, and I should put the product Category name in Product page layout, but there isn't any panel that could do that, and I don't really know is it possible?
I can get the list of all categories, but that's not what I want, and I would like to do it without unecessary JavaScript.
So, for example..
I have few categories, and when I'm in each of that categories product, this product category should be writen.
Category - Product - Headline ( should be writen in this page )
Car - Honda - Car
Cloth - Shirt - Cloth
etc..
If anyone knows how it can be made, it would be very appreciated.
Thanks!
I believe the only place the category is pulled onto the product page is through the product breadcrumbs. You could use a simple Javascript to get the category set in the product breadcrumbs and then display it somewhere else.
Something like
Get breadcrumbs
Find the item before the ones that matches the product name
Set it's text as a variable
Set the element where you actually want the cat name to appear to contain the text of the var

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.