You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Sanjeev Gupta <su...@sanjeevg.com> on 2012/06/05 20:15:41 UTC

Re: How to access image associated with Promo

Hi Chandan, 
I'm not sure how to do this in the FTL, can you please guide me.. 

-----
Rgds
Sanjeev
www.sanjeevg.com
@sanjeevgcom
--
View this message in context: http://ofbiz.135035.n4.nabble.com/How-to-access-image-associated-with-Promo-tp4632744p4633261.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: How to access image associated with Promo

Posted by Sanjeev Gupta <su...@sanjeevg.com>.
Thanks Chandan, Viqar !!

-----
Rgds
Sanjeev
www.sanjeevg.com
@sanjeevgcom
--
View this message in context: http://ofbiz.135035.n4.nabble.com/How-to-access-image-associated-with-Promo-tp4632744p4633380.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: How to access image associated with Promo

Posted by mohd Viqar <mh...@gmail.com>.
Hi Sanjeev,

You can use this code in
<ofbizDir>/applications/order/webapp/ordermgr/entry/cart/showAllPromotions.tfl
to see all promotions with promotion images.

<div>
    ${uiLabelMap.OrderSpecialOffers}
    <div>
        <ul>
        <#-- show promotions text -->
        <#list productPromosAllShowable as productPromo>
        	<#assign productPromoContentWrapper =
Static["org.ofbiz.product.product.ProductPromoContentWrapper"].makeProductPromoContentWrapper(productPromo,
request)/>
            <#assign imageUrl =
Static["org.ofbiz.product.product.ProductPromoContentWrapper"].getProductPromoContentAsText(productPromo,
"ORIGINAL_IMAGE_URL", request)?if_exists>
                <#if !imageUrl?string?has_content>
                  <#assign imageUrl =
productPromoContentWrapper.get("ORIGINAL_IMAGE_URL")?if_exists>
                </#if>
                <#if !imageUrl?string?has_content>
                  <#assign imageUrl = "/images/defaultImage.jpg">
                </#if>
            <li><img
src=&quot;&lt;@ofbizContentUrl>${contentPathPrefix?if_exists}${imageUrl}</...@ofbizContentUrl>"
class='cssImgStandard' alt="" /></li>
            <li><a
href=&quot;&lt;@ofbizUrl>showPromotionDetails?productPromoId=${productPromo.productPromoId}</...@ofbizUrl>"
class="button">${uiLabelMap.CommonDetails}
${StringUtil.wrapString(productPromo.promoText?if_exists)}</li>
        </#list>
        </ul>
    </div>
</div>

<#if (shoppingCartSize > 0)>
  ${screens.render(promoUseDetailsInlineScreen)}
</#if>

Regards
Mohd Viqar

--
View this message in context: http://ofbiz.135035.n4.nabble.com/How-to-access-image-associated-with-Promo-tp4632744p4633373.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: How to access image associated with Promo

Posted by Chandan Khandelwal <ch...@hotwaxmedia.com>.
Hi Sanjeev,

Please refer editShoppingList.ftl from ecommerce component

'<#assign productContentWrapper = 
Static["org.ofbiz.product.product.ProductContentWrapper"].makeProductContentWrapper(product, 
request)/>'

you need smiler kind of pattern for ProductPromoContent.

HTH.....

Thanks & Regards
-- 
Chandan Khandelwal
Sr. Enterprise Software Developer
HotWax Media Pvt. Ltd.


On Tuesday 05 June 2012 11:45 PM, Sanjeev Gupta wrote:
> Hi Chandan,
> I'm not sure how to do this in the FTL, can you please guide me..
>
> -----
> Rgds
> Sanjeev
> www.sanjeevg.com
> @sanjeevgcom
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/How-to-access-image-associated-with-Promo-tp4632744p4633261.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>