retrieve one specific category

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

retrieve one specific category

Antony Adopo
Hello ofbizers,
please. I want to display all products of my "new products"category in my
home page.
So I created a category with "NEW_PRODUCT" as ID.
my problem:
how to retrieve this category and all products members to display in my
home page? I rode doc but methods are not well documented to understand
what method used.

please could you answer me with a code?

thanks
Reply | Threaded
Open this post in threaded view
|

Re: retrieve one specific category

hans_bakker
Hi Antony

the really big advantage of open source is that you can see how it is
done in the existing application. Study the e-commerce component and
find out how the products are displayed on the home page?

Do similar with your category or simply re-use the existing code?

Regards,
Hans

-- AntWebsystems.com quality services with competitive rates....



On 11/08/2013 05:29 AM, Antony Adopo wrote:

> Hello ofbizers,
> please. I want to display all products of my "new products"category in my
> home page.
> So I created a category with "NEW_PRODUCT" as ID.
> my problem:
> how to retrieve this category and all products members to display in my
> home page? I rode doc but methods are not well documented to understand
> what method used.
>
> please could you answer me with a code?
>
> thanks
>

Reply | Threaded
Open this post in threaded view
|

Re: retrieve one specific category

Imac
Hans,

I follow this list fairly regularly but being a beginner unfortunately I
can't contribute as much as I would like. However, after reading your
response, I feel a comment is necessary.

Your response is counter productive at best and completely insulting and I
would recommend that if this is the most constructive thing you have to
say, do us a favour and just keep it to yourself.

I'm not sure way you would waste everyones time and inbox space with such
a useless response. Is it that perhaps you think yourself above helping
anyone or that we are simply wasting your time by asking such trivial
questions and that Ofbiz should best be left to great experts like
yourself?

You are right when you say OpenSource is great. And what makes it great
is, it is COMMUNITY EFFORT and not just that you can look at the source
code.

Just my two cents



On 11/8/13 2:50 AM, "Hans Bakker" <[hidden email]> wrote:

>Hi Antony
>
>the really big advantage of open source is that you can see how it is
>done in the existing application. Study the e-commerce component and
>find out how the products are displayed on the home page?
>
>Do similar with your category or simply re-use the existing code?
>
>Regards,
>Hans
>
>-- AntWebsystems.com quality services with competitive rates....
>
>
>
>On 11/08/2013 05:29 AM, Antony Adopo wrote:
>> Hello ofbizers,
>> please. I want to display all products of my "new products"category in
>>my
>> home page.
>> So I created a category with "NEW_PRODUCT" as ID.
>> my problem:
>> how to retrieve this category and all products members to display in my
>> home page? I rode doc but methods are not well documented to understand
>> what method used.
>>
>> please could you answer me with a code?
>>
>> thanks
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: retrieve one specific category

Jacques Le Roux
Administrator
In reply to this post by Antony Adopo
By default the PROMOTIONS caegory is the one you have to associate your product with for them to show on the main page
https://demo-trunk.ofbiz.apache.org/catalog/control/EditCategory?productCategoryId=PROMOTIONS

This is documented in the
https://cwiki.apache.org/confluence/display/OFBENDUSER/Apache+OFBiz+Business+Setup+Guide
section "Catalog, Category, Product Setup", Point 2 of the 2nd list

Note that, like in most case where it's possible in OFBiz, categories are related by graphes not trees, so you can assign many categories to a product to get the wanted effect. This is explained in this section.
I know you speak French, so you can also have a look at something I wrote long ago here http://www.les7arts.com/assist/OFBiz/Creation%20Catalogue%20de%20produits.htm section "Création des Catégories d'articles"

Unfortunately I never completed this work, to few technical audience in France

HTH

Jacques

Antony Adopo wrote:

> Hello ofbizers,
> please. I want to display all products of my "new products"category in my
> home page.
> So I created a category with "NEW_PRODUCT" as ID.
> my problem:
> how to retrieve this category and all products members to display in my
> home page? I rode doc but methods are not well documented to understand
> what method used.
>
> please could you answer me with a code?
>
> thanks
Reply | Threaded
Open this post in threaded view
|

Re: retrieve one specific category

Jacques Le Roux
Administrator
In reply to this post by Imac
Yes, you are right, I try to keep quiet when I have nothing to say, but sometimes you can't resist to send a RTFM.

When for instance it's late and you are stuck with an issue a client is waiting for tomorrow morning, fill your case... ;)

BTW It's good to sentence others, but it's better to help them
I also can feel you had something to say, so you are welcome.

Jacques

On Friday, November 08, 2013 7:20 AM [GMT+1=CET],
Imac <[hidden email]> wrote:

> Hans,
>
> I follow this list fairly regularly but being a beginner unfortunately I
> can't contribute as much as I would like. However, after reading your
> response, I feel a comment is necessary.
>
> Your response is counter productive at best and completely insulting and I
> would recommend that if this is the most constructive thing you have to
> say, do us a favour and just keep it to yourself.
>
> I'm not sure way you would waste everyones time and inbox space with such
> a useless response. Is it that perhaps you think yourself above helping
> anyone or that we are simply wasting your time by asking such trivial
> questions and that Ofbiz should best be left to great experts like
> yourself?
>
> You are right when you say OpenSource is great. And what makes it great
> is, it is COMMUNITY EFFORT and not just that you can look at the source
> code.
>
> Just my two cents
>
>
>
> On 11/8/13 2:50 AM, "Hans Bakker" <[hidden email]> wrote:
>
>> Hi Antony
>>
>> the really big advantage of open source is that you can see how it is
>> done in the existing application. Study the e-commerce component and
>> find out how the products are displayed on the home page?
>>
>> Do similar with your category or simply re-use the existing code?
>>
>> Regards,
>> Hans
>>
>> -- AntWebsystems.com quality services with competitive rates....
>>
>>
>>
>> On 11/08/2013 05:29 AM, Antony Adopo wrote:
>>> Hello ofbizers,
>>> please. I want to display all products of my "new products"category in
>>> my
>>> home page.
>>> So I created a category with "NEW_PRODUCT" as ID.
>>> my problem:
>>> how to retrieve this category and all products members to display in my
>>> home page? I rode doc but methods are not well documented to understand
>>> what method used.
>>>
>>> please could you answer me with a code?
>>>
>>> thanks
Reply | Threaded
Open this post in threaded view
|

Re: retrieve one specific category

Rishi Solanki
In reply to this post by Imac
Antony Adopo,

Add your NEW_PRODUCT category to your catalog using the ProdCatalogCategory
as type PCCT_PROMOTION and then use
CatalogWorker.getCatalogPromotionsCategoryId to get the specific category.
Similar is done at the ecommerce home page what Hans suggested. Please let
me know if more information required.

Imac,

That is fine if you don't want to dig into the code as per community
suggestion but you should not comment like this for one who is getting some
time to help someone. It could be rephrase like "Could you please provide
more pointers .... or something like that". It might be possible that Hans
hint give opportunity to someone to get the answers of all of his/her
hidden questions. So please do not reply unnecessarily to a thread to show
your frustration whenever required please resend the your query for further
discussion or clarification.

Everyone on community would be happy to help further.


Rishi Solanki
Manager, Enterprise Software Development
HotWax Media Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxmedia.com


On Fri, Nov 8, 2013 at 11:50 AM, Imac <[hidden email]> wrote:

> Hans,
>
> I follow this list fairly regularly but being a beginner unfortunately I
> can't contribute as much as I would like. However, after reading your
> response, I feel a comment is necessary.
>
> Your response is counter productive at best and completely insulting and I
> would recommend that if this is the most constructive thing you have to
> say, do us a favour and just keep it to yourself.
>
> I'm not sure way you would waste everyones time and inbox space with such
> a useless response. Is it that perhaps you think yourself above helping
> anyone or that we are simply wasting your time by asking such trivial
> questions and that Ofbiz should best be left to great experts like
> yourself?
>
> You are right when you say OpenSource is great. And what makes it great
> is, it is COMMUNITY EFFORT and not just that you can look at the source
> code.
>
> Just my two cents
>
>
>
> On 11/8/13 2:50 AM, "Hans Bakker" <[hidden email]> wrote:
>
> >Hi Antony
> >
> >the really big advantage of open source is that you can see how it is
> >done in the existing application. Study the e-commerce component and
> >find out how the products are displayed on the home page?
> >
> >Do similar with your category or simply re-use the existing code?
> >
> >Regards,
> >Hans
> >
> >-- AntWebsystems.com quality services with competitive rates....
> >
> >
> >
> >On 11/08/2013 05:29 AM, Antony Adopo wrote:
> >> Hello ofbizers,
> >> please. I want to display all products of my "new products"category in
> >>my
> >> home page.
> >> So I created a category with "NEW_PRODUCT" as ID.
> >> my problem:
> >> how to retrieve this category and all products members to display in my
> >> home page? I rode doc but methods are not well documented to understand
> >> what method used.
> >>
> >> please could you answer me with a code?
> >>
> >> thanks
> >>
> >
> >
>
>
>
Reply | Threaded
Open this post in threaded view
|

