2 from Products
.Portfolio
.utils
import translate
3 _
= lambda msg
: translate(msg
, context
)
5 kg
= lambda name
: kw
.get(name
, '').strip()
8 ('shipping_fullname', _('Please enter a name.'))
9 , ('shipping_address', _('Please enter an address.'))
10 , ('shipping_city', _('Please enter a city.'))
11 , ('shipping_zipcode', _('Please enter zip code.'))
12 , ('shipping_country', _('Please enter a country.'))
16 for name
, failMessage
in mandatoryFields
:
18 shippingInfo
[name
] = value
20 return context
.setStatus(False, failMessage
)
22 session
= context
.REQUEST
.SESSION
24 cart
= sg('cart', None)
27 return context
.setStatus(False, _('No cart found. Your session may have expired.'))
29 cart
.setShippingInfo(**shippingInfo
)
30 return context
.setStatus(True, _('Shipping informations saved.'))