Diese Seite ist auch auf Deutsch verfügbar.
Skip to main content Skip to search Skip to main navigation
ACRIS E-Commerce GmbH

Shipping calculation

Rating: 5.0

Average rating of 5 out of 5 stars

(9 reviews)
Downloads: 213

Description

Highlights

  • Calculate shipping costs manually
  • Manually add shipping calculation on shipping type detail page
  • Determine LineItems yourself
  • Choose distribution channels yourself

Features

  • Manual shipping cost calculation
  • Possible for each shipping method
  • Indiviudelle calculation for individual shipping types

About the Extension

Use of the plugin

The plugin adds the possibility to calculate shipping manually. To calculate shipping. costs you can use lineitems from the shopping cart as a price matrix.


Functionality

  • It is possible to add manually shipping calculation in shipping method detail page.
  • Default values added:
    • SalesChannel
    • LineItems (lineItem works only for foreach loop).
  • If there is no float value to return then it will be used next matrix price if exist or default price.


Manual calculation of shipping costs

In the area Settings -> Shop-> Shipping -> Create or edit shipping type.
Here it is possible via a price matrix, to calculate the shipping manually.


Shipping calculation field is based on twig template and twig functions should be called in operations with data.

In "lineItems" are all products from the cart. And there is added current "salesChannel" data.


You have lineItems form cart here and you can use them to calculate shipping.


Example #1: (set shipping costs to 10 without further rules)

{% set shipping = 10 %}

{{ shipping }}


Example #2: (if there is product with a customField, than increase shipping costs)

{​​% for lineItem in lineItems %}​​
    {​​% if lineItem.payload.customFields.attribute== "1" %}​​
        {​​% set shipping = shipping + 1 %}​​
    {​​% endif %}​​
{​​% endfor %}​​
{​​{​​ shipping }​​}​​


Important: When configuring the additional field in Admin under Settings > System > Additional fields, 'Available in shopping carts' must be activated for the respective additional fields.


Example #3: (Shipping costs based on number of products inside categories)

{% 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 %}


Note: Only the UUIDs of the categories (unique ID in the database) are available in the shopping cart. You can easily read out and copy the UUID via the plugin https://store.shopware.com/en/acris28622190382f/acris-display-category-id.html.


Example #4: Quantity detection

{% set quantity = 0 %}
{% for lineItem in lineItems %}
    {% if lineItem.quantity %}
        {% set quantity = quantity + lineItem.quantity %}
    {% endif %}
{% endfor %}

{{ quantity }}


Example #5: Customer custom field shipping free limit

{% 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 }}


Example #6: Adding VAT to the net price of the shipping costs, depending on the country of delivery and the contents of the shopping basket

{% 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 }}


Example #7: Calculate price based on a different tax state in the cart (gross or net)

{% if context.taxState == 'gross' %}
     {# do smth if tax state is gross #}
 {% else %}
     {# do smth if tax state is net #}
 {% endif %}


Example #8: If at least one product is not in stock, shipping costs €10, otherwise €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 %}


---


Possible variables

matchingTaxRules (Taxes relevant to the dispatch type, determined via tax type - PHP class 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 (Listing of taxes available in the shop - PHP class TaxCollection)

  • taxRules.ids
  • taxRules.elements


Extension as of plug-in version 2.2.0 - Determination of the tax rate

The tax rate relevant for the shipping method is determined in Shopware via the "tax type" (auto, highest rate or fixed rate). From now on we store the result of this in the variable "matchingTaxRules", this corresponds to the PHP class https://github.com/shopware/platform/blob/trunk/src/Core/Checkout/Cart/Tax/Struct/TaxRuleCollection.php. You can thus read out the current highest tax rate in the shopping cart via the following Twig variable:

{{ matchingTaxRules.highestRate().getTaxRate() }} You can now calculate with this tax rate.

Details

  • Available: English, German
  • Latest update: 4 December 2024
  • Publication date: 19 March 2021
  • Version: 4.0.3
  • Category: Checkout / Cart process

Resources

Reviews (9)

Average rating
5.0

Average rating of 5 out of 5 stars

Based on 9 reviews
5.0 Functionality
5.0 Usability
4.9 Documentation
5.0 Support

100 %
0 %
0 %
0 %
0 %

Write a review

If you downloaded this extension you can write a review in the Shopware Account.

Write a review
Ein muss für jeden Shop mit komplexeren Versandlogiken. Top!
5.0

Average rating of 5 out of 5 stars

by Jonas
24 June 2024 11:56
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!
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Exemplary support
5.0

Average rating of 5 out of 5 stars

by Sebastian Cis
24 May 2024 17:20
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!
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Mächtiges, gut funktionierendes Werkzeug
5.0

Average rating of 5 out of 5 stars

by Andreas Kremser
4 March 2024 10:10
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!
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Endlich wieder individuelle Berechnungen
5.0

Average rating of 5 out of 5 stars

by Markus
27 March 2023 16:02
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.
5.0 Functionality
5.0 Usability
4.0 Documentation
5.0 Support
Acris = Erweiterung und Support 1+
5.0

Average rating of 5 out of 5 stars

by Henning Vielitz
13 March 2023 16:05
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.
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Produkt und Service sind erstklassig
5.0

Average rating of 5 out of 5 stars

by Axel G.
8 June 2022 14:01
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!
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Endlich die Erweiterung nach der man sucht wenn man komplexen Versand berechnen will.
5.0

Average rating of 5 out of 5 stars

by Nikolaus Pluta
9 December 2021 12:01
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.
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Essenzielle Erweiterung
5.0

Average rating of 5 out of 5 stars

by Fabian Schmitz
29 November 2021 10:30
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.
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Tut was es soll
5.0

Average rating of 5 out of 5 stars

by Quadro GmbH
31 May 2021 09:20
Top Plugin, Top Entwickler mit schnellem Support.
Hatte einige Probleme und Fragen zum Versand, die alle schnell und erfolgreich gelöst werden konnten.
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support

About the Extension Partner

ACRIS E-Commerce GmbH

ACRIS E-Commerce GmbH

Partner Status

  • Shopware Gold Partner Shopware
    Gold Partner
  • Shopware Premium Extension Partner Shopware
    Premium Extension Partner

Details

  • Ø-Rating: 4.9

    Average rating of 4.9 out of 5 stars

  • Partner since: 2015
  • Extensions: 122

Support

  • Based in: Austria
  • Speaks: German, English
  • Response time: Very quickly