You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.
I'm looking at implementing a warranty upsell to specific products in my store. I've built out a simple ProductType model that has_many :product_addons, and now Products have_many addons through :product_types. I've done something very similar before under Spree 2.0 but I'm pretty sure my implementation could be improved. Now that the 2.2 adjustments refactor is out I'm faced with making a few guesses about a solid implementation. I'm sure I'll make it work, but this seems like a good case for a custom adjustments guide.
Possible guide content
The adjustment calculator API - which methods to implement? Should I subclass an existing calculator?
A sample custom adjustment overview - all of the classes, tables, etc. required to pull it off on the backend. In practice I need admin CRUD screens to manage my custom adjustment options and I need to adjust the _cart_form template to add the adjustments to the frontend, but that is not exactly central to the guide I'm proposing here.
Recommendations on extending the OrderPopulator/OrderUpdater - how and where would you safely add extra data to the cart? I pulled this off under 2.0 but again I imagine it could've been done better.
The text was updated successfully, but these errors were encountered:
dpritchett
changed the title
Provide guidance on designing a custom line item adjustment type
Provide guidance on designing a custom order or line_item adjustment type
Apr 11, 2014
Simply included on any model that wishes to create adjustments. Then all it really came down to was finding out where in the checkout process you'd like to implement your adjustment and creating a custom calculator. The creation of custom calculators could be covered better, and the inclusion of some best practices for injecting adjustments into your checkout process.
This is sort of a companion request to spree/spree#4483
Sample use case
I'm looking at implementing a warranty upsell to specific products in my store. I've built out a simple
ProductType
model thathas_many :product_addons
, and now Productshave_many
addonsthrough :product_types
. I've done something very similar before under Spree 2.0 but I'm pretty sure my implementation could be improved. Now that the 2.2 adjustments refactor is out I'm faced with making a few guesses about a solid implementation. I'm sure I'll make it work, but this seems like a good case for a custom adjustments guide.Possible guide content
_cart_form
template to add the adjustments to the frontend, but that is not exactly central to the guide I'm proposing here.OrderPopulator
/OrderUpdater
- how and where would you safely add extra data to the cart? I pulled this off under 2.0 but again I imagine it could've been done better.The text was updated successfully, but these errors were encountered: