Implement product type (digital / physical)
Description
Products that are offered in an online shop can either be physical or digital. Physical products have to be shipped to the customer first whereas digital products can be delivered instantly via download or access (i.e. to a members-only area on your website).
This distinction has to be reflected in the products that are handled in quiqqer/products
.
The following objects must provide a method to get this property:
- Invoice
- Order / OrderInProcess
- Basket
Example:
<?php
$Order->getProductType(); // returns "digital", "physical", "mixed"
During setup, a new standard product field must be created (type Bool; "yes" => is digial, "no" => is physical) with name "Digital Product".
Reasons
Because of the nature of physical products and the need to ship them first, the cash flow from customer to vendor should only be triggered when the product was successfully shipped. For digital products the cash flow can be triggered instantly and does not ne to be delayed.
Payment methods like Amazon Pay require a parameter that states whether a payment should be processed instantly or later on. In order to decide what to tell those payment methods, the product type has to be set in the Order or related objects.