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

Invalid Ecomm Order Error caused by Variant Images #95

Open
mrogers-5s opened this issue Feb 21, 2018 · 3 comments
Open

Invalid Ecomm Order Error caused by Variant Images #95

mrogers-5s opened this issue Feb 21, 2018 · 3 comments

Comments

@mrogers-5s
Copy link

There appears to be an issue in spree_chimpy/lib/spree/chimpy/interface/products.rb

I see "invalid ecomm order error" when completing checkout on an order. The MailChimp API serves an error message for the variant image: "Shema describes string, NULL found instead".

This is the rb file snip in question:
image

I believe line 94 is the issue. When setting the image_url on the product proper, there is some nil checking involved, and the key is excluded if there are no images found for a product.

However, in this case, it looks like variants always include the image_url key which results in passing nil if variant_image_url returns nothing.

Looking at the variant_image_url method (pictured below):
image

I believe you want to do one of two things:

  1. Add an else condition that returns an empty string
  2. Modify the call to this function and exlude img_url from the Variant object when no images are available
@braidn
Copy link
Contributor

braidn commented Mar 29, 2018

Just seeing this! Sorry it's taken me a second to get back to this repository. Will totally check this out and see if we can get it fixed.

@mrogers-5s
Copy link
Author

I think this resolves the issue: github.com/mrogers-5s/spree_chimpy_products_fix

I forked the spree-contrib repo, but the class (and process) in question looked to be the same in both cases.

@mrogers-5s
Copy link
Author

Sorry. Here is a useful link. My phone wasnt cooperating.

https://github.com/mrogers-5s/spree_chimpy_products_fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants