VMVendor, Geolocation, Geommunity -- Integration Issue

More
5 years 11 months ago #41699 by andkit01
Hi,

I am using VMVendor and recently installed:
- Geommunity3 Lite
- Product Geolocator plugin for Virtuemart
- Geommunity Plugin: VIRTUEMART

I followed the installation instructions on Nordmograph documentation, but I'm getting the issues below:

- On VMVendor Add-Product page, there is a field "Product location" with a map that can be set to an address. Google map search and interactive map works fine, however the pin icon and shaded radial circular area are missing after the address is set.

- On VM backend, I added a new custom field, "Coordinates", plug-ins vm2geolocator. It is working fine within VirtueMart, I can add this custom field on VM backend, the Google map search and interactive map works fine, the pin icon and shaded radial circular area is also appearing fine on the backend, and on the frontend Product Details (Description). I am also able to do a product name search on the Geommunity map module, which finds the product, and directed to the correct location on the map. However, the pin icon and shaded radial circular area is missing on the Geommunity map module.

- If I add a new product through VMVendor frontend using the Add-Product page, including completing the "Product location" field, the map location does not appear on the Product Details (Description). Also, I cannot find the product on the Geommunity map module. It looks like the "Product location" field on VMVendor is not linked with the VM custom field "Coordinates".

Could you please help. I think in summary there are two key issues:
1. The missing pin icon and shaded radial circular area on VMVendor Add-Product page, and on Geommunity map module
2. The VMVendor "Product location" custom field does not seem to be linked with VM "Coordinates" custom field

Thanks a lot in advance.

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago - 5 years 11 months ago #41700 by andkit01
Hi,
I looked into the /components/com_vmvendor/views/addproduct/tmpl/default.php script, on line 1005:
$q = "SELECT `custom_params` FROM `#__virtuemart_customs`
WHERE `custom_element`='vm2geolocator' AND `published`='1' ";
$db->setQuery($q);
$vm2geo_params= $db->loadResult();
function get_between($input, $start, $end)
{
$substr = substr($input, strlen($start)+strpos($input, $start), (strlen($input) - strpos($input, $end))*(-1));
return $substr;
}
$fe_map_width = '100%';
$be_lat = get_between($vm2geo_params, 'default_lat="', '"|');
if(!$be_lat) $be_lat = '0';
$be_lng = get_between($vm2geo_params, 'default_lng="', '"|');
if(!$be_lng) $be_lng = '0';
$be_zoom = get_between($vm2geo_params, 'default_zoom="', '"|');
if(!$be_zoom) $be_zoom = '1';

On _virtuemart_customs database table, I checked that I do have an entry that satisfy `custom_element`='vm2geolocator' AND `published`='1', here the 'custom_params' value is:
latitude=""|longitude=""|zoom=""|maptype=""|radius=""|mode="1"|fe_map_width="600px"|fe_map_height="400px"|default_lat="46.8077151"|default_lng="7.1032485"|default_zoom="10"|default_maptype="ROADMAP"|default_radius="125"|stylez=""|scrollwheel="0"|showstreetview="0"|msize="normal"|mcolor="orange"|js_key="AIza...1bU"|static_key=""|

However, I believe the variable $vm2geo_params has the value: latitude=

This gives $be_lat = 0, $be_lng = 0, $be_zoom = 1, which are not the correct default values, which should be default_lat="46.8077151"|default_lng="7.1032485"|default_zoom="10"

(see attached screenshot from VMVendor Add-Product page)

Any insights on what may be causing the issue?
Attachments:
Last edit: 5 years 11 months ago by andkit01.

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago - 5 years 11 months ago #41701 by nordmograph
Hello,

1. shaded radial circular area is not supported in VMVendor , but the pin icon should be displayed. Can you provide a page URL where a location is set for a product but the pin is missing? The browser console would provide clue on why the file is not displayed.

