def config_tax(): TAX_MODULE = config_get('TAX', 'MODULE') TAX_MODULE.add_choice(('satchmo.tax.modules.area', _('By Country/Area'))) TAX_GROUP = config_get_group('TAX') _tax_classes = [] ship_default = "" try: for tax in TaxClass.objects.all(): _tax_classes.append((tax.title, tax)) if "ship" in tax.title.lower(): ship_default = tax.title except: log.warn("Ignoring database error retrieving tax classes - OK if you are in syncdb.") if ship_default == "" and len(_tax_classes) > 0: ship_default = _tax_classes[0][0] config_register( BooleanValue( TAX_GROUP, 'TAX_SHIPPING', description=_("Tax Shipping?"), requires=TAX_MODULE, requiresvalue='satchmo.tax.modules.area', default=False ) ) config_register( StringValue( TAX_GROUP, 'TAX_CLASS', description=_("TaxClass for shipping"), help_text=_("Select a TaxClass that should be applied for shipments."), default=ship_default, choices=_tax_classes ) )
def config_tax(): TAX_MODULE = config_get('TAX', 'MODULE') TAX_MODULE.add_choice(('satchmo.tax.modules.area', _('By Country/Area'))) TAX_GROUP = config_get_group('TAX') _tax_classes = [] ship_default = "" try: for tax in TaxClass.objects.all(): _tax_classes.append((tax.title, tax)) if "ship" in tax.title.lower(): ship_default = tax.title except: log.warn( "Ignoring database error retrieving tax classes - OK if you are in syncdb." ) if ship_default == "" and len(_tax_classes) > 0: ship_default = _tax_classes[0][0] config_register( BooleanValue(TAX_GROUP, 'TAX_SHIPPING', description=_("Tax Shipping?"), requires=TAX_MODULE, requiresvalue='satchmo.tax.modules.area', default=False)) config_register( StringValue( TAX_GROUP, 'TAX_CLASS', description=_("TaxClass for shipping"), help_text=_( "Select a TaxClass that should be applied for shipments."), default=ship_default, choices=_tax_classes))
from satchmo.configuration import config_register, BooleanValue, StringValue, MultipleStringValue, SHOP_GROUP, ConfigurationGroup from django.utils.translation import ugettext_lazy as _ #### SHOP Group #### CURRENCY = config_register( StringValue(SHOP_GROUP, 'CURRENCY', description= _("Default currency symbol"), default="$")) ENABLE_RATINGS = config_register( BooleanValue(SHOP_GROUP, 'RATINGS', description= _("Enable product ratings"), default=True)) #### Google Group #### GOOGLE_GROUP = ConfigurationGroup('GOOGLE', 'Google Settings') GOOGLE_ANALYTICS = config_register( BooleanValue(GOOGLE_GROUP, 'ANALYTICS', description= _("Enable Analytics"), default=False, ordering=0)) GOOGLE_ANALYTICS_CODE = config_register( StringValue(GOOGLE_GROUP, 'ANALYTICS_CODE',
from django.utils.translation import ugettext_lazy as _ from satchmo.configuration import config_register, BooleanValue, StringValue, MultipleStringValue, SHOP_GROUP, ConfigurationGroup, PositiveIntegerValue default_icon_url = urlparse.urlunsplit( ('file', '', os.path.join(settings.MEDIA_ROOT, 'images/sample-logo.bmp'), '', '') ) #### SHOP Group #### CURRENCY = config_register( StringValue(SHOP_GROUP, 'CURRENCY', description= _("Default currency symbol"), help_text= _("Use a '_' character to force a space."), default="$")) RANDOM_FEATURED = config_register( BooleanValue(SHOP_GROUP, 'RANDOM_FEATURED', description= _("Enable random display of featured products on home page"), default=False)) NUMBER_FEATURED = config_register( PositiveIntegerValue(SHOP_GROUP, 'NUM_DISPLAY', description= _("Total number of featured items to display"), default=20))
from satchmo.configuration import config_register, StringValue, IntegerValue, BooleanValue, SHOP_GROUP from django.utils.translation import ugettext_lazy as _ config_register( BooleanValue(SHOP_GROUP, 'AUTHENTICATION_REQUIRED', description=_("Only authenticated users can check out"), help_text=_("Users will be required to authenticate (and create an account if neccessary) before checkout."), default=False, ) ) config_register( BooleanValue(SHOP_GROUP, 'BILLING_DATA_OPTIONAL', description=_("Billing data is optional"), help_text=_( "Users will not be required to provide billing address and phone number. If authentication " "before checkout is required, this allows instant purchase (all required contact data will " "have already been provided in registration form). Otherwise be careful, as this may leave " "you orders with almost no customer data!" ), default=False, ) ) # I am doing it this way instead of a boolean for email verification because I # intend to add a "manual approval" style of account verification. -Bruce ACCOUNT_VERIFICATION = config_register(StringValue(SHOP_GROUP, 'ACCOUNT_VERIFICATION', description=_("Account Verification"),
from django.utils.translation import ugettext_lazy as _ from satchmo.configuration import config_register, BooleanValue, StringValue, MultipleStringValue, SHOP_GROUP, ConfigurationGroup, PositiveIntegerValue default_icon_url = urlparse.urlunsplit( ('file', '', os.path.join(settings.MEDIA_ROOT, 'images/sample-logo.bmp'), '', '') ) #### SHOP Group #### CURRENCY = config_register( StringValue(SHOP_GROUP, 'CURRENCY', description= _("Default currency symbol"), help_text= _("Use a '_' character to force a space."), default="$")) ENABLE_RATINGS = config_register( BooleanValue(SHOP_GROUP, 'RATINGS', description= _("Enable product ratings"), default=True)) RANDOM_FEATURED = config_register( BooleanValue(SHOP_GROUP, 'RANDOM_FEATURED', description= _("Enable random display of featured products on home page"), default=False))
from satchmo.configuration import config_register, StringValue, IntegerValue, SHOP_GROUP from django.utils.translation import ugettext as _ # I am doing it this way instead of a boolean for email verification because I # intend to add a "manual approval" style of account verification. -Bruce ACCOUNT_VERIFICATION = config_register(StringValue(SHOP_GROUP, 'ACCOUNT_VERIFICATION', description=_("Account Verification"), help_text=_("Select the style of account verification. 'Immediate' means no verification needed."), default="IMMEDIATE", choices=[('IMMEDIATE', _('Immediate')), ('EMAIL', _('Email'))] )) config_register([ IntegerValue(SHOP_GROUP, 'ACCOUNT_ACTIVATION_DAYS', description=_('Days to verify account'), default=7, requires=ACCOUNT_VERIFICATION, requiresvalue='EMAIL') ])
config_value, ) from satchmo.shop.satchmo_settings import get_satchmo_setting from satchmo.utils import load_module import logging logger = logging.getLogger(__name__) SHIPPING_GROUP = ConfigurationGroup('SHIPPING', _('Shipping Settings')) SHIPPING_ACTIVE = config_register( MultipleStringValue( SHIPPING_GROUP, 'MODULES', description=_("Active shipping modules"), help_text=_("Select the active shipping modules, save and reload to set any module-specific shipping settings."), default=["satchmo.shipping.modules.per"], choices=[('satchmo.shipping.modules.per', _('Per piece'))] ) ) # --- Load default shipping modules. Ignore import errors, user may have deleted them. --- # DO NOT ADD 'tiered' or 'no' to this list. # 'no' is used internally # 'Tiered' is special, since it needs to be added as a module. To enable it, # just add satchmo.shipping.modules.tiered to your INSTALLED_APPS, you don't # need to add it to CUSTOM_SHIPPING_MODULES either. _default_modules = ('dummy', 'fedex', 'flat', 'per', 'ups', 'usps', 'royalmailcontract') for module in _default_modules: try:
config_register, config_value, ) from satchmo.shop.satchmo_settings import get_satchmo_setting from satchmo.utils import load_module import logging logger = logging.getLogger(__name__) SHIPPING_GROUP = ConfigurationGroup('SHIPPING', _('Shipping Settings')) SHIPPING_ACTIVE = config_register( MultipleStringValue( SHIPPING_GROUP, 'MODULES', description=_("Active shipping modules"), help_text= _("Select the active shipping modules, save and reload to set any module-specific shipping settings." ), default=["satchmo.shipping.modules.per"], choices=[('satchmo.shipping.modules.per', _('Per piece'))])) # --- Load default shipping modules. Ignore import errors, user may have deleted them. --- # DO NOT ADD 'tiered' or 'no' to this list. # 'no' is used internally # 'Tiered' is special, since it needs to be added as a module. To enable it, # just add satchmo.shipping.modules.tiered to your INSTALLED_APPS, you don't # need to add it to CUSTOM_SHIPPING_MODULES either. _default_modules = ('dummy', 'fedex', 'flat', 'per', 'ups', 'usps', 'royalmailcontract') for module in _default_modules:
from django.utils.translation import ugettext_lazy as _ from satchmo.configuration import ( ConfigurationGroup, MultipleStringValue, config_register, ) import logging log = logging.getLogger(__name__) FULFILMENT_SETTINGS = ConfigurationGroup('FULFILMENT', _('Fulfilment Settings')) ACTIVE_FULILMENT_HOUSE = config_register( MultipleStringValue( FULFILMENT_SETTINGS, 'MODULES', description=_("Active fulfilment houses"), help_text= _("Select the active fulfilment house, save and reload to set any module-specific fulilment settings." ), default=[], choices=[]))
from satchmo.configuration import config_register, BooleanValue, StringValue, MultipleStringValue, SHOP_GROUP, ConfigurationGroup from django.utils.translation import ugettext_lazy as _ #### SHOP Group #### CURRENCY = config_register( StringValue(SHOP_GROUP, 'CURRENCY', description=_("Default currency symbol"), default="$")) ENABLE_RATINGS = config_register( BooleanValue(SHOP_GROUP, 'RATINGS', description=_("Enable product ratings"), default=True)) #### Google Group #### GOOGLE_GROUP = ConfigurationGroup('GOOGLE', 'Google Settings') GOOGLE_ANALYTICS = config_register( BooleanValue(GOOGLE_GROUP, 'ANALYTICS', description=_("Enable Analytics"), default=False, ordering=0)) GOOGLE_ANALYTICS_CODE = config_register( StringValue(GOOGLE_GROUP, 'ANALYTICS_CODE',