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

[Spree 2 Upgrade] Investigate current customizations on Spree's checkout #2218

Closed
sauloperez opened this issue Apr 13, 2018 · 11 comments
Closed
Assignees
Labels
spike A time-boxed investigation/implementation to access suitability of a tool or feature

Comments

@sauloperez
Copy link
Contributor

sauloperez commented Apr 13, 2018

Description

Before thinking about implementing our checkout onto Spree 2.0 we first need to have a clear picture of all the customizations we did there and where are they in the codebase.

Once we have that clear understanding we'll be able to foresee how these customizations impact the upgrade

Expectations

We should carefully document these findings as a wiki page so that we don't miss it.

@sauloperez sauloperez added the spike A time-boxed investigation/implementation to access suitability of a tool or feature label Apr 13, 2018
@sauloperez
Copy link
Contributor Author

who should work on this @enricostano ?

@enricostano
Copy link
Contributor

@mkllnk @Matt-Yorkley perhaps? Any volunteer? I'm sure also @oeoeaio has some insight nobody else knows 😃

@oeoeaio
Copy link
Contributor

oeoeaio commented Apr 23, 2018

As far as I know the majority of the customisation we have done is in CheckoutController#update (we actually created our own CheckoutController which inherits from Spree::CheckoutController, I'm not sure why we did that). We have hacked the Spree::Order model A LOT, and I'm sure some of that has an influence on the checkout, but don't think we've altered the actual state machine all that much if at all.

@enricostano
Copy link
Contributor

Probably good outcomes of this task would be:

  • documentation of all the possible states an order must go through
  • documentation of all the "callbacks"(?) we call transitioning from one state to another

@sauloperez
Copy link
Contributor Author

What I can tell is that we overrode the checkout flow as shown below to add couple things on top:

checkout_flow do
go_to_state :address
go_to_state :delivery
go_to_state :payment, :if => lambda { |order|
# Fix for #2191
if order.shipping_method.andand.delivery?
if order.ship_address.andand.valid?
order.create_shipment!
order.update_totals
end
end
order.payment_required?
}
# NOTE: :confirm step was removed because we were not actually using it
# go_to_state :confirm, :if => lambda { |order| order.confirmation_required? }
go_to_state :complete
remove_transition :from => :delivery, :to => :confirm
end

@mkllnk mkllnk self-assigned this Jun 22, 2018
@mkllnk
Copy link
Member

mkllnk commented Jun 22, 2018

Okay, I will put my findings in this post first, using it as a wiki and then moving that to the wiki when ready. Maybe you can give me some feedback @sauloperez? Is the following what you imagined to be done for this task?

Customisations and updates of the checkout process

The following lists are a summary of customisations to consider in the Spree Upgrade. It doesn't contain all customisation. Otherwise I could just paste the content of the decorator classes here.

The original post has been moved to https://github.com/openfoodfoundation/openfoodnetwork/wiki/Spree-Upgrade%3A-Checkout-customisations.

@sauloperez
Copy link
Contributor Author

sauloperez commented Jul 16, 2018

Wow @mkllnk that's more than I expected! can you please add a wiki page and reference it from https://github.com/openfoodfoundation/openfoodnetwork/wiki/Spree-Upgrade-Themes ? that sounds like a good place to have it, agree?

@mkllnk
Copy link
Member

mkllnk commented Jul 19, 2018

@sauloperez I created individual pages for the upgrade themes to keep it a bit tidier. I think we need to create a task list from all this, possibly convert it into an epic.

@sauloperez
Copy link
Contributor Author

Yep, I think this deserves some sort of inception to then fit small isolated issues into #2216

@luisramos0
Copy link
Contributor

I guess this investigation is complete, right @mkllnk ? Can we close this issue?

@mkllnk
Copy link
Member

mkllnk commented Aug 10, 2018

Yes, I think we can close it.

I still have a not about creating an issue for payment_attributes, but looking at the code now, I can't see any reason for that. Was that the thing that we thought payment_attributes was removed, but they removed only a duplicate. It's still there and works the same as before.

@mkllnk mkllnk closed this as completed Aug 10, 2018
@luisramos0 luisramos0 changed the title Investigate current customizations on Spree's checkout [Spree 2 Upgrade] Investigate current customizations on Spree's checkout Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spike A time-boxed investigation/implementation to access suitability of a tool or feature
Projects
None yet
Development

No branches or pull requests

5 participants