ver. 0.305: Fix permutation attribute sorting + free delivery progress bar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,8 +94,13 @@ class BasketCalculator
|
||||
if ( isset( $val['parent_id'] ) and (int)$val['parent_id'] and isset( $val['product-id'] ) )
|
||||
$permutation = $productRepo->getProductPermutationHash( (int)$val['product-id'] );
|
||||
|
||||
if ( !$permutation and isset( $val['attributes'] ) and is_array( $val['attributes'] ) and count( $val['attributes'] ) )
|
||||
$permutation = implode( '|', $val['attributes'] );
|
||||
if ( !$permutation and isset( $val['attributes'] ) and is_array( $val['attributes'] ) and count( $val['attributes'] ) ) {
|
||||
$attrs = $val['attributes'];
|
||||
usort( $attrs, function ( $a, $b ) {
|
||||
return (int) explode( '-', $a )[0] - (int) explode( '-', $b )[0];
|
||||
} );
|
||||
$permutation = implode( '|', $attrs );
|
||||
}
|
||||
|
||||
$quantity_options = $productRepo->getProductPermutationQuantityOptions(
|
||||
$val['parent_id'] ? $val['parent_id'] : $val['product-id'],
|
||||
|
||||
Reference in New Issue
Block a user