This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from myshop import models as shop_models | |
class LEDAdmin(admin.ModelAdmin): | |
prepopulated_fields = {"slug": ("name",)} | |
admin.site.register(shop_models.Category) | |
admin.site.register(shop_models.Distributor) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHOP_SHIPPING_FLAT_RATE = '-30' | |
SHOP_SHIPPING_BACKENDS = [ | |
'shop.shipping.backends.flat_rate.FlatRateShipping', | |
] | |
SHOP_PAYMENT_BACKENDS = [ | |
'shop.payment.backends.pay_on_delivery.PayOnDeliveryBackend' | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""View classes for the get_client_info application.""" | |
from shop.views import ShopTemplateView | |
from shop.views.checkout import SelectShippingView | |
class GetClientInfoView(SelectShippingView): | |
"""Displays form for gathering shipping and billing address.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls.defaults import * | |
from django.contrib import admin | |
from shop import urls as shop_urls | |
from shop_simplevariations import urls as simplevariations_urls | |
admin.autodiscover() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls.defaults import * | |
from django.contrib import admin | |
from shop import urls as shop_urls | |
from shop_simplevariations import urls as simplevariations_urls | |
admin.autodiscover() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Cart modifierts for the myshop app of django-shop-adventures.""" | |
import decimal | |
from django.conf import settings | |
from shop.cart.cart_modifiers_base import BaseCartModifier | |
class FixedTaxRate(BaseCartModifier): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FixedShippingCosts(BaseCartModifier): | |
""" | |
This will add a fixed amount of money for shipping costs. | |
""" | |
def add_extra_cart_price_field(self, cart): | |
cart.extra_price_fields.append( | |
('Shipping costs', decimal.Decimal( | |
settings.SHOP_SHIPPING_FLAT_RATE))) | |
return cart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHOP_CART_MODIFIERS = [ | |
'shop_simplevariations.cart_modifier.ProductOptionsModifier', | |
'myshop.modifiers.FixedShippingCosts', | |
'myshop.modifiers.FixedTaxRate', | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h1>Shipping and Billing</h1> | |
<form method="POST"> | |
{% csrf_token %} | |
<h3>Your shipping address</h3> | |
{{ shipping_address.as_p }} | |
<h3>Your billing address</h3> | |
{{ billing_address.as_p }} | |
<input type=hidden name="shipping_method" value="skip-shipping" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Shipping backend that skips the whole shipping process.""" | |
from django.conf.urls.defaults import patterns, url | |
class SkipShippingBackend(object): | |
backend_name = "Skip Shipping Backend" | |
url_namespace = "skip-shipping" |