Hi All,
I don't know if this is the right way of doing this.
if someone can look into it, it will be of great help.
For displaying 3 or more promotional categories, i made these changes -->
1) Main.groovy
*This is the only code.*
--->
import org.ofbiz.product.catalog.*;
catalogId = CatalogWorker.getCurrentCatalogId(request);
CatalogWorker.getCatalogAllPromotionsCategoryId(request, catalogId);
context.productCategoryList = request.getAttribute("productCategoryList");
2) CatalogWorker.java
*This methods i have added*
-->
public static void getCatalogAllPromotionsCategoryId(ServletRequest
request, String prodCatalogId) {
List<GenericValue> productCategoryDetailList =
FastList.newInstance();
List<String> productCategoryList = FastList.newInstance();
List<GenericValue> prodCatalogCategories =
getProdCatalogCategories(request, prodCatalogId, "PCCT_PROMOTIONS");
if (UtilValidate.isNotEmpty(prodCatalogCategories)) {
productCategoryDetailList =
EntityUtil.getAll(prodCatalogCategories);
}
for(int i=0;i<productCategoryDetailList.size();i++){
productCategoryList.add(((productCategoryDetailList.get(i)).getString("productCategoryId").trim()));
System.out.println(i+" position Values Added in JAva
"+productCategoryList.get(i));
}
request.setAttribute("productCategoryList", productCategoryList);
}
3) main.ftl
<#if (requestAttributes.productCategoryList)?exists><#assign
productCategoryList = requestAttributes.productCategoryList></#if>
<#if productCategoryList?has_content>
<#list productCategoryList as productCategoryId>
<div class="bt-showall-div"><a href="#"
class="bt-showall"></a></div>
${productCategoryId}
${request.setAttribute("productCategoryId", productCategoryId)}
<#if requestAttributes.productCategoryId?has_content>
${screens.render("component://ecommerce/widget/CatalogScreens.xml#category-include")}
<#else>
<center><h2>${uiLabelMap.EcommerceNoPROMOTIONCategory}</h2></center>
</#if>
</#list>
</#if>
By doing this i am able to print the Id of cateories on main.flt.
but it's not able to get the products from those categories.
in short,
productCategoryId = request.getAttribute("productCategoryId") ?:
parameters.category_id;
in Category.groovy is not getting anything in request.
Plz help.
Thanks,
Abhijeet Pandey
On Thu, Sep 10, 2009 at 6:58 PM, Abhijeet Pandey
<[email protected]>wrote:
> I tried that but That's not working or may be i am doing someting wrong.
>
>
> Thanks,
> Abhijeet
>
>
>
>
> On Thu, Sep 10, 2009 at 4:13 PM, Jacques Le Roux <
> [email protected]> wrote:
>
>> Did you test Preeti Verma's answer (I did not, not even read, just to
>> check) ?
>>
>> Jacques
>>
>> From: "Abhijeet Pandey" <[email protected]>
>>
>>> Hi Jacques,
>>>
>>>
>>> Can you explain please ?
>>>
>>> Thanks,
>>> Abhijeet
>>>
>>> On Tue, Sep 8, 2009 at 6:01 PM, Jacques Le Roux <
>>> [email protected]> wrote:
>>>
>>> Featured Group == PROMOTIONS category
>>>>
>>>> Jacques
>>>> ----- Original Message -----
>>>> From: Abhijeet Pandey
>>>> To: [email protected]
>>>> Sent: Tuesday, September 08, 2009 12:39 PM
>>>> Subject: Re: Creating Promotion
>>>>
>>>>
>>>> Hi,
>>>>
>>>> i think that is bit different from what is my requirement.
>>>>
>>>> i need to create few Featured Group (Offer of the day, Hot Deal , Etc)
>>>> and
>>>> want to attach few products to it.
>>>>
>>>> just like few products are shown on home page.
>>>> from where it comes? how these products are associated to "Featured
>>>> Products"?
>>>> How i can create more such groups and how i can show data from those
>>>> groups.
>>>>
>>>> Not getting a way out. Any clue for the same ?
>>>>
>>>> Attaching screen shot which will give idea what i want to do exactly.
>>>> Plz help.
>>>>
>>>> Thanks,
>>>>
>>>> Abhijeet
>>>>
>>>>
>>>> On Tue, Sep 8, 2009 at 2:37 PM, Vivek Mishra <
>>>> [email protected]> wrote:
>>>>
>>>> Hello Abhijeet,
>>>>
>>>> This link will help you to understand, how to create promotions in
>>>> OFBiz
>>>> erp.
>>>>
>>>>
>>>>
>>>> http://docs.ofbiz.org/display/OFBENDUSER/Product+and+Catalog+Information+Manager+Role
>>>>
>>>> Thanks and Regards,
>>>> -- Vivek Mishra
>>>>
>>>>
>>>> Abhijeet Pandey wrote:
>>>>
>>>> Hi All,
>>>>
>>>> I want to create few Promotion ( Special offer , Offer of the day,
>>>> Hot
>>>> Deal ) etc and i want to show all these on home page .
>>>>
>>>> just like we have "Featured Products" on home page. i want to create
>>>> and show 4-5 products from above type of promotions on home page and
>>>> give a
>>>> link "Show All" which will take user to page which will have listing of
>>>> all
>>>> products which falls in that promotion.
>>>>
>>>> Can someone guide me how to do this.
>>>>
>>>> Attaching how it will look in attachment.
>>>>
>>>> Plz Help.
>>>>
>>>>
>>>>
>>>> --
>>>> Abhijeet Pandey
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Abhijeet Pandey
>>>>
>>>>
>>>
>>>
>>> --
>>> Abhijeet Pandey
>>>
>>>
>>
>
>
> --
> Abhijeet Pandey
>
--
Abhijeet Pandey