KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: Anni on November 23, 2007, 10:36:09 am

Title: possible to show only specific category at page "home"?
Post by: Anni on November 23, 2007, 10:36:09 am
hi everyone,

for the shop I'm working on I only want to display products of a specific (sub-)category on the shop home. is it possible to do that without hard-coding the category id into the corresponding jsp?

thanks in advance,
anni
Title: Re: possible to show only specific category at page "home"?
Post by: julie on November 23, 2007, 10:50:44 am
Hi Anni,

Another alternative you have is to call the getCats() method of com.konakart.al.CategoryMgr and to traverse the hierarchical tree to attempt to match a name.

Regards,

Julie
Title: Re: possible to show only specific category at page "home"?
Post by: Anni on November 23, 2007, 10:55:11 am
hi julie,

thanks for the reply  :) that's probably just what I need.

regards,

anni
Title: Re: possible to show only specific category at page "home"?
Post by: Anni on November 26, 2007, 09:58:41 am
hi,

is there a method getName() for categories?

regards,
anni
Title: Re: possible to show only specific category at page "home"?
Post by: Anni on November 26, 2007, 10:05:49 am
oh, nevermind, I just found it in another jsp.

but how do I get the subcategories once I'm in a certain category??

regards,
anni
Title: Re: possible to show only specific category at page "home"?
Post by: julie on November 26, 2007, 10:08:35 am
Hi Anni,

Please look at the Javadoc http://www.konakart.com/javadoc/server/ . You'll see that there is a getChildren() method.

Regards,

Julie
Title: Re: possible to show only specific category at page "home"?
Post by: Anni on November 26, 2007, 10:11:26 am
hi julie,

thanks for the link and sorry for being a nuisance. but I didn't know where to find the javadoc before.

thanks again,
anni
Title: Re: possible to show only specific category at page "home"?
Post by: Brian on November 26, 2007, 10:14:49 am
The javadoc is also provided in the download kits - see webapps/javadoc - Brian
Title: Re: possible to show only specific category at page "home"?
Post by: Anni on November 26, 2007, 02:26:09 pm
ok, thanks for the info.

I've seen that there is a method called fetchProductsPerCategory(cat) as part of the products manager. how can I use this? as it's just returning an integer I can't assign it to the prodArray.

or is there a way to do it like this:

<bean:define id="prodArray" name="prodMgr" property="newProducts"/>

Title: Re: possible to show only specific category at page "home"?
Post by: julie on November 26, 2007, 02:39:13 pm
Hi Anni,

It sets the currentProducts attribute of the ProductManager so you can get them by calling getCurrentProducts().
Title: Re: possible to show only specific category at page "home"?
Post by: Anni on November 26, 2007, 02:43:01 pm
hi julie,

is this also possible if I want to specify the category myself? because in my case, there is no category selected, yet.

regards,
anni