- Issue created by @introfini
Based on the [Drupal.org compose tips]( https://www.drupal.org/filter/tips → ), here's the issue submission using only allowed HTML tags:
## **Title:**
```
TypeError: Unsupported operand types: int + string in UserPointsDetails->calculateUsablePoints()
```
## **Body:**
```
The calculateUsablePoints() method in UserPointsDetails.php throws a TypeError when trying to add string values returned by getString() to numeric variables.
TypeError: Unsupported operand types: int + string in Drupal\commerce_user_points\UserPointsDetails->calculateUsablePoints() (line 79)
Lines 78-79 use getString() which returns strings, but the code tries to add them to numeric variables:
<?php
$totalEarnedPoints += $nodeObject->get('field_earned_points')->getString();
$totalUsedPoints += $nodeObject->get('field_used_points')->getString();
?>
Replace getString() with direct value access:
<?php
$totalEarnedPoints += $nodeObject->get('field_earned_points')->value;
if (!$nodeObject->get('field_used_points')->isEmpty()) {
$totalUsedPoints += $nodeObject->get('field_used_points')->value;
}
?>
Drupal version: 10.x
Module version: [your version]
```
This uses only the allowed HTML tags from the Drupal.org compose tips: `
`, `
`, ``, ``, `- `, ``, and `
`.
Active
3.0
Code