Not calculating properly in D10

Created on 14 February 2024, 11 months ago
Updated 14 March 2024, 10 months ago

Problem/Motivation

Not calculating properly and erratic behaviour in drupal 10

Steps to reproduce

Update the commerce_shipping_weight.info file and add compatibility with D10
+ core_version_requirement: ^8 || ^9 || ^10
install the module and set some weight based tariffs
add items to your cart so the weight exceeds one of the tariffs and checkout
the first item will be added postage and the base price will be combined to give an arbitrary shipping cost
adding extra weighted items does not change the cost - even up to 20kg so it is not cycling through the weights

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom drupalferret

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @drupalferret
  • 🇹🇭Thailand AlfTheCat

    Same issue here, using latest dev and latest version of Drupal.

    In the log, I get:

    Warning: Trying to access array offset on value of type null in Drupal\commerce_shipping_weight_tariff\Plugin\Commerce\ShippingMethod\ShippingByWeight->calculateRates() (line 134 of /var/www/***/modules/contrib/commerce_shipping_weight_tariff/src/Plugin/Commerce/ShippingMethod/ShippingByWeight.php)

  • Hi,@Yaroslav Samoilenko and all other mantainers

    here is the patch to resolve this issue.This patch contains updated code for the ShippingByWeight class, addressing null value warnings and improving error handling.The updated ShippingByWeight class now includes robust error handling to prevent null value warnings during shipping rate calculation.These configuration updates enhance the flexibility and accuracy of weight-based tariffs in the commerce_shipping_weight_tariff module.

    Hope you appreciate my time and efforts.

    Thank you.

Production build 0.71.5 2024