Closed (fixed)
Project:
Ubercart Addresses
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Feb 2012 at 10:09 UTC
Updated:
4 Jan 2014 at 01:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Michael-IDA commentedHello World,
After talking with MegaChriz, we're offering a $ bonus to whoever can do this:
Please send me an email off my contact form with a flat dollar amount bid and expected completion date.
# # #
MegaChriz,
If you desire any additional tokens, please add them here (quickly), and I can add them into this bonus.
Best,
Sam
Comment #2
megachrizBasically, all the tokens are already there. The only thing that still needs to happen is to get the address tokens from the default addresses available in user context. This is probably very simple. I believe it just as simple as adding two user tokens and make them of type 'uc_addresses'. I've already defined these two user tokens in uc_addresses_token_info(), but I've not implemented them yet in uc_addresses_tokens() (nor did I test yet if I defined the two user tokens completely right).
Comment #3
Michael-IDA commented$25 Bonus for fixing uc_addresses, user tokens
http://groups.drupal.org/node/207918
http://drupal.org/node/1430212
Comment #4
mwsam commentedThis patch adds the missing user's default address tokens.
Comment #5
megachrizThanks for the patch, but it's not complete yet. While
[user:default-billing-address]and[user:default-shipping-address]gets replaced correctly (thanks for that), "subtokens" like[user:default-billing-address:last_name]and[user:default-shipping-address:country]does not get replaced.I used the following code to test the user token implementation:
This results into:
Comment #6
mwsam commentedUpdated with sub-tokens replacement.
Comment #7
mwsam commentedComment #8
Michael-IDA commentedwill test in about 2 hrs. sam
Edit: well that didn't happen....
Comment #9
Michael-IDA commentedHi MegaChriz,
These tested okay:
so, looks good to me. If you don't see a problem in any of the others, I think we can call this good.
mwsam,
Please send me your payment method/info through my drupal contact form.
Thanks,
Sam
Comment #10
megachrizI've made one small change to the patch: instead of calling
uc_addresses_tokens()for generating the subtokens, I usedtoken_generate(). This way, any address tokens added by other modules will also work in user context.I've also added an automated test to test the token replacement.
See commit.
Comment #11
Michael-IDA commentedThanks MegaChriz,
Sam