# magmodules/magento2-hyva-distance-based-shipping

> Hyvä Themes Compatibility module for Magmodules DistanceBasedShipping

`composer require magmodules/magento2-hyva-distance-based-shipping`

Canonical URL: https://packagento.com/magmodules/magento2-hyva-distance-based-shipping

## At a glance

- **Vendor**: magmodules (https://packagento.com/magmodules.md)
- **Latest version**: 1.0.0 — released 2024-05-15
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/magmodules/magento2-hyva-distance-based-shipping and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require magmodules/magento2-hyva-distance-based-shipping:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Hyvä Themes Compatibility module for Magmodules DistanceBasedShipping

## README

![header-git](https://github.com/magmodules/magento2-distance-based-shipping-hyva/assets/24823946/5c6e2fa4-efff-4e8d-9915-acc271ab3a2c)


## Shipping Costs Based on Distance Hyvä Compatibility plugin


Calculate the exact shipping costs based on the distance to the delivery address using the Google Maps API.

- [Magento 2.4.+](https://github.com/magento/magento2)
- [Hyvä](https://github.com/hyva-themes)
- [Magmodules Distance Shipping](https://www.magmodules.eu/magento2-shipping-costs-based-on-distance.html)    



### About the Shipping Costs Based on Distance Plugin

Introducing our Magento 2 extension for automated shipping cost calculation based on distance. Utilizing the Google Maps API, it calculates actual transport route distances, ensuring accurate shipping costs. Easily configurable, set your per kilometer rate and display costs on the checkout page. 

Enhance customer convenience with a shipping cost calculator on the product page. Requires an active Google API Key. Ideal for both in-house and external courier deliveries, it provides full control over shipping cost settings. Flexible options allow customization to your preferences, including address entry, distance units, calculation methods, and error handling. Global coverage with country-specific settings available. Experience unmatched flexibility with tailored shipping rates based on distance and order values.

Overall, the Shipping Costs Based on Distance plugin for Magento, with its seamless compatibility with the Magento Hyva theme, provides an excellent solution for integrating the Shipping Costs Based on Distance shipping method into your Magento store. 
### Installation

1. Install the module using composer: 

```bash
composer require magmodules/magento2-distanceshipping-hyva
```

2. Enable the module:

```bash
bin/magento module:enable Magmodules_HyvaDistanceBasedShipping
```

3. Upgrade the database:

```bash
bin/magento setup:upgrade
```

4. Let Hyvä know about the new module:

```bash
php bin/magento hyva:config:generate
```

5. Generate the CSS files:

```bash
npm --prefix vendor/hyva-themes/magento2-default-theme/web/tailwind/ run ci
npm --prefix vendor/hyva-themes/magento2-default-theme/web/tailwind/ run build-prod
```

Or from your theme:

```bash
npm --prefix app/design/frontend/<Vendor>/<Theme>/web/tailwind run ci
npm --prefix app/design/frontend/<Vendor>/<Theme>/web/tailwind run build-prod
```

### Shipping Costs Based on Distance Magento plugin features

- Customize your store/warehouse location
- Select distances in kilometers or miles according to your preference
- Personalize your calculation methods
- Blend per kilometer pricing with fixed rates
- Define maximum delivery ranges
- Automated address verification with error alerts for unrecognized addresses
  
### Magento Support

If you have any questions, please fill out our secure contact form by clicking [here](https://www.magmodules.eu/support-form.html).

### Magmodules & Hyva

Magmodules and Hyva have established a strong partnership, working closely together to provide enhanced e-commerce solutions. As an official Hyva partner, we specializes in developing integrations for various platforms and services. 

We have created integrations for well-known providers such as Mollie, Sooqr, Paazl, and many more. This collaboration ensures seamless compatibility and optimized performance for online stores utilizing the Hyva theme. Through our partnership, Magmodules and Hyva strive to deliver comprehensive and tailored solutions to meet the diverse needs of e-commerce businesses.



### Check out our other Hyva Plugins!

[Magento 2 Hyvä Google Reviews](https://github.com/magmodules/magento2-googlereviews-hyva) 

[Magento 2 Hyvä Shopreview](https://github.com/magmodules/magento2-shopreview-hyva) 
 
[Magento 2 Hyvä Product Review Reminder](https://github.com/magmodules/magento2-reviewreminder-hyva) 

[Magento 2 Hyvä eKomi Reviews](https://github.com/magmodules/magento2-ekomi-hyva) 

[Magento 2 Hyvä FeedbackCompany Reviews](https://github.com/magmodules/magento2-feedbackcompany-hyva) 

[Magento 2 Hyvä Mollie](https://github.com/mollie/magento2-hyva-checkout) 

[Magento 2 Hyvä Paazl](https://github.com/Paazl/magento2-hyva-react-checkout)

## Recent Versions

| Version | Released |
|---|---|
| 1.0.0 | 2024-05-15 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| hyva-themes/magento2-compat-module-fallback | * |
| magento/framework | * |
| magmodules/magento2-distance-based-shipping | * |

## Quality

Latest release (1.0.0) passes the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | not tested | not tested | – | – |
| 2.4.8 | – | not tested | not tested | – |
| 2.4.9 | – | – | not tested | not tested |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 6 | 6 warnings (ruleset: Magento2) — 6 auto-fixable with phpcbf |
| PHPMD | Pass | 0 |  |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 3 | valid; 3 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Error | Error | – | – |
| 2.4.8 | – | Error | Error | – |
| 2.4.9 | – | – | Error | Error |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | N/A | 0 | no resolvable dependency tree to audit — Your requirements could not be resolved to an installable set of packages. Problem 1 |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["magmodules/magento2-hyva-distance-based-shipping"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

magmodules is a Magento 2 vendor on Packagento. See https://packagento.com/magmodules.md for their full catalogue.

