Building Entire Location with only the shortcode

Home Forums Store Locator Plus Building Entire Location with only the shortcode

This topic contains 1 reply, has 2 voices, and was last updated by  Lance Cleveland 2 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24080

    Bryan
    Participant

    Hello Lance,

    I have been working with your plugin for a while now and I had a question come up. Is it possible to create a location without going through the interface using only Javascript and/or PHP ? If so, can I get a sample of the code necessary to build it?

    #24497

    Lance Cleveland
    Keymaster

    Not sure what you mean by “create a location”.  Do you mean to insert a location into the database?   You can certainly do that with PHP using the base plugin location class or the admin UI class.

    In your code you will want to make sure you are loading up and activating the base SLPlus class.  When you do there will be a global variable $slplus_plugin.

     

    You can then do something like this:

    $location['sl_store'] = 'My Store';
    $location['sl_zip'] = '29464';
    
    $geocode_on_add = true;
    
    $result_of_add = $slplug_plugin->AdminUI->ManageLocations->location_AddToDatabase( $location , $geocode_on_add );

     

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.