PHPackages                             prasanna/bagisto-weight-shipping - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. prasanna/bagisto-weight-shipping

ActiveBagisto-package

prasanna/bagisto-weight-shipping
================================

Weight based shipping package for Bagisto - Calculate shipping costs based on total cart weight

0.0.3(10mo ago)03MITPHP

Since Jul 14Pushed 10mo agoCompare

[ Source](https://github.com/prasannan-robots/Bagisto-Weight-Shipping)[ Packagist](https://packagist.org/packages/prasanna/bagisto-weight-shipping)[ Docs](https://github.com/prasanna/bagisto-weight-shipping)[ RSS](/packages/prasanna-bagisto-weight-shipping/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Bagisto Weight Based Shipping Package
=====================================

[](#bagisto-weight-based-shipping-package)

A comprehensive weight-based shipping package for Bagisto that calculates shipping costs based on the total weight of cart items.

Features
--------

[](#features)

- **Weight-based Calculation**: Calculates shipping cost based on total cart weight
- **Flexible Rate Configuration**: Support for multiple weight ranges with different rates
- **Admin Configuration**: Easy-to-use admin interface for configuring weight ranges
- **Multi-language Support**: Supports localization for different languages
- **Channel-based Configuration**: Different rates for different sales channels
- **Easy Installation**: Install via Composer with automated setup

Requirements
------------

[](#requirements)

- Bagisto 2.x
- PHP 8.2+
- Laravel 11.x
- Products must have weight attributes set

Installation
------------

[](#installation)

### Method 1: Via Composer (Recommended)

[](#method-1-via-composer-recommended)

```
composer require prasanna/bagisto-weight-shipping
```

### Method 2: Manual Installation

[](#method-2-manual-installation)

1. **Download the package** to your Bagisto installation:

    ```
    git clone https://github.com/prasanna/bagisto-weight-shipping.git packages/prasanna/bagisto-weight-shipping
    ```
2. **Add to composer.json** (in your Bagisto root):

    ```
    {
        "autoload": {
            "psr-4": {
                "Prasanna\\WeightShipping\\": "packages/prasanna/bagisto-weight-shipping/src/"
            }
        }
    }
    ```
3. **Update autoloader**:

    ```
    composer dump-autoload
    ```

Setup
-----

[](#setup)

After installation, run the setup command:

```
php artisan weight-shipping:install
```

This command will:

- Add weight-based shipping to the carriers configuration
- Add admin configuration fields
- Add language translations
- Clear cache

Configuration
-------------

[](#configuration)

1. **Go to Admin Panel** → Configuration → Sales → Shipping Methods
2. **Find "Weight Based Shipping"** section
3. **Configure the following settings**:

### Settings

[](#settings)

- **Title**: Display name for the shipping method
- **Description**: Description shown to customers
- **Weight Ranges**: Configure weight ranges and their corresponding rates
- **Status**: Enable/disable the shipping method

### Weight Ranges Format

[](#weight-ranges-format)

Enter weight ranges in the following format:

```
1:45,5:80,10:120

```

This means:

- **0-1kg**: ₹45
- **1-5kg**: ₹80
- **5-10kg**: ₹120
- **10kg+**: ₹120 (uses last range price)

### Example Configurations

[](#example-configurations)

**Basic Configuration:**

```
1:45,5:80,10:120

```

**Complex Configuration:**

```
0.5:25,1:45,2:60,5:100,10:150,20:250

```

Usage
-----

[](#usage)

### For Customers

[](#for-customers)

1. **Add products to cart** (products must have weight set)
2. **Go to checkout**
3. **Select shipping address**
4. **Choose "Weight Based Shipping"** from available shipping methods
5. **Complete checkout**

### For Admins

[](#for-admins)

1. **Set product weights** in product management
2. **Configure weight ranges** in shipping settings
3. **Enable the shipping method**
4. **Monitor and adjust rates** as needed

How It Works
------------

[](#how-it-works)

### Weight Calculation

[](#weight-calculation)

1. System calculates total weight of all cart items
2. For each item: `item_weight × quantity`
3. Total weight = Sum of all item weights

### Rate Calculation

[](#rate-calculation)

1. System parses the weight ranges configuration
2. Finds the appropriate range for the total cart weight
3. Returns the corresponding shipping rate

### Example

[](#example)

**Weight Ranges**: `1:45,5:80,10:120`

- Cart with 0.5kg total → ₹45 (0-1kg range)
- Cart with 3kg total → ₹80 (1-5kg range)
- Cart with 8kg total → ₹120 (5-10kg range)
- Cart with 15kg total → ₹120 (uses last range)

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

1. **Shipping method not showing**

    - Check if the method is enabled in configuration
    - Verify products have weight attributes set
    - Clear cache: `php artisan cache:clear`
2. **Incorrect rate calculations**

    - Verify weight range format is correct
    - Check product weights are set properly
    - Test with different cart combinations
3. **Configuration not appearing**

    - Run installation command: `php artisan weight-shipping:install`
    - Check if service providers are registered
    - Clear config cache: `php artisan config:clear`

### Debug Steps

[](#debug-steps)

1. **Check product weights**:

    ```
    // In tinker
    $product = Product::find(1);
    dd($product->weight);
    ```
2. **Check cart total weight**:

    ```
    // In tinker
    $cart = Cart::getCart();
    // Check individual item weights
    foreach ($cart->items as $item) {
        echo $item->product->name . ': ' . $item->product->weight . 'kg' . PHP_EOL;
    }
    ```
3. **Check configuration**:

    ```
    // In tinker
    dd(core()->getConfigData('sales.carriers.weightbased'));
    ```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

License
-------

[](#license)

This package is open-source software licensed under the [MIT License](LICENSE).

Support
-------

[](#support)

For issues and questions:

- Check the troubleshooting section above
- Review Bagisto documentation
- Check Laravel logs for errors
- Create an issue on GitHub

Changelog
---------

[](#changelog)

### v1.0.0

[](#v100)

- Initial release
- Basic weight-based shipping calculation
- Admin configuration interface
- Multi-language support
- Automated installation command

Credits
-------

[](#credits)

- **Author**: Prasanna
- **Based on**: Bagisto eCommerce framework
- **Inspired by**: WooCommerce weight-based shipping plugins

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance55

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

302d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/90b37c4d808372f9d6fde3349554edf657116260d8df19a6ec63184a86079ba3?d=identicon)[prasannan-robots](/maintainers/prasannan-robots)

---

Top Contributors

[![prasannan-robots](https://avatars.githubusercontent.com/u/64462247?v=4)](https://github.com/prasannan-robots "prasannan-robots (3 commits)")

---

Tags

phplaravelecommerceshippingbagistoweight-based

### Embed Badge

![Health badge](/badges/prasanna-bagisto-weight-shipping/health.svg)

```
[![Health](https://phpackages.com/badges/prasanna-bagisto-weight-shipping/health.svg)](https://phpackages.com/packages/prasanna-bagisto-weight-shipping)
```

###  Alternatives

[octw/aramex

A Library to integrate with Aramex APIs

2925.2k](/packages/octw-aramex)[tomatophp/filament-pos

POS System for FilamentPHP with a lot of features and integration with Ecommerce Builder

681.5k](/packages/tomatophp-filament-pos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
