Пример #1
0
    def getInformationPages(self):
        """
        """
        shop = IShopManagement(self.context).getShop()
        im = IInformationManagement(shop)

        result = []
        for information in im.getInformationPages():

            result.append({
                "id":
                information.getId(),
                "title":
                information.Title(),
                "url":
                information.absolute_url(),
                "description":
                information.Description(),
                "up_url":
                "%s/es_folder_position?position=up&id=%s" %
                (self.context.absolute_url(), information.getId()),
                "down_url":
                "%s/es_folder_position?position=down&id=%s" %
                (self.context.absolute_url(), information.getId()),
                "amount_of_criteria":
                len(information.objectIds()),
            })

        return result
Пример #2
0
    def getCancellationInstruction(self):
        """
        """
        shop = IShopManagement(self.context).getShop()
        im = IInformationManagement(shop)

        # TODO: Rename to english
        page = im.getInformationPage("cancellation-instructions")
        return page.getText()
    def getInformationPages(self):
        """
        """
        shop = IShopManagement(self.context).getShop()
        im   = IInformationManagement(shop)
                
        result = []
        for information in im.getInformationPages():
            
            result.append({
                "id"          : information.getId(),
                "title"       : information.Title(),
                "url"         : information.absolute_url(),
                "description" : information.Description(),
                "up_url"      : "%s/es_folder_position?position=up&id=%s" % (self.context.absolute_url(), information.getId()),
                "down_url"    : "%s/es_folder_position?position=down&id=%s" % (self.context.absolute_url(), information.getId()),
                "amount_of_criteria" : len(information.objectIds()),                
            })

        return result
Пример #4
0
    def _information(self):
        """
        """
        shop = IShopManagement(self.context).getShop()
        im = IInformationManagement(shop)

        pvm = IProductVariantsManagement(self.context)

        if pvm.hasVariants() == False:
            information = im.getInformationPagesFor(self.context)
        else:
            product_variant = pvm.getSelectedVariant()

            # First, we try to get information for the selected product variant
            information = im.getInformationPagesFor(product_variant)

            # If nothing is found, we try to get information for parent product
            # variants object.
            if information is None:
                information = im.getInformationPagesFor(self.context)

        return information
Пример #5
0
    def _information(self):
        """
        """
        shop = IShopManagement(self.context).getShop()
        im = IInformationManagement(shop)
        
        pvm = IProductVariantsManagement(self.context)
        
        if pvm.hasVariants() == False:
            information = im.getInformationPagesFor(self.context)
        else:
            product_variant = pvm.getSelectedVariant()

            # First, we try to get information for the selected product variant
            information = im.getInformationPagesFor(product_variant)

            # If nothing is found, we try to get information for parent product 
            # variants object.
            if information is None:
                information = im.getInformationPagesFor(self.context)
            
        return information
Пример #6
0
def mailOrderReceived(order):
    """Sends email to customer that the order has been received.
    """
    shop = IShopManagement(order).getShop()

    # Get TOC
    shop = IShopManagement(order).getShop()
    page = IInformationManagement(shop).getInformationPage(
        "terms-and-conditions")

    # Get sender
    mail_addresses = IMailAddresses(shop)
    sender = mail_addresses.getSender()
    bcc = mail_addresses.getReceivers()

    # Get receiver
    customer = order.getCustomer()
    address = IAddressManagement(customer).getShippingAddress()
    receiver = address.email or customer.email

    if sender and receiver:
        view = getMultiAdapter((order, order.REQUEST),
                               name="mail-order-received")
        text = view()

        # get charset
        props = getToolByName(order, "portal_properties").site_properties
        charset = props.getProperty("default_charset")

        sendMailWithAttachements(
            context=order,
            sender=sender,
            receiver=receiver,
            bcc=bcc,
            subject="Bestellbestätigung %s" % shop.Title(),
            text=text,
            files=[])  # (page.getFile().filename, page.getFile())