Greetings Spreeple..

I am in the process of completing an integration to a third party
fulfillment organization. As part of this integration, I need to write the
code to retrieve order status from the fulfillment house and update
statuses in Spree for the given order and perhaps update/refund on order
items that could not be filled or might be filled with lesser quantities.

I'm worming my way through the code to attempt to figure this out, but
would greatly appreciate if anyone can point me either to examples of how
to update orders in progress or the Spree code I need to be looking at to
figure out the appropriate methods/helpers to call to make the updates. I'm
currently on a path to update values for state, but am still not clear on a
few things.

Questions that are floating in my head...

Will updating order.state for example trigger the appropriate email updates
to the customer by just changing the value of state?

If the number of any single item is reduced, is there some action that I
need to take to trigger a recalculation of the order total cost and trigger
a refund or some change in charge for the order?

I appreciate any help that can be offered.

Thanks

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Ryan Bigg at Apr 3, 2013 at 10:12 pm
    HI Randy,

    Replies are inline.

    Will updating order.state for example trigger the appropriate email updates
    to the customer by just changing the value of state?
    No, changing the state will not trigger any state transition events to
    trigger. I know it sounds weird, but you're just setting an attribute,
    which is done using AR and bypasses all state_machine code. If you want to
    deliver the order confirmation email, you can always call
    deliver_order_confirmation_email manually, which will cause the
    confirmation email to be sent.

    You may want to call finalize! instead, which does a bunch of other stuff
    with inventory, adjustments, and shipments. I don't know your exact use
    case, so I can't advise.

    If the number of any single item is reduced, is there some action that I
    need to take to trigger a recalculation of the order total cost and trigger
    a refund or some change in charge for the order?
    If you change the amount of an order, you can call order.update! which will
    cause all the totals in the order to be recalculated.

    I hope that answers your questions.
    I appreciate any help that can be offered.

    Thanks

    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --

    Ryan Bigg
    Community Manager
    Spree Commerce, Inc.

    Register now for SpreeConf
    May 20-21 in Washington, D.C.
    http://spreeconf.com

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Ryan Bigg at Apr 3, 2013 at 10:18 pm
    I've just added this to the documentation on the new_guides branch on
    spree-guides, just FYI:
    https://github.com/spree/spree-guides/commit/8d59221bb4a5633816951b645f69c60317954271.
    Thanks for the prompt.

    On Thu, Apr 4, 2013 at 9:11 AM, Ryan Bigg wrote:

    HI Randy,

    Replies are inline.

    Will updating order.state for example trigger the appropriate email
    updates to the customer by just changing the value of state?
    No, changing the state will not trigger any state transition events to
    trigger. I know it sounds weird, but you're just setting an attribute,
    which is done using AR and bypasses all state_machine code. If you want to
    deliver the order confirmation email, you can always call
    deliver_order_confirmation_email manually, which will cause the
    confirmation email to be sent.

    You may want to call finalize! instead, which does a bunch of other stuff
    with inventory, adjustments, and shipments. I don't know your exact use
    case, so I can't advise.

    If the number of any single item is reduced, is there some action that I
    need to take to trigger a recalculation of the order total cost and trigger
    a refund or some change in charge for the order?
    If you change the amount of an order, you can call order.update! which
    will cause all the totals in the order to be recalculated.

    I hope that answers your questions.
    I appreciate any help that can be offered.

    Thanks

    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --

    Ryan Bigg
    Community Manager
    Spree Commerce, Inc.

    Register now for SpreeConf
    May 20-21 in Washington, D.C.
    http://spreeconf.com


    --

    Ryan Bigg
    Community Manager
    Spree Commerce, Inc.

    Register now for SpreeConf
    May 20-21 in Washington, D.C.
    http://spreeconf.com

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Randy Terbush at Apr 4, 2013 at 12:14 am
    Thanks Ryan!

    This info and the link below are exactly the details I was looking for.
    Very helpful.

    New docs are looking great.
    On Wednesday, April 3, 2013 4:11:57 PM UTC-6, Ryan Bigg wrote:

    HI Randy,

    Replies are inline.

    Will updating order.state for example trigger the appropriate email
    updates to the customer by just changing the value of state?
    No, changing the state will not trigger any state transition events to
    trigger. I know it sounds weird, but you're just setting an attribute,
    which is done using AR and bypasses all state_machine code. If you want to
    deliver the order confirmation email, you can always call
    deliver_order_confirmation_email manually, which will cause the
    confirmation email to be sent.

    You may want to call finalize! instead, which does a bunch of other stuff
    with inventory, adjustments, and shipments. I don't know your exact use
    case, so I can't advise.

    If the number of any single item is reduced, is there some action that I
    need to take to trigger a recalculation of the order total cost and trigger
    a refund or some change in charge for the order?
    If you change the amount of an order, you can call order.update! which
    will cause all the totals in the order to be recalculated.

    I hope that answers your questions.
    I appreciate any help that can be offered.

    Thanks

    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --

    Ryan Bigg
    Community Manager
    Spree Commerce, Inc.

    Register now for SpreeConf
    May 20-21 in Washington, D.C.
    http://spreeconf.com
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedMar 29, '13 at 5:22p
activeApr 4, '13 at 12:14a
posts4
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Randy Terbush: 2 posts Ryan Bigg: 2 posts

People

Translate

site design / logo © 2022 Grokbase