Highlights
Versandkosten manuell berechnen lassen Versandberechnung auf der Detailseite der Versandart manuell hinzufügen LineItems selbst bestimmen Vertriebkanäle selbst wählen
Features
Manuelle Versandkosten Berechnung Für jede Versandart möglich Indiviudelle Berechnung für einzelne Versandarten
Nutzung des Plugins
Das Plugin fügt die Möglichkeit hinzu, den Versand manuell zu berechnen. Mithilfe von lineitems vom Warenkorb können Sie diese zur Berechnung des Versands verwenden. Das Feld "Versandberechnung" basiert auf der Twig-Vorlage und die Twig-Funktionen sollten in Operationen mit Daten aufgerufen werden.
In "lineItems" sind alle Produkte aus dem Warenkorb. Und dort sind aktuelle "salesChannel" Daten hinzugefügt.
Ermöglicht somit komplexeste Versandkostenermittlung mit relativ einfachen Mitteln (TWIG) via Shopware Admin Oberfläche.
Funktionsweise
- Es ist möglich, die Versandberechnung auf der Detailseite der Versandart manuell hinzuzufügen.
- Standardwerte hinzugefügt:
- Vertriebskanal
- LineItems (lineItem funktioniert nur bei foreach-Schleife).
- Wenn kein Float-Wert zurückgegeben werden kann, wird der nächste Matrixpreis (falls vorhanden) oder der Standardpreis verwendet.
Manuelle Berechnung der Versandkosten
Im
Bereich Einstellungen -> Shop-> Versand -> Versandart anlegen oder bearbeiten
Hier ist es möglich über eine Preismatrix, den Versand manuell berechnen zu lassen.
Sie haben hier lineItems vom Warenkorb und können diese zur Berechnung des Versands verwenden.
Beispiel #1: (Versandkosten fix auf 10 ohne weiterer Regeln)
{% set shipping = 10 %}{{ shipping }}
Beispiel #2: (Versandkosten erhöhen sich um einen Wert, abhängig davon ob ein Artikel mit dem CustomField im Warenkorb liegt)
{% set shipping = 10 %}
{% for lineItem in lineItems %}
{% if lineItem.payload.customFields.custom_sw4_attributes_attr7 == "1" %}
{% set shipping = shipping + 1 %}
{% endif %}
{% endfor %}
{{ shipping }}
Wichtig: Bei der Konfiguration der Zusatzfelder im Admin unter Einstellungen > System > Zusatzfelder muss „Verfügbar in Warenkörben“ bei den jeweiligen Zusatzfeldern aktiviert sein.
Beispiel #3: (Versandkosten je nachdem in welchen Kategorien sich die Produkte Warenkorb befinden)
{% set numberProductsInsideCategory1 = 0 %}
{% set numberProductsInsideCategory2 = 0 %}
{% for lineItem in lineItems %}
{% if lineItem.payload.categoryIds %}
{% for categoryId in lineItem.payload.categoryIds %}
{# Is product inside category 1 - we check it by the UUID #}
{% if categoryId == '21b199946c884aa294b409f135963880' %}
{% set numberProductsInsideCategory1 = numberProductsInsideCategory1 + 1 %}
{% endif %}
{# Is product inside category 2 - we check it by the UUID? #}
{% if categoryId == '0b5e8204e7034c2ca17a3899274874a4' %}
{% set numberProductsInsideCategory2 = numberProductsInsideCategory2 + 1 %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{# Now we can do something with the variables numberProductsInsideCategory1 and numberProductsInsideCategory2 #}
{% if numberProductsInsideCategory1 > 0 and numberProductsInsideCategory2 > 0 %}
19.90
{% elseif numberProductsInsideCategory1 > 0 %}
14.90
{% elseif numberProductsInsideCategory2 > 0 %}
12.90
{% else %}
9.90
{% endif %}
Hinweis: Es sind im Warenkorb nur die UUIDs der Kategorien (einmalige ID in der Datenbank) verfügbar. Die UUID kannst du sehr einfach über das Plugin https://store.shopware.com/acris28622190382f/acris-kategorie-id-anzeigen.html auslesen und kopieren.
Beispiel #4: Mengen Ermittlung
{% set quantity = 0 %}{% for lineItem in lineItems %}
{% if lineItem.quantity %}
{% set quantity = quantity + lineItem.quantity %}
{% endif %}
{% endfor %}
{{ quantity }}
Beispiel #5: Kunden Freitextfeld Freihausgrenze
{% set customerShippingFreeLimit = false %}
{% if customer.customFields is not empty and customer.customFields.custom_customer_shipping_free_limit > 0 %}
{% set customerShippingFreeLimit = customer.customFields.custom_customer_shipping_free_limit %}
{% endif %}
{% set shippingCosts = 9.95 %}
{% if customerShippingFreeLimit > 0 and cart.price.totalPrice >= customerShippingFreeLimit %}
{% set shippingCosts = 0 %}
{% endif %}
{{ shippingCosts }}
Beispiel #6: Hinzufügen der Mehrwertsteuer je nach Lieferland und Warenkorbinhalt zum Nettopreis der Versandkosten
{% set shippingNet = 100 %}
{% if context.taxState == 'gross' and matchingTaxRules and matchingTaxRules.highestRate() %}
{% set shippingNet = shippingNet / 100 * matchingTaxRules.highestRate().getPercentage() %}
{% set shipping = shippingNet * (1 + (matchingTaxRules.highestRate().getTaxRate() / 100)) %}
{% else %}
{% set shipping = shippingNet %}
{% endif %}
{{ shipping }}
Beispiel #7: Berechnung der Versandkosten abhängig von Brutto / Netto im Warenkorb
{% if context.taxState == 'gross' %}
{# do smth if tax state is gross #}
{% else %}
{# do smth if tax state is net #}
{% endif %}
Beispiel #8: Wenn mindestens ein Produkt nicht lagernd ist, dann Versandkosten 10 €, ansonsten 5 €
{% set oneProductOutOfStock = false %}
{% for lineItem in lineItems %}
{% if lineItem.deliveryInformation and lineItem.deliveryInformation.stock <= 0 %}
{% set oneProductOutOfStock = true %}
{% endif %}
{% endfor %}
{% if oneProductOutOfStock %}
10
{% else %}
5
{% endif %}
---
Folgende Variablen sind aktuell verfügbar - wenn sie weiter Variablen benötigen, dann bitte eine Supportanfrage über den Shopware Account an uns stellen.
Auflistung der möglichen Variablen
matchingTaxRules (Steuern, die für die Versandart relevant sind, ermittelt über Steuer-Typ - PHP-Klasse TaxRuleCollection)
- matchingTaxRules.highestRate().getTaxRate()
currency
- currency.isoCode
- currency.factor
- currency.symbol
- currency.shortName
- currency.name
- currency.position
- currency.translations
- currency.orders
- currency.salesChannels
- currency.salesChannelDefaultAssignments
- currency.salesChannelDomains
- currency.shippingMethodPrices
- currency.promotionDiscountPrices
- currency.isSystemDefault
- currency.productExports
- currency.countryRoundings
- currency.itemRounding
- currency.totalRounding
- currency.taxFreeFrom
- currency.translated.customFields
context
- context.languageIdChain
- context.versionId
- context.currencyId
- context.currencyFactor
- context.scope
- context.ruleIds
- context.source
- context.considerInheritance
- context.taxState
- context.rounding
ruleIds - array with active rule ids
customer
- customer.groupId
- customer.defaultPaymentMethodId
- customer.salesChannelId
- customer.languageId
- customer.lastPaymentMethodId
- customer.defaultBillingAddressId
- customer.defaultShippingAddressId
- customer.customerNumber
- customer.salutationId
- customer.firstName
- customer.lastName
- customer.company
- customer.password
- customer.email
- customer.title
- customer.vatIds
- customer.affiliateCode
- customer.campaignCode
- customer.active
- customer.doubleOptInRegistration
- customer.doubleOptInEmailSentDate
- customer.doubleOptInConfirmDate
- customer.hash
- customer.guest
- customer.firstLogin
- customer.lastLogin
- customer.newsletter
- customer.birthday
- customer.lastOrderDate
- customer.orderCount
- customer.orderTotalAmount
- customer.createdAt
- customer.updatedAt
- customer.legacyEncoder
- customer.legacyPassword
- customer.group
- customer.defaultPaymentMethod
- customer.salesChannel
- customer.language
- customer.lastPaymentMethod
- customer.salutation
- customer.defaultBillingAddress
- customer.defaultShippingAddress
- customer.activeBillingAddress
- customer.activeShippingAddress
- customer.addresses
- customer.orderCustomers
- customer.autoIncrement
- customer.tags
- customer.tagIds
- customer.promotions
- customer.recoveryCustomer
- customer.productReviews
- customer.remoteAddress
- customer.requestedGroupId
- customer.requestedGroup
- customer.boundSalesChannelId
- customer.boundSalesChannel
- customer.wishlists
- customer.customFields
cart
- cart.name
- cart.token
- cart.price.netPrice
- cart.price.totalPrice
- cart.price.calculatedTaxes
- cart.price.taxRules
- cart.price.positionPrice
- cart.price.taxStatus
- cart.price.rawTotal
- cart.lineItems
- cart.errors
- cart.deliveries
- cart.transactions
- cart.modified
- cart.customerComment
- cart.affiliateCode
- cart.campaignCode
- cart.data
- cart.ruleIds
lineItems - array with line item
lineItem
- lineItem.id
- lineItem.referencedId
- lineItem.label
- lineItem.quantity
- lineItem.type
- lineItem.priceDefinition
- lineItem.price
- lineItem.good
- lineItem.description
- lineItem.cover
- lineItem.deliveryInformation
- lineItem.deliveryInformation.stock
- lineItem.deliveryInformation.weight
- lineItem.deliveryInformation.freeDelivery
- lineItem.deliveryInformation.restockTime
- lineItem.deliveryInformation.deliveryTime
- lineItem.deliveryInformation.height
- lineItem.deliveryInformation.width
- lineItem.deliveryInformation.length
- lineItem.children
- lineItem.requirement
- lineItem.removable
- lineItem.stackable
- lineItem.quantityInformation
- lineItem.modified
- lineItem.dataTimestamp
- lineItem.dataContextHash
- lineItem.payload
- lineItem.payload.isCloseout
- lineItem.payload.customFields
- lineItem.payload.createdAt
- lineItem.payload.releaseDate
- lineItem.payload.isNew
- lineItem.payload.markAsTopseller
- lineItem.payload.purchasePrices
- lineItem.payload.productNumber
- lineItem.payload.manufacturerId
- lineItem.payload.taxId
- lineItem.payload.tagIds
- lineItem.payload.categoryIds
- lineItem.payload.propertyIds
- lineItem.payload.optionIds
- lineItem.payload.options
- lineItem.payload.length
- lineItem.payload.height
- lineItem.payload.width
- lineItem.payload.deliveryTime
- lineItem.payload.features
- lineItem.deliveryInformation.weight
salesChannel
- salesChannel.typeId
- salesChannel.languageId
- salesChannel.currencyId
- salesChannel.paymentMethodId
- salesChannel.shippingMethodId
- salesChannel.countryId
- salesChannel.navigationCategoryId
- salesChannel.navigationCategoryDepth
- salesChannel.homeSlotConfig
- salesChannel.homeCmsPageId
- salesChannel.homeCmsPage
- salesChannel.homeEnabled
- salesChannel.homeName
- salesChannel.homeMetaTitle
- salesChannel.homeMetaDescription
- salesChannel.homeKeywords
- salesChannel.footerCategoryId
- salesChannel.serviceCategoryId
- salesChannel.name
- salesChannel.shortName
- salesChannel.accessKey
- salesChannel.currencies
- salesChannel.languages
- salesChannel.configuration
- salesChannel.active
- salesChannel.maintenance
- salesChannel.maintenanceIpWhitelist
- salesChannel.taxCalculationType
- salesChannel.type
- salesChannel.currency
- salesChannel.language
- salesChannel.paymentMethod
- salesChannel.shippingMethod
- salesChannel.country
- salesChannel.orders
- salesChannel.customers
- salesChannel.countries
- salesChannel.paymentMethods
- salesChannel.shippingMethods
- salesChannel.translations
- salesChannel.domains
- salesChannel.systemConfigs
- salesChannel.navigationCategory
- salesChannel.footerCategory
- salesChannel.serviceCategory
- salesChannel.productVisibilities
- salesChannel.mailHeaderFooterId
- salesChannel.numberRangeSalesChannels
- salesChannel.mailHeaderFooter
- salesChannel.customerGroupId
- salesChannel.customerGroup
- salesChannel.newsletterRecipients
- salesChannel.promotionSalesChannels
- salesChannel.documentBaseConfigSalesChannels
- salesChannel.productReviews
- salesChannel.seoUrls
- salesChannel.seoUrlTemplates
- salesChannel.mainCategories
- salesChannel.paymentMethodIds
- salesChannel.productExports
- salesChannel.hreflangActive
- salesChannel.hreflangDefaultDomainId
- salesChannel.hreflangDefaultDomain
- salesChannel.analyticsId
- salesChannel.analytics
- salesChannel.customerGroupsRegistrations
- salesChannel.eventActions
- salesChannel.boundCustomers
- salesChannel.wishlists
- salesChannel.landingPages
- salesChannel.translated.customFields
shippingMethod
- shippingMethod.translated.name
- shippingMethod.active
- shippingMethod.description
- shippingMethod.trackingUrl
- shippingMethod.deliveryTimeId
- shippingMethod.deliveryTime
- shippingMethod.translations
- shippingMethod.orderDeliveries
- shippingMethod.salesChannelDefaultAssignments
- shippingMethod.salesChannels
- shippingMethod.availabilityRule
- shippingMethod.availabilityRuleId
- shippingMethod.prices
- shippingMethod.mediaId
- shippingMethod.taxId
- shippingMethod.media
- shippingMethod.tags
- shippingMethod.taxType
- shippingMethod.tax
- shippingMethod.translated.customFields
paymentMethod
- paymentMethod.pluginId
- paymentMethod.handlerIdentifier
- paymentMethod.translated.name
- paymentMethod.distinguishableName
- paymentMethod.description
- paymentMethod.position
- paymentMethod.active
- paymentMethod.afterOrderEnabled
- paymentMethod.plugin
- paymentMethod.translations
- paymentMethod.orderTransactions
- paymentMethod.customers
- paymentMethod.salesChannelDefaultAssignments
- paymentMethod.salesChannels
- paymentMethod.availabilityRule
- paymentMethod.availabilityRuleId
- paymentMethod.mediaId
- paymentMethod.media
- paymentMethod.formattedHandlerIdentifier
- paymentMethod.shortName
- paymentMethod.appPaymentMethod
- paymentMethod.translated.customFields
customerGroup
- customerGroup.name
- customerGroup.translated.name
- customerGroup.displayGross
- customerGroup.translations
- customerGroup.customers
- customerGroup.salesChannels
- customerGroup.registrationActive
- customerGroup.registrationTitle
- customerGroup.registrationIntroduction
- customerGroup.registrationOnlyCompanyRegistration
- customerGroup.registrationSeoMetaDescription
- customerGroup.registrationSalesChannels
- customerGroup.translated.customFields
taxRules (Auflistung der im Shop verfügbaren Steuern - PHP-Klasse TaxCollection)
- taxRules.ids
- taxRules.elements
Erweiterung ab Pluginversion 2.2.0 - Ermittlung des Steuersatzes
Der für die Versandart relevante Steuersatz wird in Shopware über den "Steuer-Typ" (Auto, Höchster Satz oder Fester Satz) ermittelt. Das Ergebnis daraus speichern wir ab sofort in der Variablen "matchingTaxRules", diese entspricht der PHP-Klasse https://github.com/shopware/platform/blob/trunk/src/Core/Checkout/Cart/Tax/Struct/TaxRuleCollection.php.
Sie können somit den aktuell höchsten Steuersatz im Warenkorb über die folgende Twig-Variable auslesen: {{ matchingTaxRules.highestRate().getTaxRate() }} Mit diesem Steuersatz können Sie nun rechnen.
- Behebt ein mögliches Problem, wenn die Preise der Versandkosten in der Datenbank nicht korrekt gesetzt sind (z.B. nach einer Datenmigration).
- Verbessert die Plugin-Kompatibilität.
- Aktualisierte Pipeline-Datei
- Kompatibilität mit Shopware 6.6.
- Optimiert die Aktualisierung des Plugins.
- Fügt die Daten der Basiseinheit und der Verkaufseinheit zur Nutzlast der Positionen im Warenkorb hinzu.
- Verbessert die Plugin-Kompatibilität.
- Verbessert die Plugin-Kompatibilität.
- Kompatibilität mit Shopware 6.5.
- Änderung des Pluginnamens und der Hersteller Links.
- Optimiert die Versandberechnung bei der Neuberechnung des Warenkorbs.
- Behebt ein Problem, bei dem berechnete Versandkosten einen Wert von 0 ergeben.
- Behebt ein Problem bei dem der Shop nach einer Änderung des Versandkosten Templates beim ersten Aufruf nicht erreichbar ist.
- Ab sofort ist es in der Versandkostenberechnung möglich eigene Twig Funktionen aus anderen Plugins zu nutzen.
- Optimiert das Plugin-Image.
- Verbessert die Kompatibilität mit Shopware >= 6.4.10.0.
- Optimiert Lieferungsrechner auf manuelle Berechnung.
- Ermittelt die für die Lieferung relevanten Steuersätze und fügt sie als mögliche Variable in Twig hinzu.
- Fügt neue Variablen für die Versandberechnung hinzu.
- Hinzufügen von Vorschlägen für Warenkorbvariablen in der Versandberechnungsvorlage.
- Der Vorlage für die Versandberechnung wurde der Warenkorb hinzugefügt.
- Kompatibilität mit Shopware 6.4* hergestellt.
- Verbessert die Kompatibilität mit Shopware Version > 6.3.0.0 und <= 6.3.3.1.
- Validierung der Versandberechnung hinzugefügt.
Anmelden
24. Juni 2024 09:56
Ein muss für jeden Shop mit komplexeren Versandlogiken. Top!
Wir nutzen das Plugin zur komplexeren Versandkalkulation (Volumengewicht, Bandmaße, verschiedene Logiken) und es tut genau das, was man eigentlich von Bord vermisst. Der Support hat mir innerhalb kürzester Zeit geholfen, sehr lobenswert!
24. Mai 2024 15:20
Exemplary support
Due to Shopware being quite basic in terms of shipping, we looked for a plugin to meet our needs and this one was the only one that accepted complex rules. Of course we had no idea how to create the code for the rules, but we asked for help from the plugin developers to create the script for us based on our request. Julian was a massive help and replied all day long to our requests, thank you for this!
4. März 2024 09:10
Mächtiges, gut funktionierendes Werkzeug
Die Erweiterung stellt ein mächtiges Werkzeug zur Darstellung auch komplexerer Versandkostenanforderungen zur Verfügung. Der Acris-Support, wenn man ihn mal benötigt, ist schnell und kompetent und hilft ersichtlich gerne. Leider ist die Erweiterung überhaupt erst nötig, weil Shopware in SW6 keine Auf- und Abschlagsversandarten mehr bietet und eigene Regeln und Bedingungen ebenfalls nicht mehr möglich sind. In SW5 konnte man unsere Anforderungen noch mit Hausmittel darstellen!
27. März 2023 14:02
Endlich wieder individuelle Berechnungen
Leider ist es, aus mir unerklärlichen Gründen, nicht möglich, im Standard von SW6 individuelle Versandkostenberechnungen vorzunehmen. Mit diesem Plugin lassen sich eigentlich simple Berechnungen auch wieder simpel durchführen. Beispielsweise Versandgewicht bis 5 kg = Preis x Für jedes hinzu kommende KG zahlt der Kunde y, addieert auf x. Kein Problem mit diesem Plugin. P.S.: Schade, dass derartig nötige Funktionen nicht Standard sind.
13. März 2023 15:05
Acris = Erweiterung und Support 1+
Wir nutzen einige Erweiterungen von Acris und sind IMMER und durchgehend damit gut gefahren. Der Support ist Weltklasse, antwortet schnell und präzise und hilft auch darüber hinaus, wo sie können.
8. Juni 2022 12:01
Produkt und Service sind erstklassig
Das Plugin löst das Problem individuell berechneter Versandkosten auf denkbar einfache Weise. Unser Wunsch auch eigene Twig-Funktionen verwenden zu können wurde in Rekordtempo umgesetzt. Dieser Support ist sowohl in Sachen Reaktionsgeschwindigkeit als auch Zielorientierung spitze. Danke!
9. Dezember 2021 11:01
Endlich die Erweiterung nach der man sucht wenn man komplexen Versand berechnen will.
Es ist möglich alle Parameter die von Interesse sind mit TWIG Programmiertechnisch abzubilden und individuell zu errechnen. Beauftragen Sie mich wenn Sie Hilfe benötigen. Mein Name in Google reicht.
29. November 2021 09:30
Essenzielle Erweiterung
Wahrscheinlich unser wichtigstes Plugin, um auch komplexere Versandkostenstrukturen abzubilden, die nicht nach Gewicht oder Anzahl gehen. Extrem simpel zu bedienen, Zusatzvariablen wurden vom Support innerhalb von Tagen eingebaut.
31. Mai 2021 07:20
Tut was es soll
Top Plugin, Top Entwickler mit schnellem Support. Hatte einige Probleme und Fragen zum Versand, die alle schnell und erfolgreich gelöst werden konnten.