Advertisement:

Author Topic: [Solved] Want Google Maps to show seller location of public profile page  (Read 7288 times)

haryour

  • Newbie
  • *
  • Posts: 36
  • My fingers and keyboard are magno-reacting
I tried to put this code

Code: [Select]
<div class="widget-box">
        <div class="box location">
<h3><strong><?php _e('Location''bender') ; ?></strong></h3>
       <?php osc_run_hook('location'); ?>
        </div>
    </div>

on the user-public-profile.php but the maps is not showing.

Can someone tell me I miss there.
« Last Edit: March 02, 2014, 03:07:33 am by haryour »

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: Want Google Maps to show seller location of public profile page
« Reply #1 on: February 28, 2014, 07:33:53 pm »
Hi,
You refers google maps plugin or generic code? I think you need expose your code better, because maybe exist some confusion in the middle. So, somebody see and can help you.

Regards

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: Want Google Maps to show seller location of public profile page
« Reply #2 on: February 28, 2014, 07:39:42 pm »
I tried to put this code

Code: [Select]
<div class="widget-box">
        <div class="box location">
<h3><strong><?php _e('Location''bender') ; ?></strong></h3>
       <?php osc_run_hook('location'); ?>
        </div>
    </div>

on the user-public-profile.php but the maps is not showing.

Can someone tell me I miss there.

Didn't you rename your theme from bender to something else?
If so you must change this code theme name to your theme name.

Also, I am not sure I understand your question. Please be as specific as possible, even if your post gets long.

Tom

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: Want Google Maps to show seller location of public profile page
« Reply #3 on: February 28, 2014, 09:52:48 pm »
The code that causes the Google map is simply:
Code: [Select]
           <?php osc_run_hook('location'); ?>
This is the only code I know of to cause the map.

Tom

haryour

  • Newbie
  • *
  • Posts: 36
  • My fingers and keyboard are magno-reacting
Re: Want Google Maps to show seller location of public profile page
« Reply #4 on: February 28, 2014, 10:44:44 pm »
The code that causes the Google map is simply:
Code: [Select]
           <?php osc_run_hook('location'); ?>
This is the only code I know of to cause the map.

Tom

@Tom
Yeah! I know it is
Code: [Select]
           <?php osc_run_hook('location'); ?>
that display the map.

What I observed in the google map plugin (both index.php and map.php) is that only the item location is used, it does not include the seller location.

My problem is that I dont know how to manipulate those files maybe by adding more hooks to the plugin.

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: Want Google Maps to show seller location of public profile page
« Reply #5 on: February 28, 2014, 10:49:15 pm »
O, I see. Well I sure missed the boat.
Sorry, I have no suggestions but sure some one will.

Tom

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: Want Google Maps to show seller location of public profile page
« Reply #6 on: February 28, 2014, 11:38:42 pm »
Hi,
I'm not the ideal person to help you, and possibly what I say can not result in anything. But you can try, do not be afraid of the code, if you lose it or have questions, you quickly restores backed up, right?

in map.php, replace the variable "$item" for perhaps "$user".

In index.php, replace the "$aItem" variable with "$user".

Still in index.php, replace the variable "$itemId" for "$userId".

the variable "$catId" you should not need it in the function, because it is the id of the category.

You can try, but as I said earlier, I have no certainty of anything and did not even try to do this test.

Sorry if i'm wrong, i never tryed this before  :-X

Use \oc-includes\osclass\helpers for you see some variables that may exist... i dont know.

Regards

haryour

  • Newbie
  • *
  • Posts: 36
  • My fingers and keyboard are magno-reacting
Re: Want Google Maps to show seller location of public profile page
« Reply #7 on: March 02, 2014, 03:05:08 am »
Hi,
I'm not the ideal person to help you, and possibly what I say can not result in anything. But you can try, do not be afraid of the code, if you lose it or have questions, you quickly restores backed up, right?

in map.php, replace the variable "$item" for perhaps "$user".

In index.php, replace the "$aItem" variable with "$user".

Still in index.php, replace the variable "$itemId" for "$userId".

the variable "$catId" you should not need it in the function, because it is the id of the category.

You can try, but as I said earlier, I have no certainty of anything and did not even try to do this test.

Sorry if i'm wrong, i never tryed this before  :-X

Use \oc-includes\osclass\helpers for you see some variables that may exist... i dont know.

Regards

@fog

Thanks man.

I got it all figured out.

Like you've said, I delved into the index.php and map.php and realised that the whole thing is set for $item meaning getting item location. I copied the codes and manipulate them to $user. Also, I added more hooks to index.php and the hook is called on the user-public-sidebar.php.

It works like charm.

fog

  • Hero Member
  • *****
  • Posts: 1062
great  :), I'm glad you've accomplished. By the way, you kept google maps to work in item.php (in the ad page)? Because as you said, and well, you can use multiple hooks, as can duplicate the functions and maps, and call each function for your purpose on the two pages to display the desired, (page of ad for insert the item location, and profile page for location the user). And you have a plugin for two purposes.

Regards

haryour

  • Newbie
  • *
  • Posts: 36
  • My fingers and keyboard are magno-reacting
great  :), I'm glad you've accomplished. By the way, you kept google maps to work in item.php (in the ad page)? Because as you said, and well, you can use multiple hooks, as can duplicate the functions and maps, and call each function for your purpose on the two pages to display the desired, (page of ad for insert the item location, and profile page for location the user). And you have a plugin for two purposes.

Regards

@fog
Yeah! my own version of Google Maps plugin by Rajasekar & trains58554 can perform two purposes i.e. item location and seller location.

Anyway, thanks to Fog & Tom for spurring me into doing this. You guys are charms.

fog

  • Hero Member
  • *****
  • Posts: 1062
Hi Haryour, you are welcome!  :)
Regards

haryour

  • Newbie
  • *
  • Posts: 36
  • My fingers and keyboard are magno-reacting
Sometimes item location could be different from seller's location, so I find seller's location on the map necessary.

Just in case you fancy showing seller location on the map just like item location on the item page, I have attached my edited version of Google maps by Rajasekar & trains58554 for interested users.

Credit to Fog & Tomshaft for spurring into this.

See sample also:
« Last Edit: March 03, 2014, 08:06:18 pm by haryour »

fog

  • Hero Member
  • *****
  • Posts: 1062
Hi haryour,

Your design sounds good, i like the imagens i see.

Different locations is normal happens, for much full address inserted,  API google maps is not perfect, but is free and is an strong feature for programmers and for any website.
By the way, the aditional credits is all yours, i just send you an tip.
Thanks for sharing
Regards  :)

haryour

  • Newbie
  • *
  • Posts: 36
  • My fingers and keyboard are magno-reacting
@Fog

You are my man! You don't know how much a little attention to quack programmer like is hugely appreciation ESPECIALLY at no cost.
 ;) ;) ;)
Thanks.

kweku

  • Sr. Member
  • ****
  • Posts: 291
  • my Internet + MAC = direction. speak less.
when i click on location map of the item, it shows the whole world.   I want it to show my country location or item location. help