def getShippingInfo(self): """ """ sm = IShippingPriceManagement(self.context) shipping_price = sm.getPriceForCustomer() cm = ICurrencyManagement(self.context) price = cm.priceToString(shipping_price) method = IShippingMethodManagement( self.context).getSelectedShippingMethod() return { "price": price, "title": method.Title(), "description": method.Description() }
def getShippingInfo(self): """ """ sm = IShippingPriceManagement(self.context) shipping_price = sm.getPriceForCustomer() cm = ICurrencyManagement(self.context) price = cm.priceToString(shipping_price, suffix=None) method = IShippingMethodManagement( self.context).getSelectedShippingMethod() if method is None: return { "display": False, } else: return { "price": price, "title": method.Title(), "description": method.Description(), "display": len(self.getCartItems()) > 0 }