oxid-esales / freeshipping-coupons-module
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Type:oxideshop-module
Requires
- php: ^8.2
- symfony/filesystem: ^6.0
Requires (Dev)
- codeception/codeception: ^5.1
- codeception/module-asserts: ^3.0
- codeception/module-db: ^3.1
- codeception/module-filesystem: ^3.0
- codeception/module-webdriver: ^4.0
- mikey179/vfsstream: ^1.6
- oxid-esales/codeception-modules: dev-b-7.3.x
- oxid-esales/codeception-page-objects: dev-b-7.3.x
- oxid-esales/developer-tools: dev-b-7.3.x
- oxid-esales/oxideshop-ce: dev-b-7.3.x
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^11.4
- squizlabs/php_codesniffer: 3.*
Conflicts
- oxid-esales/oxideshop-ce: <7.3
This package is not auto-updated.
Last update: 2025-06-17 22:28:03 UTC
README
This module introduces a new coupon type, shipfree
, designed to balance shipping costs to zero for eligible orders. When applied, this coupon calculates its value based on the current basket’s shipping cost, effectively covering all shipping fees for the user.
Branch compatibility
- 1.1.x versions (or b-7.3.x branch) are compatible with OXID eShop compilation b-7.3.x
- 1.0.x versions (or b-7.2.x branch) are compatible with OXID eShop compilation b-7.2.x
Installation
- Run the following command to install the latest version of this module:
composer require oxid-esales/freeshipping-coupons-module ^1.1
- Before activating the module, make sure you run migrations first
vendor/bin/oe-eshop-doctrine_migration migrations:migrate oe_freeshipping
- Activate the module through the admin interface or command line:
vendor/bin/oe-console oe:module:activate oe_freeshipping
Development installation on OXID eShop SDK
The installation instructions below are shown for the current SDK for shop 7.3. Make sure your system meets the requirements of the SDK.
-
Ensure all docker containers are down to avoid port conflicts
-
Clone the SDK for the new project
echo MyProject && git clone https://github.com/OXID-eSales/docker-eshop-sdk.git $_ && cd $_
- Clone the repository to the source directory
git clone --recurse-submodules https://github.com/OXID-eSales/freeshipping-coupons-module.git --branch=b-7.3.x ./source
- Run the recipe to setup the development environment
./source/recipes/setup-development.sh
You should be able to access the shop with http://localhost.local and the admin panel with http://localhost.local/admin (credentials: noreply@oxid-esales.com / admin)
Usage
Configuration:
- Navigate to Shop Settings → Coupon Series → Main.
- Under Discount, select the
shipfree
to enable shipping cost compensation on orders. - Configure the remaining coupon settings as desired.
Usage Notes:
- Zero-value vouchers appear in the cart to ensure
shipfree
coupons are calculated during checkout. - If no delivery fees apply, users will see the error, “The voucher might be wasted if not applied to an order with delivery fees.”
Testing & Limitations:
- Ensure that shipping settings are configured.
- Only one
shipfree
coupon is allowed per basket.
Order confirmation emails
In order to properly display the free shipping voucher value in order confirmation email, you need to change the templates
named order_cust.html.twig
and order_owner.html.twig
to display the free shipping coupons value and shown in the example below.
{% for voucher in order.getVoucherList() %} {% set voucherseries = voucher.getSerie() %} <tr valign="top" bgcolor="#ebebeb"> <td align="right" colspan="{{ iFooterColspan }}" class="odd text-right">{{ voucher.oxvouchers__oxvouchernr.value }}</td> <td align="right" class="odd text-right"> {% if voucherseries.oxvoucherseries__oxdiscounttype.value == "absolute" %} {{ format_price(voucherseries.oxvoucherseries__oxdiscount.value , { currency: currency }) }} {% elseif voucherseries.oxvoucherseries__oxdiscounttype.value == "percentage" %} {{ voucherseries.oxvoucherseries__oxdiscount.value }}% {% elseif voucherseries.oxvoucherseries__oxdiscounttype.value == "shipfree" %} {{ format_price(voucher.oxvouchers__oxdiscount.value , { currency: currency }) }} {% endif %} </td> </tr> {% endfor %} ```bash ## Testing ### Linting, syntax check, static analysis ```bash $ composer update $ composer static
Unit/Integration/Acceptance tests
- Install this module in a running OXID eShop
- Reset the shop's database
bin/oe-console oe:database:reset --db-host=db-host --db-port=db-port --db-name=db-name --db-user=db-user --db-password=db-password --force
- Run all the tests
composer tests-all
- Or the desired suite
composer tests-unit composer tests-integration composer tests-codeception