Search code examples
intershop

Getting product price in application level defined currency


I am following this example, and as shown I want to get price of product on ISML using following piece of code (ProductBOPricingExtensionImpl contains method that accepts only price type and currency):

ProductBO:Extension("Pricing"):Price("SalePrice",{currency_here})

Problem is, I don't know how to acquire any currency object to put in there, and the best way it would be to somehow get default/fallback currency defined on application level.


Solution

  • You can print out the price using this module. Also shows how you get the currency

    <isinclude template="modules/Modules">
    ...
    <ISProductPrice 
                ProductBO="#ProductBO#"
                Currency="#CurrentRequest:Currency#"
                ShowInformationalPrice="true"
            >
    

    checkout the documentation in app_sf_responsive/staticfiles/cartridge/templates/default/modules/product/Modules.isml

    It takes different scenarios into account, like if the customer is login and is eligible for a discount.