예제 #1
0
    def getPaymentPrices(self):
        """
        """
        shop = IShopManagement(self.context).getShop()
        pp = IPaymentPriceManagement(shop)
        cm = ICurrencyManagement(shop)

        result = []
        for payment_price in pp.getPaymentPrices():

            price = cm.priceToString(payment_price.getPrice())

            result.append(
                {
                    "id": payment_price.getId(),
                    "title": payment_price.Title(),
                    "price": price,
                    "url": payment_price.absolute_url(),
                    "up_url": "%s/es_folder_position?position=up&id=%s"
                    % (self.context.absolute_url(), payment_price.getId()),
                    "down_url": "%s/es_folder_position?position=down&id=%s"
                    % (self.context.absolute_url(), payment_price.getId()),
                    "amount_of_criteria": self._getAmountOfCriteria(payment_price.getId()),
                }
            )

        return result
예제 #2
0
    def getPaymentPrices(self):
        """
        """
        shop = IShopManagement(self.context).getShop()
        pp = IPaymentPriceManagement(shop)
        cm = ICurrencyManagement(shop)

        result = []
        for payment_price in pp.getPaymentPrices():

            price = cm.priceToString(payment_price.getPrice())

            result.append({
                "id":
                payment_price.getId(),
                "title":
                payment_price.Title(),
                "price":
                price,
                "url":
                payment_price.absolute_url(),
                "up_url":
                "%s/es_folder_position?position=up&id=%s" %
                (self.context.absolute_url(), payment_price.getId()),
                "down_url":
                "%s/es_folder_position?position=down&id=%s" %
                (self.context.absolute_url(), payment_price.getId()),
                "amount_of_criteria":
                self._getAmountOfCriteria(payment_price.getId())
            })

        return result
 def testGetPaymentPrices(self):
     """
     """
     pp = IPaymentPriceManagement(self.shop)
     ids = [pp.getId() for pp in pp.getPaymentPrices()]
     self.assertEqual(ids, ["default"])
 def testGetPaymentPrices(self):
     """
     """            
     pp = IPaymentPriceManagement(self.shop)
     ids = [pp.getId() for pp in pp.getPaymentPrices()]
     self.assertEqual(ids, ["default"])