Service field in Creating new Content?

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

Service field in Creating new Content?

krishan.babbar
Hi All,

What is the purpose of Service field in “Add Content” page?

Actually I want to implement following:
1. Show 2-3 blocks (in product details page on right side) or even more by adding later through admin panel (like popular products, recently sold, accessories etc.) having different products.
2. Similarly, we want to show a daily deal product’s block and a featured video’s block on right side of home page.
3. We want to manage this through admin or CMS so that we may not need to change any code. What would be the best way so that we can change everything from admin without changing code and without restarting the server?

Looking forward for your comments or any reference URLs.

With Regards,
Krishan Babbar | Sr. Software Engineer
+91-946-303-0996
Paxcel Technologies Pvt. Ltd. Passion for Excellence
----------------------------------------------------------------------------------------------------------------------------
Disclaimer: This email and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended even if addressed incorrectly. If you received this email in error please notify the sender, do not disclose, copy, distribute or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this email is prohibited. Thank you for your compliance.
Reply | Threaded
Open this post in threaded view
|

Re: Service field in Creating new Content?

Robert Gan
hey Krishan,

for product blocks on start page or site you can use f.ex. the "bestselling", "mostpopular" kategories when you connect a catalog.

If you do not want that, you have to code a new type by your self, or do it like giving the product an attribute like "deal" etc. than implement on the site, that a special block shall show all products with the attribute "deal"...maybe randomly, if you have more products as the block size..

deal products are not a problem. I just did it like that:
create a normal product, create a price rule named "deal" than ask in the productdetail, or wherever you want if its a "deal" product or a deal category. Than calculate the actual server time with the endtime of the pricerule, so you get the time left of this offer. After that you can implement a counter f.ex. with java script. thats it...

(sorry to long for a step by step manual, but if questions, just ask)

what do you want to manage with admin panel...this is impossible...you have for every special which is not ootb in ofbiz to implement the functions. If you did this with a little thinking, after that you can do all with the admin panel, but you need to code before...
Reply | Threaded
Open this post in threaded view
|

Re: Service field in Creating new Content?

krishan.babbar
Ok,

Thanks Robert

With Regards,
Krishan Babbar

-----Original Message-----
From: Robert G.
Sent: Tuesday, June 26, 2012 7:01 PM
To: [hidden email]
Subject: Re: Service field in Creating new Content?

hey Krishan,

for product blocks on start page or site you can use f.ex. the
"bestselling", "mostpopular" kategories when you connect a catalog.

If you do not want that, you have to code a new type by your self, or do it
like giving the product an attribute like "deal" etc. than implement on the
site, that a special block shall show all products with the attribute
"deal"...maybe randomly, if you have more products as the block size..

deal products are not a problem. I just did it like that:
create a normal product, create a price rule named "deal" than ask in the
productdetail, or wherever you want if its a "deal" product or a deal
category. Than calculate the actual server time with the endtime of the
pricerule, so you get the time left of this offer. After that you can
implement a counter f.ex. with java script. thats it...

(sorry to long for a step by step manual, but if questions, just ask)

what do you want to manage with admin panel...this is impossible...you have
for every special which is not ootb in ofbiz to implement the functions. If
you did this with a little thinking, after that you can do all with the
admin panel, but you need to code before...

--
View this message in context:
http://ofbiz.135035.n4.nabble.com/Service-field-in-Creating-new-Content-tp4634117p4634123.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Service field in Creating new Content?

Robert Gan
f.ex to get the pricerule name and check if its a deal and calculate the rest time i did this:

