My situation is similar, but opposite
[when "Getting shipping quote via (flatrate) standard nationwide" ]
- [if "number of items is greater than three"]
- - ["add $2 to the quote" (custom PHP)]
It looked like CA would be perfect, but no actions I add to the [when "Getting shipping quote via (flatrate) standard nationwide" ] is triggering, not even a condition-less "message to user"
I traced the code and started putting in debug logs, but it feels the quote calculation is a stand-alone action that's just not pulling any triggers.
So the intuative way didn't work.
I also tried the work-around from rosswog 10/19/2009
- create both an $8.00 and a $10.00 'flat rate'
- added a condition to the $8 to run if 3 or less
- added a condition to the $10 to run if more than 3
And after some fiddling that works!
Those default CAs provided by flatrate are a little confusing, because they don't contain any action - 'the get quote' uc_flatrate_ca_predicate() at the end of the process ... although they seem to just work anyway. But yes, putting conditions on them does work.
I tried weightquote as well, but tracing that showed the same thing.
Is uc_flatrate just not 100% integrated with the CA way of doing things?
uc_quote_request_quote() ->
_uc_quote_assemble_quotes() ->
... looks like it's calling ca_load_trigger_predicates('get_quote_from_
to find out IF to run, but does not follow up with the THEN do this. It ignores the user input and just does its own thing.
I'm thinking it needs to execute the #actions there.
And that uc_quote_action_get_quote() should be one of the actions - not inlined code.
...
.. yes, I patched that in and it's nicer.
Maybe I'll put an issue into d.o for this.
