Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using VZ address with ElementCriteriaModel searches #28

Open
prkirby opened this issue Jul 12, 2017 · 2 comments
Open

Using VZ address with ElementCriteriaModel searches #28

prkirby opened this issue Jul 12, 2017 · 2 comments

Comments

@prkirby
Copy link

prkirby commented Jul 12, 2017

I was wondering if there was a way to use VZ address sub-fields with the element criteria model within a plugin.

Essentially I need to filter users by postalcode, state, you get the point.

Ive tried:
$criteria->addressField->postalCode = '48348',
$criteria->addressField['postalCode'] = '48348', and
$criteria->search = 'addressField["postalCode"]:48348'
All of which fail.

Not sure if this is possible since I'm not 100% on how the subfields are set up. Any help on this would be fantastic!

@elivz
Copy link
Owner

elivz commented Jul 13, 2017

Unfortunately, I don't think that is possible. At least, last time I tried it, I couldn't find any API to make those sub-fields available to Craft to filter by. I can take another look in the next couple days to see if there have been any new developments there since I last looked, though!

@prkirby
Copy link
Author

prkirby commented Jul 13, 2017

No Problem! I love the plugin, just figured I would reach out. For now I'm just gonna use basic text fields so I can use them in the search criteria. If it is possible, let me know. It's something I would be interested in contributing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants