Comments (9)
Hi @snc
I wanted to reach out and let you know that the pull request has been merged.
The feature will be released with the next update
from shopware.
Hi there
thank you for letting us know.
ok that is...just weird...always all these plugins :D
anyway, doing our best to solve it,
thanks
from shopware.
Hi
I've just tested it, and it worked on my end.
can you output the json error that happens?
what is inside the ordermail variables? might be an invalid json
thank you
from shopware.
Hi,
I've continued to debug this issue on our side and found the cause of it. It already fails when encoding the JSON in
Shopware/Subscriber/MailSubscriber.php
Line 167 in 3349a3a
NULL
.
I've checked json_last_error()
and it returned 7
(JSON_ERROR_INF_OR_NAN
).
After adding the JSON_PARTIAL_OUTPUT_ON_ERROR
flag to the json_encode
call it finally worked again:
$transaction->setOrdermailVariables(json_encode($variables, JSON_PARTIAL_OUTPUT_ON_ERROR));
Maybe the plugin could check if the call to json_encode
failed, as no exception is thrown by default.
The part of the variables that is causing JSON_ERROR_INF_OR_NAN
can be seen here:
...,"price":"15,71","pseudoprice":"20,95","referenceprice":"NaN","has_pseudoprice":true,"price_numeric":15.712499,...
Let's see if I can find out where the referenceprice
is set to NaN
...
from shopware.
ah perfect
yes, i would love to improve that in the plugin.
most of the time i try to do the fail-fast approach...otherwise you might not have discovered an invalid price in your json :)
but maybe i can switch over to a softer check and add a json parse log entry instead ;)
what do you think?
from shopware.
The following line from the Advanced Promotion Suite plugin is causing the NaN:
$product['additional_details']['referenceprice'] = $price / $purchaseUnit * $referenceUnit;
In our case, the $purchaseUnit
and $referenceUnit
is null
.
I'm unsure about how you should handle NaN
and/or Inf
case, but you should definitely check if the json_encode
result is null
. Maybe using serialize
and unserialize
could be another solution, but this might not be backwards compatible.
from shopware.
Hi @snc
thank you for this.
i've created an improvement based on your input, worked great for me when producing a NaN value.
values will now be 0, which yeah...could be misleading in case its even displayed in the mail
but still better i think, because the main values should always be valid i think :)
in addition to this, warning logs are generated
let me know what you think
from shopware.
Hi @boxblinkracer, the PR looks good to me! Thanks.
from shopware.
perfect, thanks @snc
always happy to help :)
from shopware.
Related Issues (20)
- Apple Pay restrictions cannot be selected when backend is contained in URL multiple times HOT 2
- Checkout Process stops in some Cases HOT 11
- Since the new update to 1.8.6 klarna checkout isn't working anymore in Shopware 5.7.2 HOT 4
- Apple Pay should be invisible on the customer account dashboard in unsupported browsers HOT 7
- "Warning, Mollie is paid but no order exists in Shopware for transaction xxxx" HOT 5
- The amount of the order does not match the total amount from the order lines HOT 11
- Payments failing since latest update HOT 4
- Shopware Default Field "Paid on" is not set HOT 3
- Changing the style of mollie HOT 1
- Apple Pay Direct and Phone Number Required setting lead to failed orders HOT 2
- Session is still missing for Transaction: 823. Shopware has already removed that user data! HOT 1
- WARNING: Method getMollieVoucherType is not existing in Article Attributes. HOT 3
- Show Apple Pay in Shopware 5 Checkout HOT 2
- Falscher Bestellstatus im Mollie Backend HOT 2
- Apple Pay Error HOT 11
- Mollie Prepayment: $Mollie.bank.exists not set in email template HOT 19
- Fatal Error on CreditCardService HOT 2
- Wrong Language in Lang-Sub-Shops HOT 4
- No payment status email send HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopware.