info.magnolia.module.shop.util
Class ShopUtil

java.lang.Object
  extended by info.magnolia.module.shop.util.ShopUtil

public final class ShopUtil
extends Object

Paragraphs util class.

Author:
tmiyar

Field Summary
static String ATTRIBUTE_SHOPNAME
           
static String ATTRIBUTE_SHOPPINGCART
           
static BigDecimal HUNDRED
           
static String I18N_BASENAME
           
static BigDecimal ONE
           
static String SHOP_TEMPLATE_NAME
           
static BigDecimal ZERO
           
 
Method Summary
static javax.jcr.Node getContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot, String category, String subCategory)
           
static javax.jcr.Node getCurrencyByUUID(String uuid)
           
static String getCurrencyFormatting()
           
static String getCurrencyTitle()
           
static info.magnolia.cms.i18n.Messages getMessages()
           
static String getPath(boolean removeEndToken, String... strings)
           
static String getPath(String... strings)
           
static BigDecimal getPriceExcludingTax(BigDecimal priceIncludingTax, BigDecimal taxRate)
           
static BigDecimal getPriceIncludingTax(BigDecimal priceExcludingTax, BigDecimal taxRate)
           
static Collection<info.magnolia.cms.core.Content> getShippingOptions()
           
static double getShippingPriceForOption(info.magnolia.cms.core.Content shippingOption, DefaultShoppingCartImpl cart)
           
static BigDecimal getShippingPriceForOptionBigDecimal(info.magnolia.cms.core.Content shippingOption, DefaultShoppingCartImpl cart)
          Gets the shipping cost from the provided option and for the carts total weight.
static String getShopName()
           
static String getShopName(info.magnolia.cms.core.Content dataNode)
           
static String getShopNameFromPath()
          Used in product dialog, for getting productCategories, productPrices...
static ShoppingCart getShoppingCart()
           
static javax.jcr.Node getShopPriceCategory(ShopConfiguration shopConfiguration)
           
static javax.jcr.Node getShopRoot()
          Gets the shop current node.
static info.magnolia.cms.core.Content getShopRootByShopName(String shopName)
           
static BigDecimal getTax(BigDecimal price, boolean taxIncluded, BigDecimal taxRate)
           
static void setShoppingCartInSession()
           
static Collection<javax.jcr.Node> transformIntoI18nContentList(Collection<javax.jcr.Node> contentList)
           
static javax.jcr.Node wrapWithHTML(javax.jcr.Node node, boolean linebreaks)
           
static javax.jcr.Node wrapWithI18n(javax.jcr.Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_SHOPNAME

public static String ATTRIBUTE_SHOPNAME

ATTRIBUTE_SHOPPINGCART

public static String ATTRIBUTE_SHOPPINGCART

SHOP_TEMPLATE_NAME

public static String SHOP_TEMPLATE_NAME

I18N_BASENAME

public static String I18N_BASENAME

HUNDRED

public static final BigDecimal HUNDRED

ONE

public static final BigDecimal ONE

ZERO

public static final BigDecimal ZERO
Method Detail

getShopRoot

public static javax.jcr.Node getShopRoot()
Gets the shop current node.


getShopRootByShopName

public static info.magnolia.cms.core.Content getShopRootByShopName(String shopName)

getMessages

public static info.magnolia.cms.i18n.Messages getMessages()

setShoppingCartInSession

public static void setShoppingCartInSession()

getShopName

public static String getShopName()

getShopNameFromPath

public static String getShopNameFromPath()
Used in product dialog, for getting productCategories, productPrices... and the storageNode is null.


getShopName

public static String getShopName(info.magnolia.cms.core.Content dataNode)

getShoppingCart

public static ShoppingCart getShoppingCart()

transformIntoI18nContentList

public static Collection<javax.jcr.Node> transformIntoI18nContentList(Collection<javax.jcr.Node> contentList)

getCurrencyTitle

public static String getCurrencyTitle()

getCurrencyFormatting

public static String getCurrencyFormatting()

getShopPriceCategory

public static javax.jcr.Node getShopPriceCategory(ShopConfiguration shopConfiguration)

getCurrencyByUUID

public static javax.jcr.Node getCurrencyByUUID(String uuid)

getPath

public static String getPath(boolean removeEndToken,
                             String... strings)

getPath

public static String getPath(String... strings)

getContentByTemplateCategorySubCategory

public static javax.jcr.Node getContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
                                                                     String category,
                                                                     String subCategory)

wrapWithI18n

public static javax.jcr.Node wrapWithI18n(javax.jcr.Node node)

wrapWithHTML

public static javax.jcr.Node wrapWithHTML(javax.jcr.Node node,
                                          boolean linebreaks)

getShippingOptions

public static Collection<info.magnolia.cms.core.Content> getShippingOptions()

getShippingPriceForOptionBigDecimal

public static BigDecimal getShippingPriceForOptionBigDecimal(info.magnolia.cms.core.Content shippingOption,
                                                             DefaultShoppingCartImpl cart)
Gets the shipping cost from the provided option and for the carts total weight. If no matching price is found in the option, null is returned.

Parameters:
shippingOption -
Returns:
shipping price for the weight of the cart or null

getShippingPriceForOption

public static double getShippingPriceForOption(info.magnolia.cms.core.Content shippingOption,
                                               DefaultShoppingCartImpl cart)
Parameters:
shippingOption -
Returns:

getPriceExcludingTax

public static BigDecimal getPriceExcludingTax(BigDecimal priceIncludingTax,
                                              BigDecimal taxRate)

getPriceIncludingTax

public static BigDecimal getPriceIncludingTax(BigDecimal priceExcludingTax,
                                              BigDecimal taxRate)

getTax

public static BigDecimal getTax(BigDecimal price,
                                boolean taxIncluded,
                                BigDecimal taxRate)


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.