X-Git-Url: https://scm.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/2da869b2b46179d64c05eaac4081226fdbbbc9ff:/skins/shipping_set_control.py..e73353500c67453ef9663d67eaeee7dd46c358ee:/Products/Portfolio/skins/static/gitweb.js diff --git a/skins/shipping_set_control.py b/skins/shipping_set_control.py deleted file mode 100755 index 64db789..0000000 --- a/skins/shipping_set_control.py +++ /dev/null @@ -1,30 +0,0 @@ -##parameters=**kw -from Products.Portfolio.utils import translate -_ = lambda msg : translate(msg, context) - -kg = lambda name : kw.get(name, '').strip() - -mandatoryFields = [ - ('shipping_fullname', _('Please enter a name.')) - , ('shipping_address', _('Please enter an address.')) - , ('shipping_city', _('Please enter a city.')) - , ('shipping_zipcode', _('Please enter zip code.')) - , ('shipping_country', _('Please enter a country.')) - ] - -shippingInfo = {} -for name, failMessage in mandatoryFields : - value = kg(name) - shippingInfo[name] = value - if not value : - return context.setStatus(False, failMessage) - -session = context.REQUEST.SESSION -sg = session.get -cart = sg('cart', None) - -if cart is None : - return context.setStatus(False, _('No cart found. Your session may have expired.')) - -cart.setShippingInfo(**shippingInfo) -return context.setStatus(True, _('Shipping informations saved.')) \ No newline at end of file