21309 Posts in 5738 Topics by 2603 members
| Go to End | ||
| Author | Topic: | 5550 Views |
-
Re: Zip Code Store Locator or Google Map Store Locator

3 November 2009 at 5:01pm
That should totally work. Nothing complicated going on. Are you using $allowed_actions by any chance? Can you attach your whole php file?
-
Re: Zip Code Store Locator or Google Map Store Locator

3 November 2009 at 10:32pm
Tried to find documentation that explained $allowed_actions but didn't see any.
-
Re: Zip Code Store Locator or Google Map Store Locator

5 November 2009 at 6:23pm
Oh maaan socks you have all kinds of problems.
1. Your class names don't match your file names, this won't be an issue in 2.4 but it is in 2.3 and below
2. You copied my psudo code which doesn't actually work. The DataObject::get call should throw all kinds of errors
3. You are calling the controller action in your template as a controlYou are missing a whole lot of Silverstripe 101 in the attached code.
Brush up on tutorial 2 for the controller
http://doc.silverstripe.org/doku.php?id=tutorial:2-extending-a-basic-siteAnd for the template rendering hit up tutorial 4
http://doc.silverstripe.org/doku.php?id=tutorial:4-site-search#showing_the_results -
Re: Zip Code Store Locator or Google Map Store Locator

5 November 2009 at 8:06pm Last edited: 5 November 2009 8:07pm
How'd I go from so close to not knowing the basics. I had this working fine when I actually had a page type GoogleMapXml.php and a page in the CMS, but trying to by-pass the CMS and spit out the DataObjects directly to a template is something I haven't done before. Since I still don't see documentation that explains this well enough I'm not sure what to do besides ask for help.
1. Your class names don't match your file names, this won't be an issue in 2.4 but it is in 2.3 and below
If you're talking about Page5.php doesn't match my Page class..that's this forum renaming my file.
I'll just start another thread and see if someone else can help.
thank you.
-
Re: Zip Code Store Locator or Google Map Store Locator

5 November 2009 at 8:09pm
I'll just start another thread and see if someone else can help.
Whats wrong with this thread?
-
Re: Zip Code Store Locator or Google Map Store Locator

6 November 2009 at 9:30am
Aww c'mon socks, don't stomp off and pout. Building off the last post I wrote with code addressing point 3:
GoogleMapXml.ss
<?xml version="1.0" encoding="UTF-8"?>
<markers>
<% control Stores %>
<marker address="$Address" city="$City" state="$State" zip="$Zip" phone="$Phone" lat="$Lat" lng="$Lng" delivery="$Delivery" notation="$Notation"></marker>
<% end_control %>
</markers>This is all explained in detail with working code examples here, except you are returning a DataSet of StoreLocations instead of Search Results: http://doc.silverstripe.org/doku.php?id=tutorial:4-site-search#showing_the_results
-
Re: Zip Code Store Locator or Google Map Store Locator

6 November 2010 at 5:26am
Hello Guys,
Here is ready to use USA/Canada Store Locator solution.
http://www.php4script.com/store-locator-script/I hope it will helpfull someone
-
Re: Zip Code Store Locator or Google Map Store Locator

21 March 2011 at 6:38am
Oi socks did you finally realized the store locator?
This is exactly what i need to do at the moment.
Thks for your feedback.
| 5550 Views | ||
| Go to Top |