RE: retrieve one specific category

Antony Adopo
In reply to this post by Antony Adopo
Ok. Thanks for all your answers. After bugs, I remembered that I could deals with  promotions category.
But I succeeded to retrieve members. The main problem was gettin ProductContentWrapper on my "shownewproducts.ftl" to retrieve each product contents but I think that I can use an intermediary .groovy file to passed my ProductContentWrapper.
I will share my little code since tomorrow When I will go back to home.

But Your solutions are more clever.Thanks you very much
About response. I would apologize to  every one. Ofbiz could be a little bit complicated for beginner. But one thing to improve very kikcly is asking questions on this ML. Even these are easy or difficult. And when people give you solutions, you are so happy that you continue to go deeply and obtain a great application. And the best way to attract more people is to help on little thing. This will maintain them.
And to answer to Hans, to better understand eCommerce app, I copy the eCommerce folder in my hot deploy folder to go deeply instead of follow tracking of svn. And when I ask, it's means  I have bugged since at least 3 or 4 hours.
About France or French community, if a day, Jacques, you decide to create a great community of ofbizers in France, you can contact me.
Thanks for all

-----Message d'origine-----
De : "Rishi Solanki" <[hidden email]>
Envoyé : ‎08/‎11/‎2013 09:14
À : "ofbizuser" <[hidden email]>
Objet : Re: retrieve one specific category

Antony Adopo,

Add your NEW_PRODUCT category to your catalog using the ProdCatalogCategory
as type PCCT_PROMOTION and then use
CatalogWorker.getCatalogPromotionsCategoryId to get the specific category.
Similar is done at the ecommerce home page what Hans suggested. Please let
me know if more information required.

Imac,

That is fine if you don't want to dig into the code as per community
suggestion but you should not comment like this for one who is getting some
time to help someone. It could be rephrase like "Could you please provide
more pointers .... or something like that". It might be possible that Hans
hint give opportunity to someone to get the answers of all of his/her
hidden questions. So please do not reply unnecessarily to a thread to show
your frustration whenever required please resend the your query for further
discussion or clarification.

Everyone on community would be happy to help further.


Rishi Solanki
Manager, Enterprise Software Development
HotWax Media Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxmedia.com


On Fri, Nov 8, 2013 at 11:50 AM, Imac <[hidden email]> wrote:

> Hans,
>
> I follow this list fairly regularly but being a beginner unfortunately I
> can't contribute as much as I would like. However, after reading your
> response, I feel a comment is necessary.
>
> Your response is counter productive at best and completely insulting and I
> would recommend that if this is the most constructive thing you have to
> say, do us a favour and just keep it to yourself.
>
> I'm not sure way you would waste everyones time and inbox space with such
> a useless response. Is it that perhaps you think yourself above helping
> anyone or that we are simply wasting your time by asking such trivial
> questions and that Ofbiz should best be left to great experts like
> yourself?
>
> You are right when you say OpenSource is great. And what makes it great
> is, it is COMMUNITY EFFORT and not just that you can look at the source
> code.
>
> Just my two cents
>
>
>
> On 11/8/13 2:50 AM, "Hans Bakker" <[hidden email]> wrote:
>
> >Hi Antony
> >
> >the really big advantage of open source is that you can see how it is
> >done in the existing application. Study the e-commerce component and
> >find out how the products are displayed on the home page?
> >
> >Do similar with your category or simply re-use the existing code?
> >
> >Regards,
> >Hans
> >
> >-- AntWebsystems.com quality services with competitive rates....
> >
> >
> >
> >On 11/08/2013 05:29 AM, Antony Adopo wrote:
> >> Hello ofbizers,
> >> please. I want to display all products of my "new products"category in
> >>my
> >> home page.
> >> So I created a category with "NEW_PRODUCT" as ID.
> >> my problem:
> >> how to retrieve this category and all products members to display in my
> >> home page? I rode doc but methods are not well documented to understand
> >> what method used.
> >>
> >> please could you answer me with a code?
> >>
> >> thanks
> >>
> >
> >
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: retrieve one specific category

Antony Adopo
In reply to this post by Antony Adopo
ok, this an way to retrieve category:

catalogId = CatalogWorker.getCurrentCatalogId(request);

