More than 9 shipping methods - bug or feature
Posted: 19 Jun 2024, 13:39
More than 9 shipping methods are required at the customer's site due to different service providers and the number of different delivery times.
When we added the shipping methods to the payment methods, it did not save all of them, even though we tried several times.
In the phocacart_payment_method_shipping table in the database, we saw that we had the shipping methods assigned, as many as we had originally assigned, but for some reason the shipping_id had 1 in many cases.
Looking at the source code, we found out why.
The relevant code snippet:
components/com_phocacart/libraries/phocacart/shipping/shipping.php:735
/* used as payment rule*/
public static function storeShippingMethods($shippingsArray, $id, $table = 'payment') {
.....
foreach($shippingsArray as $k => $v) {
$values[] = ' ('.(int)$id.', '.(int)$v[0].')';
}
Here in $values[] = ' ('.(int)$id.', '.(int)$v[0].')'; is it intentional to only pass the first character to the second variable, or is it a bug?
When we added the shipping methods to the payment methods, it did not save all of them, even though we tried several times.
In the phocacart_payment_method_shipping table in the database, we saw that we had the shipping methods assigned, as many as we had originally assigned, but for some reason the shipping_id had 1 in many cases.
Looking at the source code, we found out why.
The relevant code snippet:
components/com_phocacart/libraries/phocacart/shipping/shipping.php:735
/* used as payment rule*/
public static function storeShippingMethods($shippingsArray, $id, $table = 'payment') {
.....
foreach($shippingsArray as $k => $v) {
$values[] = ' ('.(int)$id.', '.(int)$v[0].')';
}
Here in $values[] = ' ('.(int)$id.', '.(int)$v[0].')'; is it intentional to only pass the first character to the second variable, or is it a bug?