Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way where we could change the AJAX request to fetch shipping quote based on the State/Province selection instead of postal code?
Comment | File | Size | Author |
---|---|---|---|
#4 | 1317692-data-text-comparison-zone-value.png | 103.11 KB | MegaChriz |
Comments
Comment #1
longwaveI think we will need to add options for this somewhere, we can't easily determine it automatically from the available rules.
Comment #2
jonloh CreditAttribution: jonloh commentedYeap. An option for this AJAX feature would be great.
Prolly we could add this option somewhere in checkout pane configuration page? I'll see if I would be able to come up with the code to add this option into some configuration page.
Comment #3
Michael-IDA CreditAttribution: Michael-IDA commentedCould really use this, as we do shipping quotes by State/Province not zip code.*
*Someone have an example Rule condition that uses zip codes?
Obviously one could do a huge OR as below, but a PHP array_search would have to be easier, if it's usable?
Comment #4
MegaChriz CreditAttribution: MegaChriz commentedIn rules, you can just use Data > Text comparison for the zone value (see image), but currently shipping costs are only updated when the postal code or country changes, or when an address is selected from the "saved addresses" (I may be wrong, but it looks like the shipping costs are not correctly updated when the customer selects an other address).
Comment #5
Michael-IDA CreditAttribution: Michael-IDA commentedYeah, I knew about the zone usage http://drupal.org/node/1447128 , but based upon a clean install, the shipping costs are only changed when the Country changes* or the Postal code field loses focus. And you're right, selecting from the drop down doesn't trigger shipping costs.**
And as a last tidbit, using the Postal code field, gives wonky results. Sometimes it triggers my "22222" zip code on checkout and sometimes it doesn't. In "Estimated shipping cost:" on cart it doesn't trigger either 11111 or 22222 (but does trigger on zone).
Best,
Sam
*And this seems useless, as the State/Province is re-set to "Select" so it can't pull up the correct shipping costs anyway.
**Oh, it's really hosed, well the drop down is. (Still with a clean install, no uc_address) Selected a drop down with Alabama and 11111 Postal code, no shipping costs triggered. Select another address Newfoundland (Canada) and 22222 Postal code, "Alabama" shipping cost is triggered (but not 11111 or 22222).
(will go open a ticket)
Comment #6
TR CreditAttribution: TR commentedAdditional information in #1448288: Shipping costs not triggered correctly on /cart and /cart/checkout
Comment #7
Michael-IDA CreditAttribution: Michael-IDA commentedHi Tim,
I re-opened the bug report, as it is only dealing with bugs, not this request.
Best,
Sam
Comment #8
longwaveThis will be solved by #1373236: Allow multiple modules to react on checkout Ajax events