Skip to content

Commit

Permalink
Merge pull request #1 from magmodules/1.1.2
Browse files Browse the repository at this point in the history
1.1.2
  • Loading branch information
Magmodules authored Dec 2, 2017
2 parents e3c2d26 + b137f0d commit 1dc5ec2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
20 changes: 12 additions & 8 deletions app/code/local/Magmodules/Ekomisnippets/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ function getSnapshopRequest()
$ekomiVersion = 'cust-1.0.0';

if ($ekomiApiId && $ekomiApiKey) {
$api = 'http://api.ekomi.de/v2/wsdl';
$client = new SoapClient($api, array('exceptions' => 0));
$sendSnapshotRequest = $client->getSnapshot($ekomiApiId . '|' . $ekomiApiKey, $ekomiVersion);
$ret = unserialize(utf8_decode($sendSnapshotRequest));
if ($ret['done']) {
$snippets = $ret['info'];
if ($snippets['fb_count'] > 0) {
return $snippets;
try {
$api = 'http://api.ekomi.de/v2/wsdl';
$client = new SoapClient($api, array('exceptions' => 0));
$sendSnapshotRequest = $client->getSnapshot($ekomiApiId . '|' . $ekomiApiKey, $ekomiVersion);
$ret = @unserialize(utf8_decode($sendSnapshotRequest));
if ($ret['done']) {
$snippets = $ret['info'];
if ($snippets['fb_count'] > 0) {
return $snippets;
}
}
} catch (SoapFault $e){
Mage::logException($e);
}
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/Magmodules/Ekomisnippets/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<config>
<modules>
<Magmodules_Ekomisnippets>
<version>1.1.1</version>
<version>1.1.2</version>
</Magmodules_Ekomisnippets>
</modules>
<global>
Expand Down
20 changes: 10 additions & 10 deletions app/code/local/Magmodules/Ekomisnippets/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@
<show_in_store>1</show_in_store>
<expanded>1</expanded>
<fields>
<version translate="label">
<label>Extension Version</label>
<frontend_type>text</frontend_type>
<frontend_model>ekomisnippets/adminhtml_system_config_form_field_version</frontend_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</version>
<enabled translate="label">
<label>Enabled</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<backend_model>ekomisnippets/system_config_flushcache</backend_model>
<sort_order>1</sort_order>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</enabled>
<version translate="label">
<label>Extension Version</label>
<frontend_type>text</frontend_type>
<frontend_model>ekomisnippets/adminhtml_system_config_form_field_version</frontend_model>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</version>
<heading_api translate="label">
<label>API CREDENTIALS</label>
<frontend_model>ekomisnippets/adminhtml_system_config_form_field_heading</frontend_model>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
?>
<?php if($_snippets = $this->getSnapshopRequest()) { ?>
<div class="ekomi-shop-snippets">
<?php echo $this->getEkomiStars($_snippets['fb_avg']); ?>
<div class="ekomi-schema" itemscope="itemscope" itemtype="http://schema.org/WebPage">
<div itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
<meta itemprop="bestRating" content="5">
<p><?php echo Mage::helper('ekomisnippets')->__('Rating') ?>
<?php if ($_snippets = $this->getSnapshopRequest()) { ?>
<div class="ekomi-shop-snippets">
<?php echo $this->getEkomiStars($_snippets['fb_avg']); ?>
<div class="ekomi-schema" itemscope="itemscope" itemtype="http://schema.org/WebPage">
<div itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
<meta itemprop="bestRating" content="5">
<p><?php echo Mage::helper('ekomisnippets')->__('Rating') ?>
<span itemprop="ratingValue"><?php echo $_snippets['fb_avg']; ?></span>
<?php echo Mage::helper('ekomisnippets')->__('based on') ?>
<span itemprop="reviewCount"><?php echo $_snippets['fb_count']; ?></span>
<?php echo $this->getEkomiLink(); ?>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>

0 comments on commit 1dc5ec2

Please sign in to comment.