def __init__(self, *args, **kwargs): if not app_enabled("purchaseorder"): raise ImproperlyConfigured( "To use Purchase Order payment methods, you must have satchmo.payment.modules.purchaseorder in your INSTALLED_APPS" ) super(PurchaseorderPayShipForm, self).__init__(*args, **kwargs)
def __init__(self, *args, **kwargs): if not app_enabled('purchaseorder'): raise ImproperlyConfigured( 'To use Purchase Order payment methods, you must have satchmo.payment.modules.purchaseorder in your INSTALLED_APPS' ) super(PurchaseorderPayShipForm, self).__init__(*args, **kwargs)
(r'^cart/add/$', 'cart.add', {}, 'satchmo_cart_add'), (r'^cart/add/ajax/$', 'cart.add_ajax', {}, 'satchmo_cart_add_ajax'), (r'^cart/qty/$', 'cart.set_quantity', {}, 'satchmo_cart_set_qty'), (r'^cart/qty/ajax/$', 'cart.set_quantity_ajax', {}, 'satchmo_cart_set_qty_ajax'), (r'^cart/remove/$', 'cart.remove', {}, 'satchmo_cart_remove'), (r'^cart/remove/ajax$', 'cart.remove_ajax', {}, 'satchmo_cart_remove_ajax'), (r'^checkout/', include('satchmo.payment.urls')), (r'^history/$', 'orders.order_history', {}, 'satchmo_order_history'), (r'^tracking/(?P<order_id>\d+)/$', 'orders.order_tracking', {}, 'satchmo_order_tracking'), (r'^search/$', 'search.search_view', {}, 'satchmo_search'), # Used for downloadable products. (r'^download/process/(?P<download_key>\w+)/$', 'download.process', {}, 'satchmo_download_process'), (r'^download/send/(?P<download_key>\w+)/$', 'download.send_file', {}, 'satchmo_download_send'), (r'^wishlist/', include('satchmo.wishlist.urls')), url(r'^fulfilment/', include('satchmo.fulfilment.urls'))) if app_enabled('l10n'): urlpatterns += patterns( '', # Used to set the default language. (r'^i18n/', include('satchmo.l10n.urls'))) # here we add product patterns directly into the root url urlpatterns += productpatterns
def app_enabled_filter(value): """returns "true" if the app is enabled""" if app_enabled(value): return "true" else: return ""
(r'^add/$', 'smart.smart_add', {}, 'satchmo_smart_add'), (r'^cart/$', 'cart.display', {}, 'satchmo_cart'), (r'^cart/accept/$', 'cart.agree_terms', {}, 'satchmo_cart_accept_terms'), (r'^cart/add/$', 'cart.add', {}, 'satchmo_cart_add'), (r'^cart/add/ajax/$', 'cart.add_ajax', {}, 'satchmo_cart_add_ajax'), (r'^cart/qty/$', 'cart.set_quantity', {}, 'satchmo_cart_set_qty'), (r'^cart/qty/ajax/$', 'cart.set_quantity_ajax', {}, 'satchmo_cart_set_qty_ajax'), (r'^cart/remove/$', 'cart.remove', {}, 'satchmo_cart_remove'), (r'^cart/remove/ajax$', 'cart.remove_ajax', {}, 'satchmo_cart_remove_ajax'), (r'^checkout/', include('satchmo.payment.urls')), (r'^history/$', 'orders.order_history', {}, 'satchmo_order_history'), (r'^tracking/(?P<order_id>\d+)/$', 'orders.order_tracking', {}, 'satchmo_order_tracking'), (r'^search/$', 'search.search_view', {}, 'satchmo_search'), # Used for downloadable products. (r'^download/process/(?P<download_key>\w+)/$', 'download.process', {}, 'satchmo_download_process'), (r'^download/send/(?P<download_key>\w+)/$', 'download.send_file', {}, 'satchmo_download_send'), (r'^wishlist/', include('satchmo.wishlist.urls')), url(r'^fulfilment/', include('satchmo.fulfilment.urls')) ) if app_enabled('l10n'): urlpatterns += patterns('', # Used to set the default language. (r'^i18n/', include('satchmo.l10n.urls')) ) # here we add product patterns directly into the root url urlpatterns += productpatterns
"""Provides the ability to overload forms to provide multiple possible responses to a form. For example, the product add form. You can add to the cart, or to the wishlist. The view here just looks in the formdata to determine whether to send the request to the cart_add or the wishlist_add view. """ from satchmo.utils import app_enabled from satchmo.shop.views import cart import logging if app_enabled("wishlist"): from satchmo.wishlist.views import wishlist_add use_wishlist = True else: wishlist_add = lambda x: x use_wishlist = False log = logging.getLogger("shop.views.smart") def smart_add(request): """Redirect the request to cart_add (default) or satchmo_wishlist_add (overridden) view""" if use_wishlist: if request.method == "POST": if request.POST.get("addwish", "") != "" or request.POST.get("addwish.x", "") != "": log.debug("Found addwish in post, returning the wishlist add view") from satchmo.wishlist.views import wishlist_add
(r'^tracking/(?P<order_id>\d+)/$', 'orders.order_tracking', {}, 'satchmo_order_tracking'), (r'^search/$', 'search.search_view', {}, 'satchmo_search'), # Override comments with our redirecting view. You can remove the next two # URLs if you aren't using ratings. #(r'^comments/post/$', 'comments.post_rating', {'maxcomments': 1 }, 'satchmo_rating_post'), (r'^comments/', include('django.contrib.comments.urls')), # Used for downloadable products. (r'^download/process/(?P<download_key>\w+)/$', 'download.process', {}, 'satchmo_download_process'), (r'^download/send/(?P<download_key>\w+)/$', 'download.send_file', {}, 'satchmo_download_send'), ) # here we add product patterns directly into the root url urlpatterns += productpatterns if app_enabled('l10n'): urlpatterns += patterns('', # Used to set the default language. (r'^i18n/', include('satchmo.l10n.urls')) ) if app_enabled('wishlist'): urlpatterns += patterns('', ('wishlist/', include('satchmo.wishlist.urls')), ) urlpatterns += patterns('django.views.generic', (r'^contact/thankyou/$','simple.direct_to_template',{'template':'thanks.html'},'satchmo_contact_thanks'), )