Skip to content

Commit

Permalink
Merge pull request #620 from krokedil/develop-quantity-mismatch-v2
Browse files Browse the repository at this point in the history
Compare quantity as a string
  • Loading branch information
mntzrr authored Sep 23, 2024
2 parents 83c1c66 + 8244038 commit 5e4687c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/.wp
/node_modules
/yarn.lock
# wp-scopify dependencies
/dependencies
/vendor

SyncToy_f76a6219-f902-4b34-8524-b4fd7b7279a4.dat
lib/selenium-server-standalone.jar
lib/drivers/chromedriver.exe
Expand All @@ -17,4 +20,5 @@ nightwatch.conf.js
# OS X metadata
.DS_Store
.vscode/settings.json
.idea/
.idea/

2 changes: 1 addition & 1 deletion includes/kco-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ function kco_validate_order_content( $klarna_order, $order ) {
$match = true;
$name = $klarna_item['name'];

if ( $quantity !== $klarna_item['quantity'] ) {
if ( strval( $quantity ) !== strval( $klarna_item['quantity'] ) ) {
// translators: %1$s: Product name, %2$d: Expected quantity, %3$d: Found quantity.
$notes[] = sprintf( __( 'The product "%1$s" has a quantity mismatch. Expected %2$d found %3$d.', 'klarna-checkout-for-woocommerce' ), $name, $klarna_item['quantity'], $quantity );
KCO_Logger::log( "$prefix WC order item reference: $reference ($name) has {$quantity} expected {$klarna_item['quantity']}." );
Expand Down

0 comments on commit 5e4687c

Please sign in to comment.