Skip to content

Commit

Permalink
feat: Extend ShippingSkel with art_no bone and set tooltip (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
sveneberth authored Feb 18, 2025
1 parent 564161c commit fb44f0a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/viur/shop/data/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,15 @@
"en": "Shipping costs",
"fr": "Frais d'expédition",
},
"viur.shop.skeleton.shipping.art_no": {
"_hint": "bone art_no<StringBone> in ShippingSkel in viur.shop",
"de": "Artikelnummer",
"en": "art no",
},
"viur.shop.skeleton.shipping.description.tooltip": {
"de": "Wird auch als Kundenkommentar im Frontend ausgegeben",
"en": "Is also displayed as a customer comment in the frontend",
},
"viur.shop.skeleton.shipping.supplier": {
"_hint": "bone supplier<SelectBone> in ShippingSkel in viur.shop",
"de": "Lieferant",
Expand Down
10 changes: 10 additions & 0 deletions src/viur/shop/skeletons/shipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from viur.core.bones import *
from viur.core.skeleton import Skeleton
from ..globals import SHOP_INSTANCE, SHOP_LOGGER
from viur.core.i18n import translate

logger = SHOP_LOGGER.getChild(__name__)

Expand Down Expand Up @@ -36,6 +37,12 @@ class ShippingSkel(Skeleton): # STATE: Complete (as in model)

description = TextBone(
validHtml=None,
params={
"tooltip": translate(
"viur.shop.skeleton.shipping.description.tooltip",
public=True,
),
}
)
"""
"Sie brauchen ein DHL-Kundenkonto"
Expand All @@ -52,6 +59,9 @@ class ShippingSkel(Skeleton): # STATE: Complete (as in model)
)
shipping_cost.isEmpty = functools.partial(is_empty, shipping_cost) # Re-Assign with instance reference

art_no = StringBone(
)

supplier = SelectBone(
values=get_suppliers,
)
Expand Down
1 change: 1 addition & 0 deletions src/viur/shop/skeletons/shipping_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ShippingConfigSkel(Skeleton): # STATE: Complete (as in model)
"description",
"supplier",
"shipping_cost",
"art_no",
"delivery_time_*",
},
)
Expand Down

0 comments on commit fb44f0a

Please sign in to comment.