if (UtilValidate.isNotEmpty(catalogId)) {
newProductCat=delegator.findByPrimaryKeyCache("ProductCategory",
UtilMisc.toMap("productCategoryId","NEW_PRODUCTS"));
}
productCategoryId=newProductCat.getString("productCategoryId")


2013/11/8 Antony ADOPO <[hidden email]>

>  Ok. Thanks for all your answers. After bugs, I remembered that I could
> deals with  promotions category.
> But I succeeded to retrieve members. The main problem was gettin
> ProductContentWrapper on my "shownewproducts.ftl" to retrieve each product
> contents but I think that I can use an intermediary .groovy file to passed
> my ProductContentWrapper.
> I will share my little code since tomorrow When I will go back to home.
>
> But Your solutions are more clever.Thanks you very much
> About response. I would apologize to  every one. Ofbiz could be a little
> bit complicated for beginner. But one thing to improve very kikcly is
> asking questions on this ML. Even these are easy or difficult. And when
> people give you solutions, you are so happy that you continue to go deeply
> and obtain a great application. And the best way to attract more people is
> to help on little thing. This will maintain them.
> And to answer to Hans, to better understand eCommerce app, I copy the
> eCommerce folder in my hot deploy folder to go deeply instead of follow
> tracking of svn. And when I ask, it's means  I have bugged since at least 3
> or 4 hours.
> About France or French community, if a day, Jacques, you decide to create
> a great community of ofbizers in France, you can contact me.
> Thanks for all
>  ------------------------------
> De : Rishi Solanki <[hidden email]>
> Envoyé : 08/11/2013 09:14
> À : ofbizuser <[hidden email]>
> Objet : Re: retrieve one specific category
>
> Antony Adopo,
>
> Add your NEW_PRODUCT category to your catalog using the ProdCatalogCategory
> as type PCCT_PROMOTION and then use
> CatalogWorker.getCatalogPromotionsCategoryId to get the specific category.
> Similar is done at the ecommerce home page what Hans suggested. Please let
> me know if more information required.
>
> Imac,
>
> That is fine if you don't want to dig into the code as per community
> suggestion but you should not comment like this for one who is getting some
> time to help someone. It could be rephrase like "Could you please provide
> more pointers .... or something like that". It might be possible that Hans
> hint give opportunity to someone to get the answers of all of his/her
> hidden questions. So please do not reply unnecessarily to a thread to show
> your frustration whenever required please resend the your query for further
> discussion or clarification.
>
> Everyone on community would be happy to help further.
>
>
> Rishi Solanki
> Manager, Enterprise Software Development
> HotWax Media Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxmedia.com
>
>
> On Fri, Nov 8, 2013 at 11:50 AM, Imac <[hidden email]> wrote:
>
> > Hans,
> >
> > I follow this list fairly regularly but being a beginner unfortunately I
> > can't contribute as much as I would like. However, after reading your
> > response, I feel a comment is necessary.
> >
> > Your response is counter productive at best and completely insulting and
> I
> > would recommend that if this is the most constructive thing you have to
> > say, do us a favour and just keep it to yourself.
> >
> > I'm not sure way you would waste everyones time and inbox space with such
> > a useless response. Is it that perhaps you think yourself above helping
> > anyone or that we are simply wasting your time by asking such trivial
> > questions and that Ofbiz should best be left to great experts like
> > yourself?
> >
> > You are right when you say OpenSource is great. And what makes it great
> > is, it is COMMUNITY EFFORT and not just that you can look at the source
> > code.
> >
> > Just my two cents
> >
> >
> >
> > On 11/8/13 2:50 AM, "Hans Bakker" <[hidden email]> wrote:
> >
> > >Hi Antony
> > >
> > >the really big advantage of open source is that you can see how it is
> > >done in the existing application. Study the e-commerce component and
> > >find out how the products are displayed on the home page?
> > >
> > >Do similar with your category or simply re-use the existing code?
> > >
> > >Regards,
> > >Hans
> > >
> > >-- AntWebsystems.com quality services with competitive rates....
> > >
> > >
> > >
> > >On 11/08/2013 05:29 AM, Antony Adopo wrote:
> > >> Hello ofbizers,
> > >> please. I want to display all products of my "new products"category in
> > >>my
> > >> home page.
> > >> So I created a category with "NEW_PRODUCT" as ID.
> > >> my problem:
> > >> how to retrieve this category and all products members to display in
> my
> > >> home page? I rode doc but methods are not well documented to
> understand
> > >> what method used.
> > >>
> > >> please could you answer me with a code?
> > >>
> > >> thanks
> > >>
> > >
> > >
> >
> >
> >
>