Page 1 of 1

More than 9 shipping methods - bug or feature

Posted: 19 Jun 2024, 13:39
by BundasTm
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?

Re: More than 9 shipping methods - bug or feature

Posted: 19 Jun 2024, 16:14
by Jan
Hi, which version of Phoca Cart do you use?

This was fixed in latest 5.0.0 Beta versions. So yes, this needs to be modified if some previous version is used:

Image

Jan

Re: More than 9 shipping methods - bug or feature

Posted: 19 Jun 2024, 21:43
by BundasTm
4.0.10

Thank you, I have already modified it yesterday.
Then we'll wait for the non-beta update.

Re: More than 9 shipping methods - bug or feature

Posted: 20 Jun 2024, 15:42
by Jan
OK