<nabble_embed> priceRules = PriceServices.makeProducePriceRuleList(delegator, true, productId, "", "", "", "", "", ""); //list if(priceRules){ endDatum = EntityUtil.getFirst(priceRules).get("thruDate").getTime(); startDatum = EntityUtil.getFirst(priceRules).get("fromDate").getTime(); zeitraum = endDatum-startDatum; systemZeit = (new java.util.Date()).getTime(); if ((systemZeit > startDatum) && (systemZeit < endDatum)) { //Preisregel ist aktiv! if (EntityUtil.getFirst(priceRules).containsValue("DEAL")) { //ist Deal Angebot verbleibendeZeit = ((endDatum-systemZeit)/1000).toBigInteger(); tage = null; stunden = null; minuten = null; sekunden = null; //umrechnen if (verbleibendeZeit >=86400) { tage = (verbleibendeZeit / 86400).toBigInteger(); verbleibendeZeit = verbleibendeZeit-(tage * 86400); if (tage < 10) { tage = "0"+tage } } if (verbleibendeZeit >=3600) { stunden = (verbleibendeZeit / 3600).toBigInteger(); verbleibendeZeit = verbleibendeZeit-(stunden * 3600); if (stunden < 10) { stunden = "0"+stunden } } if (verbleibendeZeit >=60) { minuten = (verbleibendeZeit / 60).toBigInteger(); verbleibendeZeit = verbleibendeZeit-(minuten * 60); if (minuten < 10) { minuten = "0"+minuten } } if (verbleibendeZeit < 60) { sekunden = verbleibendeZeit if (sekunden < 10) { sekunden = "0"+sekunden } } if (tage==null) { tage = "00"; } if (stunden==null) { stunden = "00"; } if (minuten==null) { minuten = "00"; } if (sekunden==null) { sekunden = "00"; } context.put("deal", "true"); context.put("zeitPdetailCountdown", tage+":"+stunden+":"+minuten+":"+sekunden); context.put("pdetailCountdownTime", "pdetailCountdownTime_"+productId); } } } </nabble_embed>

this is the part of the groovy file...than yo can call the context data in the ftl file...
Reply | Threaded
Open this post in threaded view
|

Re: Service field in Creating new Content?

Robert Gan
sorry, it was not formated:

priceRules = PriceServices.makeProducePriceRuleList(delegator, true, productId, "", "", "", "", "", ""); //list
   
   if(priceRules){
           endDatum = EntityUtil.getFirst(priceRules).get("thruDate").getTime();
           startDatum = EntityUtil.getFirst(priceRules).get("fromDate").getTime();
           zeitraum = endDatum-startDatum;
           systemZeit = (new java.util.Date()).getTime();
           
           if ((systemZeit > startDatum) && (systemZeit < endDatum)) { //Preisregel ist aktiv!
                   if (EntityUtil.getFirst(priceRules).containsValue("DEAL")) { //ist Deal Angebot
                         
                      verbleibendeZeit = ((endDatum-systemZeit)/1000).toBigInteger();
                         
                          tage = null;
                          stunden = null;
                          minuten = null;
                          sekunden = null;
                         
                          //umrechnen
                          if (verbleibendeZeit >=86400) {
                                  tage = (verbleibendeZeit / 86400).toBigInteger();
                                  verbleibendeZeit = verbleibendeZeit-(tage * 86400);
                                  if (tage < 10) {
                                          tage = "0"+tage
                                  }
                          }
                         
                          if (verbleibendeZeit >=3600) {
                                  stunden = (verbleibendeZeit / 3600).toBigInteger();
                                  verbleibendeZeit = verbleibendeZeit-(stunden * 3600);
                                  if (stunden < 10) {
                                          stunden = "0"+stunden
                                  }
                          }
                         
                          if (verbleibendeZeit >=60) {
                                  minuten = (verbleibendeZeit / 60).toBigInteger();
                                  verbleibendeZeit = verbleibendeZeit-(minuten * 60);
                                  if (minuten < 10) {
                                          minuten = "0"+minuten
                                  }
                          }
                         
                          if (verbleibendeZeit < 60) {
                                  sekunden = verbleibendeZeit
                                  if (sekunden < 10) {
                                          sekunden = "0"+sekunden
                                  }  
                          }
                         
                          if (tage==null) {
                                  tage = "00";
                          }
                         
                          if (stunden==null) {
                                  stunden = "00";
                          }
                         
                          if (minuten==null) {
                                          minuten = "00";
                          }
                         
                          if (sekunden==null) {
                                  sekunden = "00";
                          }
                         
                          context.put("deal", "true");
                          context.put("zeitPdetailCountdown", tage+":"+stunden+":"+minuten+":"+sekunden);
                          context.put("pdetailCountdownTime", "pdetailCountdownTime_"+productId);
                         
                         
                   }
           }
   }