2. That page is only for new product additions so default coordinates are empty.
The form controller is responsible for storing the set coordinates in the database. I'll try to reproduce your issue and get back to you with my findings. In the mean time, you could share your vm2geolocator custom field settings.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.
Last edit: 5 years 11 months ago by nordmograph.

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago - 5 years 11 months ago #41703 by andkit01
Hi,
Thank you for looking into this. Please find the answers below:

1. Sure. See the URLs below:

(product2 -- Product added through VM Backend, with custom field vm2geolocator added and location set)
- andkit01.com/en/ -- scroll down to the "geommunity3 lite - map", do a search for "product2 (added via vm backend)". This should direct to the correct location, but no pin marker is displayed
- andkit01.com/en/category1/product2-detail -- this is the product details page for "product2", you can see that here the map, pin marker, and shaded circular area are all shown correctly in the Product Description

(product1 -- Product added through VMVendor Frontend, with location set on the Add Product page)
- andkit01.com/en/category1/product1-detail -- here, no map is shown on the Product Description. Also, "product1" cannot be found on the Geommunity3 Lite Map module marker search. It seems that the VMVendor "Product Location" is not linked to the VirtueMart custom field "Coordinates"

Note: The product details pages can also be accessed by clicking the eye icon with the mouse hovering on top of the product boxes (product1 or product2) in andkit01.com/en/category1 page

2. From the code snippet on the above message (see below), it seems that the code is trying to extract the default latitude/longitude coordinate and default zoom, which should work well. However, the problem seems to be on the $vm2geo_params variable, where instead of containing the full set of variables, it literally has the value "latitude=" (seems truncated or has an error).

$fe_map_width = '100%';
$be_lat = get_between($vm2geo_params, 'default_lat="', '"|');
if(!$be_lat) $be_lat = '0';
$be_lng = get_between($vm2geo_params, 'default_lng="', '"|');
if(!$be_lng) $be_lng = '0';
$be_zoom = get_between($vm2geo_params, 'default_zoom="', '"|');
if(!$be_zoom) $be_zoom = '1';

If you choose the "Add Product" option on andkit01.com/en/vmv-test/vmv-profile (login: user1, pswd: user1), you will see that the default map is not set correctly. From the code, if $vm2geo_params contains the complete value that it's supposed to contain, the default latitude/longitude and zoom should be used, the default values are already set on the VM Custom Field backend.
Last edit: 5 years 11 months ago by andkit01.

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago #41705 by nordmograph
ok
The map is looking for
andkit01.com/en/plugins/geommunity/virtuemart/img/marker53.png
53 stands for the category. It seems you enabled specific marker per category in the plugin. Wich is fine but then you must design your own markers and name these as required and upload these to the server (53 is the category id).

I could add a product , but could not test the result as Virtuemart pages seem to be broken.
Let me know if you can solve the pin isse first.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago - 5 years 11 months ago #41710 by andkit01
awesome, thank you very much! I added marker53.png, the geommunity3 lite map module is now working great. See attached screenshots. I also tried adding two products that have nearby location, to check the clustering, and it works good. I have a question, is it possible to change the cluster image (the blue circular icon/image with the number "2" label on the attached)?

Also, another question, one of the "Virtuemart products for Geommunity maps" options is to show "Product Hits", which it says requires VM2hits plugin. How can I get this plugin?

Yes, I'm not exactly sure yet why the virtuemart pages break. It is possible that it is related to the missing link between vmvendor "product location" and vm custom field "coordinates" (vm2geolocator plugin). The way I "fix" the broken virtuemart is by deleting all of the products, and start adding new products from the backend. Sometimes when you first add it through vmvendor it works fine initially. Can you please try again and hopefully this time Virtuemart pages won't be broken and you can compare the Product Details page (Description section), that the products added from the backend with vm custom field "coordinates" show the map + marker + shaded circle, whereas the product added from vmvendor does not have this.

Thanks a lot!
Attachments:
Last edit: 5 years 11 months ago by andkit01.

Please Log in or Create an account to join the conversation.

Time to create page: 0.337 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.