diff --git a/CHANGELOG.md b/CHANGELOG.md index 646bbba..6d9169b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.0.4 + +- Microdata added to template (@cdigruttola) +- Phone and price level added to place (@cdigruttola) +- Author URL added to review (@cdigruttola) + ## 1.0.3 - Custom widget template diff --git a/README.md b/README.md index a0236b2..25909fd 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,13 @@ It is only possible to retrieve the last 5 reviews. Import often to accumulate t In any template, add the following Widget: ```smarty -{widget name='pixel_googlemybusiness' display='name,rating,opening-hours,reviews'} +{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 diff --git a/pixel_googlemybusiness.php b/pixel_googlemybusiness.php index ca19c64..03405bf 100644 --- a/pixel_googlemybusiness.php +++ b/pixel_googlemybusiness.php @@ -22,7 +22,7 @@ class Pixel_googlemybusiness extends Module implements WidgetInterface public function __construct() { $this->name = 'pixel_googlemybusiness'; - $this->version = '1.0.3'; + $this->version = '1.0.4'; $this->author = 'Pixel Open'; $this->tab = 'front_office_features'; $this->need_instance = 0; @@ -102,7 +102,7 @@ public function getWidgetVariables($hookName, array $configuration): array explode(',', $configuration['place_ids'] ?? '') ); $display = array_filter( - explode(',', $configuration['display'] ?? 'name,rating,opening-hours,reviews') + explode(',', $configuration['display'] ?? 'name,phone,rating,opening-hours,reviews') ); $reviewNumber = $configuration['review_number'] ?? 5; $reviewMinRating = $configuration['review_min_rating'] ?? 0; @@ -282,10 +282,12 @@ protected function createTables(): bool `place_id` VARCHAR(255) NOT NULL, `language` VARCHAR(2) NULL, `name` VARCHAR(255) NOT NULL, + `phone` VARCHAR(255) DEFAULT NULL, `opening_hours_periods` TEXT DEFAULT NULL, `opening_hours_weekday_text` TEXT DEFAULT NULL, `rating` NUMERIC(4, 2) DEFAULT NULL, `user_ratings_total` INT DEFAULT NULL, + `price_level` INT DEFAULT NULL, PRIMARY KEY(`id`), UNIQUE KEY(`place_id`, `language`) ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8; @@ -294,6 +296,7 @@ protected function createTables(): bool `id` INT(11) AUTO_INCREMENT NOT NULL, `place_id` VARCHAR(255) NOT NULL, `author_name` VARCHAR(255) DEFAULT NULL, + `author_url` VARCHAR(255) DEFAULT NULL, `language` VARCHAR(2) NULL, `original_language` VARCHAR(2) DEFAULT NULL, `profile_photo_url` VARCHAR(255) DEFAULT NULL, diff --git a/pixel_googlemybusiness.tpl b/pixel_googlemybusiness.tpl index daaea23..18dfc35 100644 --- a/pixel_googlemybusiness.tpl +++ b/pixel_googlemybusiness.tpl @@ -1,12 +1,17 @@