Support Forums

postal code module question

This is a discussion on postal code module question within the Modules / Plugins / Modifications forums, part of the Developer Forums category; I am thinking about pulling the user's zip code in their account information into the initial value of the zip ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 07-28-2009, 01:12 AM   #1
Junior Member
 
Join Date: May 2009
Posts: 18
Rep Power: 10
wendel18 is on a distinguished road
Default postal code module question

I am thinking about pulling the user's zip code in their account information into the initial value of the zip code text field when creating a new listing.

I think this would need to be done in the hook.php within the us_zipcode folder.......anyone else try doing this, or have any thoughts?
wendel18 is offline   Reply With Quote
Old 07-28-2009, 01:48 AM   #2
Junior Member
 
Join Date: May 2009
Posts: 18
Rep Power: 10
wendel18 is on a distinguished road
Default

So this probably isn't the best way to do it...but would there be any major integrity issues with running a cron job against my db that more less does this::

UPDATE paclistings, pacusers
SET paclistings.zipcode = pacusers.zip
WHERE paclistings.owner = pacusers.id AND paclistings.zipcode = '';

every 5 minutes perhaps...?

I would then make the zipcode text box a hidden field when creating a new ad.
wendel18 is offline   Reply With Quote
Old 07-28-2009, 11:02 AM   #3
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by wendel18
So this probably isn't the best way to do it...but would there be any major integrity issues with running a cron job against my db that more less does this::

UPDATE paclistings, pacusers
SET paclistings.zipcode = pacusers.zip
WHERE paclistings.owner = pacusers.id AND paclistings.zipcode = '';

every 5 minutes perhaps...?

I would then make the zipcode text box a hidden field when creating a new ad.
This sounds good in theory, however one issue that you may not have considered and the exact reason why the module creates a separate field is that the seller's zip code may be different then the zip code of the item.

Examples of when it is typical that these would be different is categories or users that sell Real Estate, Boats, Vehicles, etc.

More specifically, Let's say you have a Realtor as a seller. Their office is located in 12345 zip code. Their listings, however may and will have different zip codes based on where the actual property is located. It would be a disservice to both your sellers and your end users to change the zip code in the listings to the sellers zip code, because then when an end user wants to search for a property in xxxxx zip code it will only find the listings in the sellers zip code and NOT the zip code that the end users wants the property to be in.

ALSO, You posted this as a "Postal Codes Module" question, but it seems as though this is actually a "US Zip Codes Module" question. These are two different products have differences in features offered.

I offer the Postal Codes Module which is for international use outside of the US

68 Classifieds offers the US Zip Code Module which is for use in the US.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out

Last edited by Mike-N-Tosh; 07-28-2009 at 11:04 AM.
Mike-N-Tosh is offline   Reply With Quote
Old 07-28-2009, 11:11 PM   #4
Junior Member
 
Join Date: May 2009
Posts: 18
Rep Power: 10
wendel18 is on a distinguished road
Default

I understand what you are saying Mike.

The site will be car dealers in PA. It is illegal in the state of PA for a car dealer to list a vehicle that is not on their registered lot...we just figured we'd save them a step, and take out the zip entry.

We are not dealing with real estate at all...

Good point though, will continue thinking.
wendel18 is offline   Reply With Quote
Old 07-29-2009, 12:20 AM   #5
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

To me the easiest option would be to just run another query during the place an ad step and auto fill the zip code with what they used when registering.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 07-29-2009, 07:45 AM   #6
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by wendel18
I understand what you are saying Mike.

The site will be car dealers in PA. It is illegal in the state of PA for a car dealer to list a vehicle that is not on their registered lot...we just figured we'd save them a step, and take out the zip entry.

We are not dealing with real estate at all...

Good point though, will continue thinking.
OK, wendel18. I was just ensuring that you understood how it worked so you could make an educated decision without having any negative results.

In your case that seems fine and I would recommend following Eric's advice.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 07-29-2009, 10:34 AM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,342
Rep Power: 84
seymourjames is a jewel in the rough
Default

I don't know if this helps but we do have an alternative address module as part of our system. With a bit of work you could strip it out if you did not want to use the templates and other modules themselves, although you could of course. This module works nicely in situations where the object for sale is not located in the same place as the advertiser. A good example is a boat for sale. The owner lives in town but the boat is located in a marina somewhere else.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 08-06-2009, 09:00 AM   #8
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 14
MrGForce is on a distinguished road
Default

This alternative address module. You mention stripping it out of the template set it comes with. Would I be able to use this with the purple template, and if so, how hard would it be to "strip it out"?

Also, would it work with v4.1.3 Developer?

Thanks Seymour
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 08-06-2009, 12:48 PM   #9
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,342
Rep Power: 84
seymourjames is a jewel in the rough
Default

It depends how good your programming skills are. In general it would be a relatively big spend to gain one module. I would not in reality suggest stripping it out as such but just use that module and leave the supplied template idle etc. The other modules may be useful as well however - it depends. There is nothing to stop you stripping code out although to be fair we could not support it. Its not an ideal thing to do.

Unfortunately this module is only supported on version 4.1.4 and above so for you it would be a non-starter anyway unless you upgraded.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 08-06-2009, 07:26 PM   #10
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by Eric Barnes
To me the easiest option would be to just run another query during the place an ad step and auto fill the zip code with what they used when registering.
Hmmm, I haven't checked to see what variables are available at that point for the template, but it would be worth checking, because if the seller's zip code variable is available to the template already then the simplest solution would be to put the variable in the post code field form {$sellers zip variable} ala smarty. Then it would automatically be filled in, but could still be changed IF the seller wished too.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postal code search damiun Mike-N-Tosh 13 01-25-2011 03:12 PM
Zip code module question skyblue Technical Support 2 11-17-2008 11:38 AM
US Zip Code Search module rvanwagoner Modules / Plugins / Modifications 1 09-16-2008 06:35 PM
US Zip Code Search module for 68classifieds v4 vissa Technical Support 2 03-12-2008 08:32 AM


All times are GMT -4. The time now is 08:48 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0