I am using SpreeTaxCloud for doing a tax lookup through the state machine,
with Spree v.1.3.2-stable

In order_decorator.rb I have this:

self.state_machine.after_transition :to => :payment
:do => :lookup_tax_cloud,
:if => :tax_cloud_eligible?

I would like to do another call but not sure how that would be done, both
in terms of doing 2 calls, and also specifically how to call my calculator:

self.state_machine.after_transition :to => :payment
:do => :lookup_tax_cloud,
:if => :tax_cloud_eligible?

self.state_machine.after_transition :to => :payment
:do =>
Spree::Calculator::PromotionTax.compute(self)

So above is pseudo code, what would that really be?

Reason for this is I do not have a tax amount until transition to Checkout
Payment.

It appears that the calculator is not called at that time.

Thanks!

Jet

--

Search Discussions

  • Jet at Jan 24, 2013 at 11:18 pm
    Evidently that was close.

    self.state_machine.after_transition :to => :payment , :do =>
    :update!

    ...is the correct call.

    Jet

    On Thursday, January 24, 2013 1:52:11 PM UTC-8, Jet wrote:

    I am using SpreeTaxCloud for doing a tax lookup through the state machine,
    with Spree v.1.3.2-stable

    In order_decorator.rb I have this:

    self.state_machine.after_transition :to => :payment
    :do => :lookup_tax_cloud,
    :if => :tax_cloud_eligible?

    I would like to do another call but not sure how that would be done, both
    in terms of doing 2 calls, and also specifically how to call my calculator:

    self.state_machine.after_transition :to => :payment
    :do => :lookup_tax_cloud,
    :if => :tax_cloud_eligible?

    self.state_machine.after_transition :to => :payment
    :do =>
    Spree::Calculator::PromotionTax.compute(self)

    So above is pseudo code, what would that really be?

    Reason for this is I do not have a tax amount until transition to Checkout
    Payment.

    It appears that the calculator is not called at that time.

    Thanks!

    Jet

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedJan 24, '13 at 9:52p
activeJan 24, '13 at 11:18p
posts2
users1
websitespreecommerce.com
irc#RubyOnRails

1 user in discussion

Jet: 2 posts

People

Translate

site design / logo © 2022 Grokbase