22. Settings¶
These is the complete list of setting directives available for django-SHOP.
Usage in your own code:
from shop.conf import app_settings
print(app_settings.APP_LABEL)
Note
When using as shown here, you don’t have to prefix the settings property with SHOP_...
.
-
class
shop.conf.
DefaultSettings
¶ -
SHOP_APP_LABEL
¶ The name of the project implementing the shop, for instance
myshop
.This is required to assign the abstract shop models to a project. There is no default.
-
SHOP_DEFAULT_CURRENCY
¶ The default currency this shop is working with. The default is
EUR
.Note
All model- and form input fields can be specified for any other currency, this setting is only used if the supplied currency is missing.
-
SHOP_VENDOR_EMAIL
¶ The vendor’s email addresses, unless specified through the
Order
object.
-
SHOP_MONEY_FORMAT
¶ When rendering an amount of type Money, use this format.
Possible placeholders are:
{symbol}
: This is replaced by €, $, £, etc.{currency}
: This is replaced by Euro, US Dollar, Pound Sterling, etc.{code}
: This is replaced by EUR, USD, GBP, etc.{amount}
: The localized amount.{minus}
: Only for negative amounts, where to put the-
sign.
For further information about formatting currency amounts, please refer to https://docs.microsoft.com/en-us/globalization/locale/currency-formatting
-
SHOP_DECIMAL_PLACES
¶ Number of decimal places for the internal representation of a price. This is purely used by the Django admin and is not the number of digits visible by the customer.
Defaults to 2.
-
SHOP_CUSTOMER_SERIALIZER
¶ Depending on the materialized customer model, use this directive to configure the customer serializer.
Defaults to
shop.serializers.defaults.customer.CustomerSerializer
.
-
SHOP_PRODUCT_SUMMARY_SERIALIZER
¶ Serialize the smallest common denominator of all Product models available in this shop. This serialized data then is used for Catalog List Views, Cart List Views and Order List Views.
Defaults to
shop.serializers.defaults.product_summary.ProductSummarySerializer
.
-
SHOP_PRODUCT_SELECT_SERIALIZER
¶ This serializer is only used by the plugin editors, when selecting a product using a drop down menu with auto-completion.
Defaults to
shop.serializers.defaults.ProductSelectSerializer
.
-
SHOP_MAX_PURCHASE_QUANTITY
¶ The default maximum number of items a customer can add to his cart per product type.
-
SHOP_SELL_SHORT_PERIOD
¶ The time period (in seconds or timedelta) from the current timestamp, in which a product is considered available, although it currently is not in stock, but scheduled to be added to the inventory.
-
SHOP_LIMITED_OFFER_PERIOD
¶ The time period (in seconds or timedelta) from the current timestamp, in which a product is marked as limited time offer.
-
SHOP_LINK_TO_EMPTY_CART
¶ If
True
the link on the cart-icon pointing to the cart is enabled, even if there are no items are in the cart.
-
SHOP_ORDER_ITEM_SERIALIZER
¶ Depending on the materialized OrderItem model, use this directive to configure the serializer.
Defaults to
shop.serializers.defaults.OrderItemSerializer
.
-
SHOP_CART_MODIFIERS
¶ Specifies the list of Cart Modifiers. They are are applied on each cart item and the cart final sums.
This list typically starts with
'shop.modifiers.defaults.DefaultCartModifier'
as its first entry, followed by other cart modifiers.
-
SHOP_VALUE_ADDED_TAX
¶ Use this convenience settings if you can apply the same tax rate for all products and you use one of the default tax modifiers
shop.modifiers.taxes.CartIncludeTaxModifier
orshop.modifiers.taxes.CartExcludedTaxModifier
.If your products require individual tax rates or you ship into states with different tax rates, then you must provide your own tax modifier.
-
SHOP_ORDER_WORKFLOWS
¶ Specifies a list of Order Workflows. Order workflows are applied after an order has been created and conduct the vendor through the steps of receiving the payments until fulfilling the shipment.
-
SHOP_ADD2CART_NG_MODEL_OPTIONS
¶ Used to configure the update behavior when changing the quantity of a product, in the product’s detail view after adding it to the cart. For more information refer to the documentation of the NgModelOptions directive in the AngularJS reference.
-
SHOP_EDITCART_NG_MODEL_OPTIONS
¶ Used to configure the update behavior when changing the quantity of a cart item, in the cart’s edit view. For more information refer to the documentation of the NgModelOptions directive in the AngularJS reference.
-
SHOP_GUEST_IS_ACTIVE_USER
¶ If this directive is
True
, customers which declared themselves as guests, may request a password reset, so that they can log into their account at a later time. Then it also makes sense to set theemail
field in modelemail_auth.User
as unique.The default is
False
.
-
SHOP_OVERRIDE_SHIPPING_METHOD
¶ If this directive is
True
, the merchant is allowed to override the shipping method the customer has chosen while performing the checkout.Note that if alternative shipping is more expensive, usually the merchant has to come up for the additional costs.
The default is
False
.
-
SHOP_CACHE_DURATIONS
¶ In the product’s list views, HTML snippets are created for the summary representation of each product.
By default these snippet are cached for one day.
-
SHOP_DIALOG_FORMS
¶ Specify a list of dialog forms available in our
shop.views.checkout.CheckoutViewSet
. This allows the usage of the endpointresolve('shop:checkout-upload')
in a generic way.If Cascade plugins are used for the forms in the checkout view, this list can be empty.
-
SHOP_CASCADE_FORMS
¶ Specify a map of Django Form classes to be used by the Cascade plugins used for the checkout view. Override this map, if the Cascade plugins shall use a Form other than the ones provided.
-