Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When previewing a product with variants it throws an error. #1554

Closed
simeon-smith opened this issue Jul 6, 2020 · 1 comment
Closed

When previewing a product with variants it throws an error. #1554

simeon-smith opened this issue Jul 6, 2020 · 1 comment
Labels

Comments

@simeon-smith
Copy link

Description
When I preview a product I get the following error:

Argument 1 passed to craft\commerce\services\PaymentCurrencies::convert() must be of the type float, null given, called in /nitro/sites/site/craft/vendor/craftcms/commerce/src/helpers/Currency.php on line 82

This does not happen when I view the page directly. Only in the preview pane even with no differences between the live page and the "draft". I think it may be related to the commerceCurrency filter. This doesn't appear to happen with a product that doesn't have variants.

To Reproduce
How, and what happened?

  1. Preview a product with variants in the CMS.
  2. Preview won't load.
  3. Preview throws error above.

Expected behavior
What did you expect to happen?
The preview should load just like the live page does.

Additional info

  • Craft version: 3.4.27
  • Commerce version: 3.1.11
  • PHP version: 7.4
  • Database driver & version: MySQL 8.0.20
  • Other Plugins & versions:
@lukeholder
Copy link
Member

Thanks for reporting that! I’ve just fixed it for the next release in e0bf5f0.

To get the fix early, change your craftcms/commerce requirement in composer.json to:

"require": {
  "craftcms/commerce": "dev-develop#e0bf5f0f90a31eb067b3b4fcbd0b6a3343b472f1 as 3.1.11",
  "...": "..."
}

Then run composer update.

nfourtythree pushed a commit that referenced this issue Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants