Back to Ideas Shop Support

How to get category name and list products of category in homepage ?

Post a reply
1541 views
manhhp
manhhp

Hello. How to get category name and list products of category in homepage ? Idea: Categories will show in homepage when I selected. I will choose multi categories

ideaspro24728991
ideaspro24728991

Hello Manhhp
To get category list and list product in homepage, you have to create component to get manually
there is no components to do it now
But i can do it in future
Thank you for using my plugin

manhhp
manhhp

I think it is very useful.

I have added an option in the category manager to display on the homepage. But I'm not good at code so I do not know how to do the rest. Hope you will soon update this function.

Your plugin is awesome. Thank you for building and developing it.

rs = []; $categoryId = '1'; //will get list category id $query = Products::where('id', '!=', $id); $query->whereHas('productToCategory', function ($query) use ($categoryId) { $query->where('category_id', $categoryId); }); $rs = $query->limit(4)->get(); $rs = IdeasShop::checkProductCanBuy($rs); $rs = Price::addFinalPriceForProductObject($rs); $rs = $rs->toArray(); return $rs;

ideaspro24728991
ideaspro24728991

Hello manhhp
I created component Category in plugin and update to version 1.0.6
template ideas simple also update to version 1.0.4
You can update plugin and template to see what changed :D

Last updated

manhhp
manhhp

That the good ideas ! (y) But, user don't know id of category @@! I think you can add more id displays in categories management. And as I am doing here is an option to display the category on the home page (link image attached). I think this will be easier for the user, rather than using components. What do you think about this issue ? You can add more as my idea. And keep what you did. It was great ! http://sv1.upsieutoc.com/2018/07/04/Capture35953df8a61859ef.jpg

ideaspro24728991
ideaspro24728991

Well, you can create plugin to add more field in category page (to adapt your requirement)
You can read document here
OctoberCms have great extends system, so we can change many things without change core code of a plugin
Maybe i''ll change this function in future :D

manhhp
manhhp

Can you suggest how to write? I'm not a programmer, I just know a bit. Thanks

ideaspro24728991
ideaspro24728991

Well, i created this function and update plugin to 1.0.7 and theme is 1.0.5
You can update and see what changed :D
Have a nice day :D

manhhp
manhhp

Oh Great ! It is what I want to say. Thank you very much. A great plugin and supporter also great. I love you.

ideaspro24728991

1-10 of 10

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.