Skip to main navigation Skip to main content Skip to page footer

Basket order on invoice

An order has been successfully placed and an order number and invoice number have been assigned. With the payment method "onInvoice," the goods can be shipped before or after payment is received.

The order is binding upon completion of the checkout process. Payment is subsequently made by the customer and manually recorded in the system. The order process is only completed once the payment has been received and—if the goods are physical—shipment has been carried out.

stateDiagram-v2

    %% Frontend
    [*] --> prepared : Customer builds cart\nand starts checkout

    prepared --> ordered : Checkout completed\nConfirmation email\nInvoice number

    %% Purchase on invoice: shipping before or after payment possible
    ordered --> shipped : Shipping before payment\n(optional)
    ordered --> paid : Payment recorded

    %% Order flexible
    shipped --> paid : Payment after shipping
    paid --> shipped : Shipping after payment

    %% Completion
    paid --> processed : Completion without shipping\n(e.g., digital service)
    shipped --> processed : Completion after shipping

    %% Non-payment
    ordered --> canceled_unpaid : No payment\nCancellation

    canceled_unpaid --> processed : Cancellation completed

    %% Conditions
    note right of processed
        Conditions:
        - paid_date MUST be set
        - shipped_date MUST be set
        if shipping has occurred
    end note

Further actions:

  • Returns: Possible as soon as the goods have been shipped – i.e., in the status shipped or processed.
  • Deletion: Deleting an order is only possible in the status prepared.

TypoScript Configuration

plugin.tx_shop.settings.basketOrder {
    orderOptions {
        onInvoice {
            active = {$themes.configuration.extension.shop.checkout.onInvoice.active}
            attachProductFilesToAdminEmail = {$themes.configuration.extension.shop.checkout.onInvoice.attachProductFilesToAdminEmail}
            attachProductFilesToCustomerEmail = {$themes.configuration.extension.shop.checkout.onInvoice.attachProductFilesToCustomerEmail}
            attachInvoiceToAdminEmail = {$themes.configuration.extension.shop.checkout.onInvoice.attachInvoiceToAdminEmail}
            attachInvoiceToCustomerEmail = {$themes.configuration.extension.shop.checkout.onInvoice.attachInvoiceToCustomerEmail}
            attachDeliveryNoteToAdminEmail = {$themes.configuration.extension.shop.checkout.onInvoice.attachDeliveryNoteToAdminEmail}
            attachDeliveryNoteToCustomerEmail = {$themes.configuration.extension.shop.checkout.onInvoice.attachDeliveryNoteToCustomerEmail}
            attachOrderXmlToAdminEmail = {$themes.configuration.extension.shop.checkout.onInvoice.attachOrderXmlToAdminEmail}
            storeOrderXmlInFolder = {$themes.configuration.extension.shop.checkout.onInvoice.storeOrderXmlInFolder}
            storeOrderXmlInFolderName = {$themes.configuration.extension.shop.checkout.onInvoice.storeOrderXmlInFolderName}
            type = onInvoice
            checkoutPid = {$themes.configuration.pages.shop.checkout}
            successPid = {$themes.configuration.pages.shop.checkoutSuccess}
            errorPid = {$themes.configuration.pages.shop.checkoutError}
            service = CodingMs\Shop\Service\Checkout\OnInvoiceCheckoutService
            button {
                title = tx_shop_label.order_on_invoice_button_title
                label = tx_shop_label.order_on_invoice_button_label
                icon = fa fa-shopping-cart
            }
            fields {
                available = {$themes.configuration.extension.shop.checkout.onInvoice.fields.available}
                required = {$themes.configuration.extension.shop.checkout.onInvoice.fields.required}
            }
            status {
                prepared {
                    # Allowed to switch to this status
                    allowed {
                        ordered =
                    }
                }
                ordered {
                    allowed {
                        paid =
                        shipped {
                            # Show marked-as-shipped when not "only digital products" are in basket-order
                            condition {
                                basket = NotContainsDigitalProductsOnly
                            }
                        }
                        canceled_unpaid =
                    }
                }
                shipped {
                    # Hide whole shipped state when "only digital products" are in basket-order
                    hidden {
                        condition {
                            basket = ContainsDigitalProductsOnly
                        }
                    }
                    # Allowed to switch to this status
                    allowed {
                        paid {
                            # But it condition
                            condition {
                                # To have ordered_date not empty – it must be set!
                                ordered_date = NotEmpty
                                paid_date = Empty
                            }
                        }
                        processed {
                            # But it condition
                            condition {
                                # To have paid_date not empty – it must be set!
                                paid_date = NotEmpty
                            }
                        }
                        returned {
                            # Show marked-as-returned when not "only digital products" are in basket-order
                            condition {
                                basket = NotContainsDigitalProductsOnly
                            }
                        }
                    }
                }
                paid {
                    allowed {
                        shipped {
                            condition {
                                ordered_date = NotEmpty
                                shipped_date = Empty
                            }
                        }
                        processed {
                            condition {
                                shipped_date = NotEmpty
                            }
                        }
                    }
                }
                canceled_unpaid {
                    allowed {
                        processed =
                    }
                }
                processed {
                    allowed {
                        returned {
                            # Show marked-as-returned when not "only digital products" are in basket-order
                            condition {
                                basket = NotContainsDigitalProductsOnly
                            }
                        }
                    }
                }
            }
            email {
                customerConfirmation {
                    active = {$themes.configuration.extension.shop.checkout.onInvoice.email.customerConfirmation.active}
                    from {
                        name = {$themes.configuration.extension.shop.email.from.name}
                        email = {$themes.configuration.extension.shop.email.from.email}
                    }
                    to {
                        # Customer address data
                    }
                    template = {$themes.configuration.extension.shop.email.templates.onInvoice.customerConfirmation}
                }
                order {
                    active = {$themes.configuration.extension.shop.checkout.onInvoice.email.order.active}
                    from {
                        name = {$themes.configuration.extension.shop.email.from.name}
                        email = {$themes.configuration.extension.shop.email.from.email}
                    }
                    to {
                        name = {$themes.configuration.extension.shop.email.to.name}
                        email = {$themes.configuration.extension.shop.email.to.email}
                    }
                    template = {$themes.configuration.extension.shop.email.templates.onInvoice.order}
                }
            }
        }
    }
}
Documentation

TYPO3 Shop by coding.ms

An extensive shop for TYPO3 for realizing Webshops, Online-Shops or Payment-Subscriptions, comparable with tt_products, Cart or Aimeos. It includes PayPal, PayPal-Checkout, Klarna, Stripe, Bookmarks, UPS-API, invoice generation, a backend module, compare feature, graduated prices, plus product variants, filters, and tax and shipping logic for practical shop operations.

Menu
Shopping basket 0 Products

The Demo is build with*

EXT:bootstrap_package for site-package aka theme build on Bootsrap 5.

EXT:modules for user plugins like user-profile, registration, user-addresses, and more.

EXT:shop for the whole shop functionality.

EXT:questions for the FAQ page and FAQs attached in the product detail views.

EXT:glossaries for the glossaries and definitions.

EXT:fluid_fpdf for generating invoices, delivery-notes, product-sheets and more.

EXT:parsedown_extra for rendering the extension documentations from markdown to HTML.

* There are only build-in settings made using site-settings & TypoScript – no templates or other files were changed or overridden!