예제 #1
0
 def fields(self):
     context = aq_inner(self.context)
     product = IProduct(context)
     res = []
     weight_unit = dict(
         label=_(u'Weight Unit'),
         description=_('Select Weight Unit.'),
         field=self.select_weight_unit(product),
     )
     res.append(weight_unit)
     weight = dict(
         label=_('Weight'),
         description=_('Input Weight.'),
         field=
         '<input type="text" name="weight" id="weight" value="{0}" size="5" />'
         .format(product.weight),
     )
     res.append(weight)
     height = dict(
         label=_('Height'),
         description=_('Input Height in cm unit.'),
         field=
         '<input type="text" name="height" id="height" value="{0}" size="5" />'
         .format(product.height),
     )
     res.append(height)
     width = dict(
         label=_('Width'),
         description=_('Input Width in cm unit.'),
         field=
         '<input type="text" name="width" id="width" value="{0}" size="5" />'
         .format(product.width),
     )
     res.append(width)
     depth = dict(
         label=_('Depth'),
         description=_('Input Depth in cm unit.'),
         field=
         '<input type="text" name="depth" id="depth" value="{0}" size="5" />'
         .format(product.depth),
     )
     res.append(depth)
     return res
예제 #2
0
 def fields(self):
     context = aq_inner(self.context)
     product = IProduct(context)
     res = []
     weight_unit = dict(
         label=_(u'Weight Unit'),
         description=_('Select Weight Unit.'),
         field=self.select_weight_unit(product),
     )
     res.append(weight_unit)
     weight =dict(
         label=_('Weight'),
         description=_('Input Weight.'),
         field='<input type="text" name="weight" id="weight" value="{0}" size="5" />'.format(
             product.weight
         ),
     )
     res.append(weight)
     height = dict(
         label=_('Height'),
         description=_('Input Height in cm unit.'),
         field='<input type="text" name="height" id="height" value="{0}" size="5" />'.format(
             product.height
         ),
     )
     res.append(height)
     width = dict(
         label=_('Width'),
         description=_('Input Width in cm unit.'),
         field='<input type="text" name="width" id="width" value="{0}" size="5" />'.format(
             product.width
         ),
     )
     res.append(width)
     depth = dict(
         label=_('Depth'),
         description=_('Input Depth in cm unit.'),
         field='<input type="text" name="depth" id="depth" value="{0}" size="5" />'.format(
             product.depth
         ),
     )
     res.append(depth)
     return res
예제 #3
0
 def label(self):
     return _(u'Shipping Cost')
예제 #4
0
 def label(self):
     return _(u'Shipping Cost')
예제 #5
0
class IShippingMethodContentType(Interface):

    from_country = schema.Choice(
        title=_(u"Country From"),
        required=False,
        description=_(
            u"Select countries from which this shipping method is applied."),
        vocabulary=_(u"Countries"),
    )

    to_country = schema.Choice(
        title=_(u"Country To"),
        required=False,
        description=_(
            u"Select countries to which this shipping method is applied."),
        vocabulary=_(u"Countries"),
    )

    base_charge = schema.Float(
        title=_(u"Base Shipping Charge"),
        description=_(u"This is starting charge for this shipping method."),
        required=True,
        default=0.0,
    )

    weight_charge = schema.Float(
        title=_(u"Weight Charge"),
        description=_(
            u"This charge will be added every kg of weight linearly."),
        required=True,
        default=0.0,
    )

    fuel_rate = schema.Float(
        title=_(u"Fuel Rate"),
        description=_(u"Fuel Rate usually changes every month."),
        required=True,
        default=0.0,
    )

    insurance_base = schema.Float(
        title=_(u"Insurance Base Charge"),
        description=_(u""),
        required=True,
        default=0.0,
    )

    insurance_rate = schema.Float(
        title=_(u"Insurance Rate"),
        description=_(u"This rate will be added to the total product price."),
        required=True,
        default=0.0,
    )

    risk_rate = schema.Float(
        title=_(u"Risk Rate"),
        description=_(u""),
        required=True,
        default=0.0,
    )

    min_delivery_days = schema.Int(
        title=_(u"Minimum Delivery Days"),
        required=True,
    )

    max_delivery_days = schema.Int(
        title=_(u"Maximum Delivery Days"),
        required=True,
    )

    dimension_weight_ratio = schema.Float(
        title=_(u"Dimention Weight Ratio"),
        description=_(u"1 m3 = ??? kg"),
        required=False,
    )
예제 #6
0
from collective.cart.shipping import PROJECTNAME
from collective.cart.shipping import _
from collective.cart.shipping.interfaces import IShippingMethodAnnotations
from collective.cart.shipping.interfaces import IShippingMethodContentType
from persistent import Persistent
from zope.interface import implements

ShippingMethodSchema = ATContentTypeSchema.copy() + Schema((
    LinesField(
        name='from_country',
        required=False,
        searchable=False,
        languageIndependent=True,
        storage=AnnotationStorage(),
        widget=MultiSelectionWidget(
            label=_(u'From Country'),
            description=_(
                u'Select countries from which this shipping method is applied.'
            ),
            size='15',
        ),
        vocabulary_factory="collective.cart.shipping.countries",
        enforceVocabulary=True,
    ),
    LinesField(
        name='to_country',
        required=False,
        searchable=False,
        languageIndependent=True,
        storage=AnnotationStorage(),
        widget=MultiSelectionWidget(

return shipping_fee
"""


ShippingMethodSchema = ATContentTypeSchema.copy() + Schema(
    (
        LinesField(
            name="to_country",
            required=False,
            searchable=False,
            languageIndependent=True,
            storage=AnnotationStorage(),
            widget=MultiCountryWidget(
                label=_(u"To Country"),
                description=_(u"Select countries to which this shipping method is applied."),
                omitCountries=None,
            ),
        ),
        IntegerField(
            name="min_delivery_days",
            required=True,
            searchable=False,
            languageIndependent=True,
            storage=AnnotationStorage(),
            widget=IntegerWidget(label=_(u"Minimum Delivery Days"), size="2", maxlength="2"),
        ),
        IntegerField(
            name="max_delivery_days",
            required=True,
예제 #8
0
from collective.cart.shipping.interfaces import IShippingMethodAnnotations
from collective.cart.shipping.interfaces import IShippingMethodContentType
from persistent import Persistent
from zope.interface import implements


ShippingMethodSchema = ATContentTypeSchema.copy() + Schema((

    LinesField(
        name='from_country',
        required=False,
        searchable=False,
        languageIndependent=True,
        storage=AnnotationStorage(),
        widget=MultiSelectionWidget(
            label=_(u'From Country'),
            description=_(u'Select countries from which this shipping method is applied.'),
            size='15',
        ),
        vocabulary_factory="collective.cart.shipping.countries",
        enforceVocabulary=True,
    ),

    LinesField(
        name='to_country',
        required=False,
        searchable=False,
        languageIndependent=True,
        storage=AnnotationStorage(),
        widget=MultiSelectionWidget(
            label=_(u'To Country'),