Aucune image disponible

Google My Business

Retrieve and display the Google My Business place data.

Developed by Pixel Open

Get This Module Free on GitHub
PS 1.7 – 9.x License: MIT Status: Unknown Health: Excellent

Info updated 1 month ago

Sources
Stars: 7 Forks: 2 Last commit: Feb 2, 2024
Type
Module

Info checked: Mar 2, 2026

Pixel GoogleMyBusiness

Presentation

GoogleMyBusiness is a Prestashop module to import and display any Google place data on the frontend.

!Place display

Requirements

  • Prestashop >= 1.7.6.0
  • PHP >= 7.2.0

Installation

Download the pixel_googlemybusiness.zip file from the last release assets.

Admin

Go to the admin module catalog section and click Upload a module. Select the downloaded zip file.

Manually

Move the downloaded file in the Prestashop modules directory and unzip the archive. Go to the admin module catalog section and search for "Google My Business".

Configuration

From the module manager, find the module and click on configure.

| Field | Description | Example | Required | |:------------------|:---------------------------------------------|----------------------------------|----------| | Google API Key | The Google Places API key. | D5MyLvpGOTI2GYXpisyJQCKw9ED3wdk7 | Y | | Google Place IDs | Google place ids to import, one id per line. | ChIJLU7jZClu5kcR4PcOOO6p3I0 | Y |

Import

At the command prompt, go to the Prestashop root directory and execute the following command:

./bin/console google_my_business:import_place {language}
  • language: ISO 639-1 (en, de, fr...)

Reviews

It is only possible to retrieve the last 5 reviews. Import often to accumulate the reviews.

Display

In any template, add the following Widget:

{widget name='pixel_googlemybusiness' display='name,phone,rating,opening-hours,reviews'}

Display excepted options:

  • name: Place name (Eiffel tower)
  • phone: International phone number (+33 1 22 33 44 55)
  • rating: Average Rating (4/5)
  • opening-hours: Opening hours (Monday: 12:00 – 19:00, Tuesday: 10:00 – 19:00...)
  • review: the last reviews

For example, to display only reviews:

{widget name='pixel_googlemybusiness' display='reviews'}

Review filters:

  • review_number: the number of review to display
  • review_min_rating: only show reviews with rating greater or equal than this value
{widget name='pixel_googlemybusiness' display='reviews' review_number=5 review_min_rating=3}

Place filter:

Filter by place id with the <code>place_ids</code> widget param (comma separated):

{widget name='pixel_googlemybusiness' place_ids='ChIJLU7jZClu5kcR4PcOOO6p3I0' display='name,rating,opening-hours,reviews'}

Note: Only places imported in the current context language will be displayed

Custom template

You can create your own template to display places.

Create a new template file in the pixel_googlemybusiness directory for your theme:

themes/{themeName}/modules/pixel_googlemybusiness/custom.tpl

{foreach from=$places item=place}

{$place-&gt;getPlaceId()} {$place-&gt;getName()} {$place-&gt;getRating()} {$place-&gt;getUserRatingsTotal()} {foreach from=$place-&gt;getOpeningHoursWeekdayText()|json_decode:1 item=hour} {$hour} {/foreach} {foreach from=$place-&gt;getReviews() item=review} {$review-&gt;getAuthorName()} {$review-&gt;getTime()|date_format:&quot;%e %B %Y&quot;} {$review-&gt;getRating()} {if $review-&gt;getComment()} {$review-&gt;getComment()} {/if} {/foreach} {/foreach}

Add the template option in the widget with the template path:

{widget name='pixel_googlemybusiness' template='module:pixel_googlemybusiness/custom.tpl'}

Translations

In admin, go to the Translations page under the International menu.

  • Référence
    pixel_googlemybusiness

  • License
    MIT
  • PS Compatibility
    1.7.x
    8.x
    9.x
  • Status
    Unknown

Commentaires (0)

Aucun avis n'a été publié pour le moment.
Chargement...