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

Quick Order Form bug fixes and improvements #11

Closed
brettflorio opened this issue Sep 22, 2020 · 2 comments
Closed

Quick Order Form bug fixes and improvements #11

brettflorio opened this issue Sep 22, 2020 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request released

Comments

@brettflorio
Copy link
Contributor

brettflorio commented Sep 22, 2020

Consistency in naming

There are a few inconsistencies with the "quick order form" currently. Let's tidy them up with the following:

  • The element should be foxy-items-form. (We like foxy-products-form better but for consistency with the API, let's keep items or @brettflorio will hate it.)
  • The products property on the component should change to items.

Consistency in Data?

Currently, items added as <foxy-item /> elements don't show up in the .products property of the element (which we'll rename to .items, per above). Can we make this work? I realize they might be technically different, but I'd "expect" for <foxy-item /> elements to be in the items property, as well as vice versa. Though I realize perhaps that might not actually make sense from a DOM + JS perspective, as they aren't the same things.

QuickOrder#submit fails due to CORS

We can't (currently) do a POST to the /cart endpoint, as we don't support CORS. For now, just make this do a normal POST to /cart.

Default cart=checkout parameter

Add cart="checkout" as a default parameter. Valid options are checkout, empty/null, and add (which is the same as empty/null). By default, this page should send the customer to the checkout.

Default Subscription Parameters

Add sub_modify="replace" and sub_restart="auto" to the output. Allow them to be overridden with empty values or as here: https://wiki.foxycart.com/v/2.0/products/subscriptions#subscription-related_product_options.

Default target parameter

Same as #6. This component may be used inside an iframe (like in Wix), and it should work by default there.

Default to quantity=0

I think we discussed this before, but it looks like it was lost. Two issues:

  1. Need to default to quantity 0, not 1, if not specified.
  2. Apparently a quantity 0 throws an error? "Invalid product". See it like this:
    const foxyQuickOrderForm = document.querySelector('foxy-quick-form');
    const foxyQuickOrderFormItems = document.querySelectorAll('foxy-quick-form foxy-item');
    for (let i = 0; i < foxyQuickOrderFormItems.length; i++) {
      const item = foxyQuickOrderFormItems[i];
      item.quantity = 0;
    }

Thumbnail Display Options

The goal here would be to allow people to more directly style the thumbnail. For instance:

  1. cover and dropshadowed
  2. contain and no dropshadow
  3. either (cover/contain) and border, not shadow

The best way to do this may be with a CSS shadow part. TBD.

@brettflorio brettflorio added bug Something isn't working enhancement New feature or request labels Sep 22, 2020
ndvo added a commit that referenced this issue Sep 23, 2020
Inconsistencies with the "quick order form" naming.
addresses topic Inconsistencies in naming from issue #11
ndvo added a commit that referenced this issue Sep 23, 2020
The items property of the component can be used to both set and get the values of the items. Values
are returned as a JS object.

re #11
@ndvo
Copy link
Contributor

ndvo commented Sep 23, 2020

Thumbnail Display Options: @dantothefuture implemented this feature. at d946ddf.

Adding a checklist to ease keeping track of this.

  • Consistency in naming
  • Consistency in Data
  • ItemsForm#submit fails due to CORS
  • Default cart=checkout parameter
  • Default Subscription Parameters
  • Default to quantity=0
  • Thumbnail Display Options

ndvo added a commit that referenced this issue Sep 24, 2020
avoid failing submission due to CORS issues

addresses issue #11
ndvo added a commit that referenced this issue Sep 24, 2020
ndvo added a commit that referenced this issue Sep 24, 2020
Addresses issue #11, default target and cart parameters
ndvo added a commit that referenced this issue Sep 24, 2020
items should default to quantity 0, not 1. Items with zero qty are not to be considered invalid.

addresses issue #11
@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request released
Projects
None yet
Development

No branches or pull requests

2 participants