diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..d7615ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +*.zip +.DS_Store diff --git a/README.md b/README.md new file mode 100755 index 0000000..9361188 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# KiyOh Connect for Magento® 1 + +The Magento® KiyOh connector for Magento® 1 integrates KiyOh into your Magento® 1 store. Manage and show your KiyOh reviews and fully automate review invitations all from your Magento® Back-end. + +## Development by Magmodules + +We are a Dutch Magento® Only Agency dedicated to the development of extensions for Magento® 1 and Magento® 2. All our extensions are coded by our own team and our support team is always there to help you out. + +[Visit Magmodules.eu](https://www.magmodules.eu/) + +## About KiyOh + +KiyOh is a specialist in customer ratings and reviews. Companies use KiyOh to ask customers for a rating and review and publish these on their webshop. This has advantages not only for consumers, but also for the company itself. Consumers can read the reviews of previous customers and know better what to expect of a company. Companies can learn from the customer feedback. + +KiyOh started in 2009 and is growing fast. Meanwhile, there are already thousands of online shops that use KiyOh to collect ratings and reviews. + +[Visit KiyOh.com](https://www.kiyoh.com/) + +## Links + +[Knowledgebase](https://www.magmodules.eu/help/webwinkelkeur) + +[Terms and Conditions](https://www.magmodules.eu/terms.html) + +[Contact Us](https://www.magmodules.eu/contact-us.html) diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog.php new file mode 100755 index 0000000..ce744a5 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog.php @@ -0,0 +1,46 @@ +_controller = 'adminhtml_kiyohlog'; + $this->_blockGroup = 'kiyoh'; + $this->_headerText = Mage::helper('kiyoh')->__('Kiyoh Logs'); + + parent::__construct(); + + $this->_removeButton('add'); + $this->_addButton( + 'module_controller', array( + 'label' => Mage::helper('kiyoh')->__('Cleanup Log'), + 'onclick' => "setLocation('{$this->getUrl('adminhtml/kiyohlog/clean')}')", + 'confirm' => Mage::helper('kiyoh')->__('Are you sure you want to cleanup logfiles?'), + ) + ); + + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog/Grid.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog/Grid.php new file mode 100755 index 0000000..99d7c05 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog/Grid.php @@ -0,0 +1,162 @@ +setId('kiyohlogGrid'); + $this->setDefaultSort('date'); + $this->setDefaultDir('DESC'); + $this->setSaveParametersInSession(true); + } + + /** + * @return mixed + */ + protected function _prepareCollection() + { + $collection = Mage::getModel('kiyoh/log')->getCollection(); + $this->setCollection($collection); + return parent::_prepareCollection(); + } + + /** + * @return mixed + */ + protected function _prepareColumns() + { + $this->addColumn( + 'company', array( + 'header' => Mage::helper('kiyoh')->__('Shop'), + 'index' => 'company', + 'width' => '120px', + ) + ); + + $this->addColumn( + 'type', array( + 'header' => Mage::helper('kiyoh')->__('Type'), + 'align' => 'left', + 'index' => 'type', + 'width' => '120', + 'type' => 'options', + 'options' => array( + 'reviews' => Mage::helper('kiyoh')->__('Reviews'), + 'invitation' => Mage::helper('kiyoh')->__('Invitation Call'), + ), + ) + ); + + if (Mage::app()->getRequest()->getParam('showapiurl')) { + $this->addColumn( + 'api_url', array( + 'header' => Mage::helper('kiyoh')->__('Api URL'), + 'align' => 'left', + 'index' => 'api_url', + 'filter' => false, + 'sortable' => false, + ) + ); + } + + $this->addColumn( + 'qty', array( + 'header' => Mage::helper('kiyoh')->__('Description'), + 'align' => 'left', + 'index' => 'qty', + 'renderer' => 'kiyoh/adminhtml_widget_grid_log', + 'filter' => false, + 'sortable' => false, + ) + ); + + $this->addColumn( + 'cron', array( + 'header' => Mage::helper('kiyoh')->__('Cron'), + 'align' => 'left', + 'index' => 'cron', + 'width' => '120', + 'type' => 'options', + 'options' => array( + '' => Mage::helper('kiyoh')->__('Manual'), + 'stats' => Mage::helper('kiyoh')->__('Stats Cron'), + 'reviews' => Mage::helper('kiyoh')->__('Reviews Cron'), + 'orderupdate' => Mage::helper('kiyoh')->__('Invitation'), + ), + ) + ); + + $this->addColumn( + 'time', array( + 'header' => Mage::helper('kiyoh')->__('Time'), + 'align' => 'left', + 'index' => 'time', + 'width' => '60', + 'renderer' => 'kiyoh/adminhtml_widget_grid_seconds', + ) + ); + + $this->addColumn( + 'date', array( + 'header' => Mage::helper('kiyoh')->__('Date'), + 'align' => 'left', + 'type' => 'datetime', + 'index' => 'date', + 'width' => '140', + ) + ); + + return parent::_prepareColumns(); + } + + /** + * @return $this + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('id'); + $this->getMassactionBlock()->setFormFieldName('logids'); + + $this->getMassactionBlock()->addItem( + 'hide', array( + 'label' => Mage::helper('kiyoh')->__('Delete'), + 'url' => $this->getUrl('*/*/massDelete'), + ) + ); + return $this; + } + + /** + * @param $row + * + * @return string + */ + public function getRowUrl($row) + { + return false; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews.php new file mode 100755 index 0000000..51ff065 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews.php @@ -0,0 +1,46 @@ +_controller = 'adminhtml_kiyohreviews'; + $this->_blockGroup = 'kiyoh'; + $this->_headerText = Mage::helper('kiyoh')->__('Kiyoh Reviews'); + + parent::__construct(); + + $this->_removeButton('add'); + $this->_addButton( + 'module_controller', array( + 'label' => Mage::helper('kiyoh')->__('Delete all reviews'), + 'onclick' => "setLocation('{$this->getUrl('adminhtml/kiyohreviews/truncate')}')", + 'confirm' => Mage::helper('kiyoh')->__('Are you sure you want to delete all reviews?'), + ) + ); + + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Grid.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Grid.php new file mode 100755 index 0000000..9886fb2 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Grid.php @@ -0,0 +1,196 @@ +setId('reviewsGrid'); + $this->setDefaultSort('date_created'); + $this->setDefaultDir('DESC'); + $this->setSaveParametersInSession(true); + } + + /** + * @return mixed + */ + protected function _prepareCollection() + { + $collection = Mage::getModel('kiyoh/reviews')->getCollection(); + $this->setCollection($collection); + return parent::_prepareCollection(); + } + + /** + * @return mixed + */ + protected function _prepareColumns() + { + + $this->addColumn( + 'company', array( + 'header' => Mage::helper('kiyoh')->__('Shop'), + 'index' => 'company', + 'width' => '120px', + ) + ); + + $this->addColumn( + 'customer_name', array( + 'header' => Mage::helper('kiyoh')->__('User'), + 'align' => 'left', + 'index' => 'customer_name', + ) + ); + + $this->addColumn( + 'customer_place', array( + 'header' => Mage::helper('kiyoh')->__('City'), + 'align' => 'left', + 'index' => 'customer_place', + ) + ); + + $this->addColumn( + 'score', array( + 'header' => Mage::helper('kiyoh')->__('Score'), + 'align' => 'left', + 'index' => 'score', + 'renderer' => 'kiyoh/adminhtml_widget_grid_stars', + 'width' => '110', + 'filter' => false, + 'sortable' => true, + ) + ); + + $this->addColumn( + 'customer_email', array( + 'header' => Mage::helper('kiyoh')->__('Email'), + 'align' => 'left', + 'index' => 'customer_email', + ) + ); + + $this->addColumn( + 'recommendation', array( + 'header' => Mage::helper('kiyoh')->__('Recommendation'), + 'align' => 'left', + 'index' => 'recommendation', + 'width' => '80px', + 'type' => 'options', + 'options' => array( + 0 => Mage::helper('kiyoh')->__('No'), + 1 => Mage::helper('kiyoh')->__('Yes'), + ), + ) + ); + + $this->addColumn( + 'date_created', array( + 'header' => Mage::helper('kiyoh')->__('Date'), + 'align' => 'left', + 'type' => 'date', + 'index' => 'date_created', + 'width' => '140', + ) + ); + + $this->addColumn( + 'sidebar', array( + 'header' => Mage::helper('kiyoh')->__('Sidebar'), + 'align' => 'left', + 'width' => '80px', + 'index' => 'sidebar', + 'type' => 'options', + 'options' => array( + 0 => Mage::helper('kiyoh')->__('No'), + 1 => Mage::helper('kiyoh')->__('Yes'), + ), + ) + ); + + $this->addColumn( + 'status', array( + 'header' => Mage::helper('kiyoh')->__('Active'), + 'align' => 'left', + 'width' => '80px', + 'index' => 'status', + 'type' => 'options', + 'options' => array( + 0 => Mage::helper('kiyoh')->__('No'), + 1 => Mage::helper('kiyoh')->__('Yes'), + ), + ) + ); + + return parent::_prepareColumns(); + } + + /** + * @return $this + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('review_id'); + $this->getMassactionBlock()->setFormFieldName('reviewids'); + + $this->getMassactionBlock()->addItem( + 'hide', array( + 'label' => Mage::helper('kiyoh')->__('Set to invisible'), + 'url' => $this->getUrl('*/*/massDisable'), + ) + ); + $this->getMassactionBlock()->addItem( + 'visible', array( + 'label' => Mage::helper('kiyoh')->__('Set to visible'), + 'url' => $this->getUrl('*/*/massEnable'), + ) + ); + $this->getMassactionBlock()->addItem( + 'addsidebar', array( + 'label' => Mage::helper('kiyoh')->__('Add to Sidebar'), + 'url' => $this->getUrl('*/*/massEnableSidebar'), + ) + ); + $this->getMassactionBlock()->addItem( + 'removesidebar', array( + 'label' => Mage::helper('kiyoh')->__('Remove from Sidebar'), + 'url' => $this->getUrl('*/*/massDisableSidebar'), + ) + ); + return $this; + } + + /** + * @param $row + * + * @return bool + */ + public function getRowUrl($row) + { + return false; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Renderer/Experience.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Renderer/Experience.php new file mode 100755 index 0000000..3ab4e28 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Renderer/Experience.php @@ -0,0 +1,44 @@ +getData($this->getColumn()->getIndex()); + $charLimit = '100'; + if (strlen($value) > $charLimit) { + $extra = '... ' . $this->__('(more)'); + $contentSmall = Mage::helper('core/string')->truncate($value, $charLimit, $extra); + $content = $contentSmall . '' . $value . ''; + return $content; + } else { + return $value; + } + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Process.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Process.php new file mode 100755 index 0000000..377274e --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Process.php @@ -0,0 +1,43 @@ +setElement($element); + $url = $this->getUrl('*/kiyohreviews/process'); + $html = $this->getLayout()->createBlock('adminhtml/widget_button') + ->setType('button') + ->setClass('scalable') + ->setLabel(Mage::helper('kiyoh')->__('Process Manually')) + ->setOnClick("setLocation('$url')") + ->toHtml(); + + return $html; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Test.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Test.php new file mode 100755 index 0000000..fa88849 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Test.php @@ -0,0 +1,42 @@ +setElement($element); + $url = $this->getUrl('*/kiyohreviews/testapi'); + $html = $this->getLayout()->createBlock('adminhtml/widget_button') + ->setType('button') + ->setClass('scalable') + ->setLabel(Mage::helper('kiyoh')->__('Test API')) + ->setOnClick("setLocation('$url')") + ->toHtml(); + return $html; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Field/Version.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Field/Version.php new file mode 100755 index 0000000..e77f091 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Field/Version.php @@ -0,0 +1,34 @@ +getNode()->modules->Magmodules_Kiyoh->version; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Form/Heading.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Form/Heading.php new file mode 100755 index 0000000..e1620f5 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Form/Heading.php @@ -0,0 +1,38 @@ +

%s

', + $element->getHtmlId(), $element->getLabel() + ); + } + +} diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Log.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Log.php new file mode 100755 index 0000000..db64932 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Log.php @@ -0,0 +1,76 @@ +getType(); + $msg = ''; + + if ($type == 'reviews') { + $updates = ''; + if ($row->getReviewNew() > 0) { + $msg .= Mage::helper('kiyoh')->__('%s new review(s)', $row->getReviewNew()); + $updates++; + } + + if ($row->getReviewUpdate() > 0) { + if ($updates > 0) { + $msg .= ', '; + } + + $msg .= Mage::helper('kiyoh')->__('%s review(s) updated', $row->getReviewUpdate()); + $updates++; + } + + if ($updates > 0) { + $msg .= ' & '; + } + + $msg .= Mage::helper('kiyoh')->__('total score updated'); + } + + if ($type == 'invitation') { + if ($row->getOrderId()) { + $order = Mage::getModel('sales/order')->load($row->getOrderId()); + $incrementId = $order->getIncrementId(); + $orderUrl = Mage::helper('adminhtml')->getUrl( + "adminhtml/sales_order/view", + array('order_id' => $row->getOrderId()) + ); + $msg = Mage::helper('kiyoh')->__( + '%s - Repsonse: %s', + '#' . $incrementId . '', + $row->getResponse() + ); + } + } + + return ucfirst($msg); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Seconds.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Seconds.php new file mode 100755 index 0000000..be41318 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Seconds.php @@ -0,0 +1,39 @@ +getData($this->getColumn()->getIndex()); + if ($value > 0) { + $value = number_format($value, 3, '.', ''); + } + + return $value; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Stars.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Stars.php new file mode 100755 index 0000000..41a6959 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Stars.php @@ -0,0 +1,125 @@ +getData($this->getColumn()->getIndex()); + + if ($value == '0') { + $output = ''; + } else { + $o = 0; + + $shopId = $row->getData('shop_id'); + $reviewStats = Mage::getModel('kiyoh/stats')->load($shopId, 'shop_id'); + + $output = ''; + $output .= '(i)'; + $output .= '' . Mage::helper('kiyoh')->__('Overall') . ': '; + $output .= $row->getData('score') . '/10
'; + + if ($row->getData('score_q2') > 0) { + $output .= '' . $reviewStats->getScoreQ2Title() . ': '; + $output .= $row->getData('score_q2') . '/10
'; + $o++; + } + + if ($row->getData('score_q3') > 0) { + $output .= '' . $reviewStats->getScoreQ3Title() . ' '; + $output .= $row->getData('score_q3') . '/10
'; + $o++; + } + + if ($row->getData('score_q4' > 0)) { + $output .= '' . $reviewStats->getScoreQ4Title() . ' '; + $output .= $row->getData('score_q4') . '/10
'; + $o++; + } + + if ($row->getData('score_q5') > 0) { + $output .= '' . $reviewStats->getScoreQ5Title() . ' '; + $output .= $row->getData('score_q5') . '/10
'; + $o++; + } + + if ($row->getData('score_q6') > 0) { + $output .= '' . $reviewStats->getScoreQ6Title() . ' '; + $output .= $row->getData('score_q6') . '/10
'; + $o++; + } + + if ($row->getData('score_q7') > 0) { + $output .= '' . $reviewStats->getScoreQ7Title() . ' '; + $output .= $row->getData('score_q7') . '/10
'; + $o++; + } + + if ($row->getData('score_q8') > 0) { + $output .= '' . $reviewStats->getScoreQ8Title() . ' '; + $output .= $row->getData('score_q8') . '/10
'; + $o++; + } + + if ($row->getData('score_q9') > 0) { + $output .= '' . $reviewStats->getScoreQ9Title() . ' '; + $output .= $row->getData('score_q9') . '/10
'; + $o++; + } + + if ($row->getData('score_q10') > 0) { + $output .= '' . $reviewStats->getScoreQ10Title() . ' '; + $output .= $row->getData('score_q10') . '/10
'; + $o++; + } + + if ($o > 0) { + $output .= '
'; + } + + if ($row->getData('positive')) { + $output .= '' . Mage::helper('kiyoh')->__('Positive') . ': '; + $output .= $row->getData('positive') . '
'; + } + + if ($row->getData('negative')) { + $output .= '' . Mage::helper('kiyoh')->__('Negative') . ': '; + $output .= $row->getData('negative') . '
'; + } + + if ($row->getData('reaction')) { + $output .= '' . Mage::helper('kiyoh')->__('Reaction') . ': '; + $output .= $row->getData('reaction') . '
'; + } + + $output .= '
'; + } + + return $output; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Info/Info.php b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Info/Info.php new file mode 100755 index 0000000..2df6376 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Info/Info.php @@ -0,0 +1,73 @@ +getNode()->modules->Magmodules_Kiyoh->version; + $logoLink = '//www.magmodules.eu/logo/kiyoh/' . $moduleVersion . '/' . $magentoVersion . '/logo.png'; + + $html = '
+

About Magmodules.eu

+

We are a Magento only E-commerce Agency located in the Netherlands.
+
+ + + + + + + + + + + + + + + + + + + +
View more extensions from us: + + Magento Connect + +
Send us an E-mail: + info@magmodules.eu
Visit our website:www.magmodules.eu
  
Need help? + + Online manual + +
+

'; + return $html; + } + +} diff --git a/app/code/local/Magmodules/Kiyoh/Block/Custom.php b/app/code/local/Magmodules/Kiyoh/Block/Custom.php new file mode 100755 index 0000000..962cd03 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Custom.php @@ -0,0 +1,47 @@ +addData( + array( + 'cache_lifetime' => 7200, + 'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG, Magmodules_Kiyoh_Model_Reviews::CACHE_TAG), + 'cache_key' => Mage::app()->getStore()->getStoreId() . '-kiyoh-custom-block', + ) + ); + if (Mage::getStoreConfig('kiyoh/general/enabled')) { + $this->setTemplate('magmodules/kiyoh/widget/custom.phtml'); + } + } + + /** + * @return mixed + */ + public function getKiyohData() + { + return $this->helper('kiyoh')->getTotalScore(); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Reviews.php b/app/code/local/Magmodules/Kiyoh/Block/Reviews.php new file mode 100755 index 0000000..d732dc0 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Reviews.php @@ -0,0 +1,82 @@ +getCollection(); + $collection->setOrder('date_created', 'DESC'); + $collection->addFieldToFilter('status', 1); + $collection->addFieldToFilter('shop_id', Mage::getStoreConfig('kiyoh/general/api_id')); + $this->setReviews($collection); + + $stats = Mage::getModel('kiyoh/stats')->load(Mage::getStoreConfig('kiyoh/general/api_id'), 'shop_id'); + $this->setStats($stats); + } + + /** + * @return $this + */ + public function _prepareLayout() + { + parent::_prepareLayout(); + + $pager = $this->getLayout()->createBlock('page/html_pager', 'kiyoh.pager'); + + if (Mage::getStoreConfig('kiyoh/overview/enable_paging')) { + $fieldPerPage = Mage::getStoreConfig('kiyoh/overview/paging_settings'); + $fieldPerPage = explode(',', $fieldPerPage); + $fieldPerPage = array_combine($fieldPerPage, $fieldPerPage); + $pager->setAvailableLimit($fieldPerPage); + } else { + $pager->setAvailableLimit(array('all' => 'all')); + } + + $pager->setCollection($this->getReviews()); + $this->setChild('pager', $pager); + $this->getReviews()->load(); + + return $this; + } + + /** + * @return mixed + */ + public function getPagerHtml() + { + return $this->getChildHtml('pager'); + } + + /** + * @return mixed + */ + public function getFormUrl() + { + return $this->helper('kiyoh')->getFormUrl(); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Sidebar.php b/app/code/local/Magmodules/Kiyoh/Block/Sidebar.php new file mode 100755 index 0000000..e037679 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Sidebar.php @@ -0,0 +1,151 @@ +getCollection(); + $collection->setOrder('date_created', 'DESC'); + $collection->addFieldToFilter('status', 1); + $collection->addFieldToFilter('sidebar', 1); + $collection->addFieldToFilter('shop_id', array('eq' => array($shopId))); + $collection->setPageSize($qty); + $collection->load(); + return $collection; + } else { + return false; + } + } + + /** + * @param $sidebarreview + * @param string $sidebar + * + * @return string + */ + public function formatContent($sidebarreview, $sidebar = 'left') + { + $content = $sidebarreview->getPositive(); + if ($sidebar == 'left') { + $charLimit = Mage::getStoreConfig('kiyoh/sidebar/left_lenght'); + } + + if ($sidebar == 'right') { + $charLimit = Mage::getStoreConfig('kiyoh/sidebar/right_lenght'); + } + + $content = Mage::helper('core/string')->truncate($content, $charLimit, ' ...'); + if ($content) { + $content = '"' . $content . '"'; + } + + return $content; + } + + /** + * @param string $sidebar + * + * @return bool|string + */ + public function getReviewsUrl($sidebar = 'left') + { + $link = ''; + $url = ''; + $target = ''; + + if ($sidebar == 'left') { + $link = Mage::getStoreConfig('kiyoh/sidebar/left_link'); + } + + if ($sidebar == 'right') { + $link = Mage::getStoreConfig('kiyoh/sidebar/right_link'); + } + + if ($link == 'internal') { + $url = $this->getUrl('kiyoh'); + } + + if ($link == 'external') { + $url = Mage::getStoreConfig('kiyoh/general/url'); + $target = 'target="_blank"'; + } + + if ($url) { + return '' . $this->__('View all reviews') . ''; + } + + return false; + } + + /** + * @param string $sidebar + * + * @return bool + */ + public function getSnippetsEnabled($sidebar = 'left') + { + $enabled = ''; + if ($sidebar == 'left') { + $enabled = Mage::getStoreConfig('kiyoh/sidebar/left_snippets'); + } + + if ($sidebar == 'right') { + $enabled = Mage::getStoreConfig('kiyoh/sidebar/right_snippets'); + } + + if ($enabled) { + return true; + } + + return false; + } + + /** + * @return mixed + */ + public function getTotalScore() + { + return $this->helper('kiyoh')->getTotalScore(); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Block/Snippets.php b/app/code/local/Magmodules/Kiyoh/Block/Snippets.php new file mode 100755 index 0000000..ad35a33 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Block/Snippets.php @@ -0,0 +1,70 @@ +addData( + array( + 'cache_lifetime' => 7200, + 'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG, Magmodules_Kiyoh_Model_Reviews::CACHE_TAG), + 'cache_key' => Mage::app()->getStore()->getStoreId() . '-kiyoh-snippets-block', + ) + ); + + if (Mage::getStoreConfig('kiyoh/general/enabled')) { + $this->setTemplate('magmodules/kiyoh/widget/richsnippets.phtml'); + } + + } + + /** + * @return mixed + */ + public function getSnippets() + { + return $this->helper('kiyoh')->getTotalScore(); + } + + /** + * @param $rating + * + * @return mixed + */ + public function getHtmlStars($rating) + { + return $this->helper('kiyoh')->getHtmlStars($rating); + } + + /** + * @return mixed + */ + public function getExternalLink() + { + return $this->helper('kiyoh')->getExternalLink(); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Helper/Data.php b/app/code/local/Magmodules/Kiyoh/Helper/Data.php new file mode 100755 index 0000000..a8e2e8f --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Helper/Data.php @@ -0,0 +1,66 @@ +load($shopId, 'shop_id'); + if ($reviewStats->getScore() > 0) { + $reviewStats->setPercentage($reviewStats->getScore()); + $reviewStats->setStarsQty(number_format(($reviewStats->getScore() / 10), 1, ',', '')); + return $reviewStats; + } + + return false; + } + + /** + * @return bool|string + */ + public function getExternalLink() + { + if (Mage::getStoreConfig('kiyoh/general/url')) { + $url = 'KiyOh'; + return Mage::helper('kiyoh')->__('on') . ' ' . $url; + } + + return false; + } + + /** + * @param $rating + * + * @return string + */ + public function getHtmlStars($rating) + { + $html = '
'; + $html .= '
'; + $html .= '
'; + return $html; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Api.php b/app/code/local/Magmodules/Kiyoh/Model/Api.php new file mode 100755 index 0000000..b39daef --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Api.php @@ -0,0 +1,165 @@ +getFeed($storeId, $type)) { + $results = Mage::getModel('kiyoh/reviews')->processFeed($feed, $storeId, $type); + $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeId); + return $results; + } else { + return false; + } + } + + /** + * @param $storeId + * @param string $type + * + * @return bool|SimpleXMLElement + */ + public function getFeed($storeId, $type = '') + { + $apiId = Mage::getStoreConfig('kiyoh/general/api_id', $storeId); + $apiKey = Mage::getStoreConfig('kiyoh/general/api_key', $storeId); + $apiUrl = Mage::getStoreConfig('kiyoh/general/api_url', $storeId); + + if ($type == 'stats') { + $apiUrl = 'https://' . $apiUrl . '/xml/recent_company_reviews.xml?'; + $apiUrl .= 'connectorcode=' . $apiKey . '&company_id=' . $apiId . '&reviewcount=10'; + } + + if ($type == 'reviews') { + $apiUrl = 'https://' . $apiUrl . '/xml/recent_company_reviews.xml?'; + $apiUrl .= 'connectorcode=' . $apiKey . '&company_id=' . $apiId . '&reviewcount=10'; + } + + if ($type == 'history') { + $apiUrl = 'https://' . $apiUrl . '/xml/recent_company_reviews.xml?'; + $apiUrl .= 'connectorcode=' . $apiKey . '&company_id=' . $apiId . '&reviewcount=10000'; + } + + if ($apiId) { + $xml = simplexml_load_file($apiUrl); + if ($xml) { + if (empty($xml->error)) { + return $xml; + } else { + $msg = Mage::helper('kiyoh')->__('API: %s (Please check the online manual for suggestions)', (string)$xml->error); + Mage::getSingleton('adminhtml/session')->addError($msg); + return false; + } + } else { + $e = file_get_contents($apiUrl); + $msg = Mage::helper('kiyoh')->__('API: %s (Please check the online manual for suggestions)', $e); + Mage::getSingleton('adminhtml/session')->addError($msg); + return false; + } + } else { + return false; + } + + } + + /** + * @param $order + * + * @return bool + */ + public function sendInvitation($order) + { + $storeId = $order->getStoreId(); + $startTime = microtime(true); + $crontype = 'orderupdate'; + $apiKey = Mage::getStoreConfig('kiyoh/general/api_key', $storeId); + $apiUrl = Mage::getStoreConfig('kiyoh/general/api_url', $storeId); + $apiEmail = Mage::getStoreConfig('kiyoh/invitation/company_email', $storeId); + $delay = Mage::getStoreConfig('kiyoh/invitation/delay', $storeId); + $invStatus = Mage::getStoreConfig('kiyoh/invitation/status', $storeId); + $email = strtolower($order->getCustomerEmail()); + + if ($order->getStatus() == $invStatus) { + $http = new Varien_Http_Adapter_Curl(); + $http->setConfig(array('timeout' => 30, 'maxredirects' => 0)); + + $url = 'https://' . $apiUrl . '/set.php'; + $request = 'action=sendInvitation&connector=' . $apiKey . '&targetMail=' . $email; + $request .= '&delay=' . $delay . '&user=' . $apiEmail; + + $http->write(Zend_Http_Client::POST, $url, '1.1', array(), $request); + $result = $http->read(); + + if ($result) { + $lines = explode("\n", $result); + $responseHtml = $lines[0]; + $lines = array_reverse($lines); + $responseHtml .= ' - ' . $lines[0]; + } else { + $responseHtml = 'No response from ' . $url; + } + + Mage::getModel('kiyoh/log')->add( + 'invitation', + $order->getStoreId(), + '', + $responseHtml, + (microtime(true) - $startTime), + $crontype, + $url . '?' . $request, + $order->getId() + ); + + return true; + } + + return false; + } + + /** + * @return array + */ + public function getStoreIds() + { + $storeIds = array(); + $apiIds = array(); + $stores = Mage::getModel('core/store')->getCollection(); + foreach ($stores as $store) { + if ($store->getIsActive()) { + $apiId = Mage::getStoreConfig('kiyoh/general/api_id', $store->getId()); + if (!in_array($apiId, $apiIds)) { + $apiIds[] = $apiId; + $storeIds[] = $store->getId(); + } + } + } + + return $storeIds; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Log.php b/app/code/local/Magmodules/Kiyoh/Model/Log.php new file mode 100755 index 0000000..36a14c3 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Log.php @@ -0,0 +1,85 @@ +_init('kiyoh/log'); + } + + /** + * @param $type + * @param $storeId + * @param string $review + * @param string $inivation + * @param $time + * @param string $cType + * @param string $apiUrl + * @param string $orderId + * + * @return bool + */ + public function add($type, $storeId, $review = '', $inivation = '', $time, $cType = '', $apiUrl = '', $orderId = '') + { + $enabled = Mage::getStoreConfig('kiyoh/log/enabled'); + if ($enabled) { + $apiId = Mage::getStoreConfig('kiyoh/general/api_id', $storeId); + $company = Mage::getStoreConfig('kiyoh/general/company', $storeId); + $reviewUpdates = ''; + $reviewNew = ''; + if ($review) { + if (!empty($review['review_updates'])) { + $reviewUpdates = $review['review_updates']; + } else { + $reviewUpdates = 0; + } + + if (!empty($review['review_new'])) { + $reviewNew = $review['review_new']; + } else { + $reviewNew = 0; + } + } + + $model = Mage::getModel('kiyoh/log'); + $model->setType($type) + ->setShopId($apiId) + ->setCompany($company) + ->setReviewUpdate($reviewUpdates) + ->setReviewNew($reviewNew) + ->setResponse($inivation) + ->setOrderId($orderId) + ->setCron($cType) + ->setDate(now()) + ->setTime($time) + ->setApiUrl($apiUrl) + ->save(); + } + + return true; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log.php b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log.php new file mode 100755 index 0000000..75bbb7b --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log.php @@ -0,0 +1,32 @@ +_init('kiyoh/log', 'id'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log/Collection.php b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log/Collection.php new file mode 100755 index 0000000..1ee5521 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log/Collection.php @@ -0,0 +1,33 @@ +_init('kiyoh/log'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews.php b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews.php new file mode 100755 index 0000000..eb0048e --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews.php @@ -0,0 +1,32 @@ +_init('kiyoh/reviews', 'review_id'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews/Collection.php b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews/Collection.php new file mode 100755 index 0000000..bb760d2 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews/Collection.php @@ -0,0 +1,33 @@ +_init('kiyoh/reviews'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats.php b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats.php new file mode 100755 index 0000000..78647a5 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats.php @@ -0,0 +1,32 @@ +_init('kiyoh/stats', 'id'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats/Collection.php b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats/Collection.php new file mode 100755 index 0000000..e0c62e6 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats/Collection.php @@ -0,0 +1,33 @@ +_init('kiyoh/stats'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Observer.php b/app/code/local/Magmodules/Kiyoh/Model/Observer.php new file mode 100755 index 0000000..fc4df7a --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Observer.php @@ -0,0 +1,158 @@ +getStoreIds(); + foreach ($storeIds as $storeId) { + $enabled = Mage::getStoreConfig('kiyoh/general/enabled', $storeId); + $cronEnabled = Mage::getStoreConfig('kiyoh/reviews/cron', $storeId); + if ($enabled && $cronEnabled) { + $cType = 'stats'; + $startTime = microtime(true); + $feed = Mage::getModel('kiyoh/api')->getFeed($storeId, $cType); + $results = array(); + $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeId); + $results['company'] = $feed->company; + $time = (microtime(true) - $startTime); + Mage::getModel('kiyoh/log')->add('reviews', $storeId, $results, '', $time, $cType); + } + } + + Mage::getModel('kiyoh/stats')->processOverall(); + } + + /** + * + */ + public function processReviews() + { + $storeIds = Mage::getModel('kiyoh/api')->getStoreIds(); + foreach ($storeIds as $storeId) { + $enabled = Mage::getStoreConfig('kiyoh/general/enabled', $storeId); + $cronEnabled = Mage::getStoreConfig('kiyoh/reviews/cron', $storeId); + if ($enabled && $cronEnabled) { + $cType = 'reviews'; + $startTime = microtime(true); + $feed = Mage::getModel('kiyoh/api')->getFeed($storeId, $cType); + $results = Mage::getModel('kiyoh/reviews')->processFeed($feed, $storeId, $cType); + $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeId); + $time = (microtime(true) - $startTime); + Mage::getModel('kiyoh/log')->add('reviews', $storeId, $results, '', $time, $cType); + } + } + } + + /** + * + */ + public function processHistory() + { + $storeIds = Mage::getModel('kiyoh/api')->getStoreIds(); + foreach ($storeIds as $storeId) { + $enabled = Mage::getStoreConfig('kiyoh/general/enabled', $storeId); + $cronEnabled = Mage::getStoreConfig('kiyoh/reviews/cron', $storeId); + if ($enabled && $cronEnabled) { + $cType = 'history'; + $startTime = microtime(true); + $storeId = 0; + $feed = Mage::getModel('kiyoh/api')->getFeed($storeId, $cType); + $results = Mage::getModel('kiyoh/reviews')->processFeed($feed, $storeId, $cType); + $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeId); + $time = (microtime(true) - $startTime); + Mage::getModel('kiyoh/log')->add('reviews', $storeId, $results, '', $time, $cType); + } + } + } + + /** + * + */ + public function cleanLog() + { + $enabled = Mage::getStoreConfig('kiyoh/log/clean', 0); + $days = Mage::getStoreConfig('kiyoh/log/clean_days', 0); + if (($enabled) && ($days > 0)) { + $logModel = Mage::getModel('kiyoh/log'); + $logs = $logModel->getCollection() + ->addFieldToSelect('id') + ->addFieldToFilter('date', array('lteq' => date('Y-m-d', strtotime('-' . $days . ' days')))); + foreach ($logs as $log) { + $logModel->load($log->getId())->delete(); + } + } + } + + /** + * @param $observer + */ + public function processFeedbackInvitationcallAfterShipment($observer) + { + $shipment = $observer->getEvent()->getShipment(); + $order = $shipment->getOrder(); + $invEnabled = Mage::getStoreConfig('kiyoh/invitation/enabled', $order->getStoreId()); + $apiKey = Mage::getStoreConfig('kiyoh/general/api_key', $order->getStoreId()); + if ($invEnabled && $apiKey) { + $status = Mage::getStoreConfig('kiyoh/invitation/status', $order->getStoreId()); + if ($order->getStatus() == $status) { + $backlog = Mage::getStoreConfig('kiyoh/invitation/backlog', $order->getStoreId()); + if ($backlog > 0) { + $dateDiff = floor(time() - strtotime($order->getCreatedAt())) / (60 * 60 * 24); + if ($dateDiff < $backlog) { + Mage::getModel('kiyoh/api')->sendInvitation($order); + } + } else { + Mage::getModel('kiyoh/api')->sendInvitation($order); + } + } + } + } + + /** + * @param $observer + */ + public function processFeedbackInvitationcall($observer) + { + $order = $observer->getEvent()->getOrder(); + $invEnabled = Mage::getStoreConfig('kiyoh/invitation/enabled', $order->getStoreId()); + $apiKey = Mage::getStoreConfig('kiyoh/general/api_key', $order->getStoreId()); + if ($invEnabled && $apiKey) { + $status = Mage::getStoreConfig('kiyoh/invitation/status', $order->getStoreId()); + if ($order->getStatus() == $status) { + $backlog = Mage::getStoreConfig('kiyoh/invitation/backlog', $order->getStoreId()); + if ($backlog > 0) { + $dateDiff = floor(time() - strtotime($order->getCreatedAt())) / (60 * 60 * 24); + if ($dateDiff < $backlog) { + Mage::getModel('kiyoh/api')->sendInvitation($order); + } + } else { + Mage::getModel('kiyoh/api')->sendInvitation($order); + } + } + } + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Reviews.php b/app/code/local/Magmodules/Kiyoh/Model/Reviews.php new file mode 100755 index 0000000..fd20cf9 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Reviews.php @@ -0,0 +1,151 @@ +_init('kiyoh/reviews'); + } + + public function loadbyKiyohId($kiyohId) + { + $this->_getResource()->load($this, $kiyohId, 'kiyoh_id'); + return $this; + } + + /** + * @param $feed + * @param int $storeId + * @param $type + * @return array + */ + public function processFeed($feed, $storeId = 0, $type) + { + + $updates = 0; + $new = 0; + $apiId = Mage::getStoreConfig('kiyoh/general/api_id', $storeId); + $company = $feed->company->name; + + foreach ($feed->review_list->review as $review) { + $kiyohId = $review->id; + $customerName = $review->customer->name; + $customerEmail = $review->customer->email; + $customerPlace = $review->customer->place; + $date = $review->customer->date; + $totalScore = $review->total_score; + + $recommendation = $review->recommendation; + $positive = $review->positive; + $negative = $review->negative; + $purchase = $review->purchase; + $reaction = $review->reaction; + + if (($recommendation == 'Ja') || ($recommendation == 'Yes')) { + $recommendation = 1; + } else { + $recommendation = 0; + } + + $questions = array(); + foreach ($review->questions->question as $question) { + $questions[] = $question->score; + } + + $indatabase = $this->loadbyKiyohId($kiyohId); + + if ($indatabase->getId()) { + if ($type == 'history') { + $reviews = Mage::getModel('kiyoh/reviews'); + $reviews->setReviewId($indatabase->getReviewId()) + ->setShopId($apiId) + ->setCompany($company) + ->setKiyohId($kiyohId) + ->setCustomerName($customerName) + ->setCustomerEmail($customerEmail) + ->setCustomerPlace($customerPlace) + ->setScore($totalScore) + ->setScoreQ2($questions[0]) + ->setScoreQ3($questions[1]) + ->setScoreQ4($questions[2]) + ->setScoreQ5($questions[3]) + ->setScoreQ6($questions[4]) + ->setScoreQ7($questions[5]) + ->setScoreQ8($questions[6]) + ->setScoreQ9($questions[7]) + ->setScoreQ10($questions[8]) + ->setRecommendation($recommendation) + ->setPositive($positive) + ->setNegative($negative) + ->setPurchase($purchase) + ->setReaction($reaction) + ->setDateCreated($date) + ->save(); + $updates++; + } else { + break; + } + } else { + $reviews = Mage::getModel('kiyoh/reviews'); + $reviews->setShopId($apiId) + ->setCompany($company) + ->setKiyohId($kiyohId) + ->setCustomerName($customerName) + ->setCustomerEmail($customerEmail) + ->setCustomerPlace($customerPlace) + ->setScore($totalScore) + ->setScoreQ2($questions[0]) + ->setScoreQ3($questions[1]) + ->setScoreQ4($questions[2]) + ->setScoreQ5($questions[3]) + ->setScoreQ6($questions[4]) + ->setScoreQ7($questions[5]) + ->setScoreQ8($questions[6]) + ->setScoreQ9($questions[7]) + ->setScoreQ10($questions[8]) + ->setRecommendation($recommendation) + ->setPositive($positive) + ->setNegative($negative) + ->setPurchase($purchase) + ->setReaction($reaction) + ->setDateCreated($date) + ->save(); + $new++; + } + } + + $config = Mage::getModel('core/config'); + $config->saveConfig('kiyoh/reviews/lastrun', now(), 'default', 0); + $result = array(); + $result['review_updates'] = $updates; + $result['review_new'] = $new; + $result['company'] = $company; + return $result; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/Stats.php b/app/code/local/Magmodules/Kiyoh/Model/Stats.php new file mode 100755 index 0000000..a16e5b2 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/Stats.php @@ -0,0 +1,150 @@ +_init('kiyoh/stats'); + } + + public function processFeed($feed, $storeId = 0) + { + $shopId = Mage::getStoreConfig('kiyoh/general/api_id', $storeId); + $company = $feed->company->name; + + if ($storeId == 0) { + $config = Mage::getModel('core/config'); + $config->saveConfig('kiyoh/general/url', $feed->company->url, 'default', $storeId); + $config->saveConfig('kiyoh/general/company', $feed->company->name, 'default', $storeId); + } else { + $config = Mage::getModel('core/config'); + $config->saveConfig('kiyoh/general/url', $feed->company->url, 'stores', $storeId); + if (!Mage::getStoreConfig('kiyoh/general/url', 0)) { + $config->saveConfig('kiyoh/general/url', $feed->company->url, 'default', 0); + } + + if (!Mage::getStoreConfig('kiyoh/general/company', 0)) { + $config->saveConfig('kiyoh/general/company', $feed->company->name, 'default', 0); + } + } + + if ($feed->company->total_reviews > 0) { + $score = floatval($feed->company->total_score); + $score = ($score * 10); + $scoremax = '100'; + $votes = $feed->company->total_reviews; + + // Check for update or save + if ($indatabase = $this->loadbyShopId($shopId)) { + $id = $indatabase->getId(); + } else { + $id = ''; + } + + $questions = array(); + foreach ($feed->company->average_scores->questions->question as $question) { + $questions[] = array('title' => $question->title, 'score' => $question->score); + } + + // Save Review Stats + $model = Mage::getModel('kiyoh/stats'); + $model->setId($id) + ->setShopId($shopId) + ->setCompany($company) + ->setScore($score) + ->setScoreQ2($questions[0]['score']) + ->setScoreQ2Title($questions[0]['title']) + ->setScoreQ3($questions[1]['score']) + ->setScoreQ3Title($questions[1]['title']) + ->setScoreQ4($questions[2]['score']) + ->setScoreQ4Title($questions[2]['title']) + ->setScoreQ5($questions[3]['score']) + ->setScoreQ5Title($questions[3]['title']) + ->setScoreQ6($questions[4]['score']) + ->setScoreQ6Title($questions[4]['title']) + ->setScoreQ7($questions[5]['score']) + ->setScoreQ7Title($questions[5]['title']) + ->setScoreQ8($questions[6]['score']) + ->setScoreQ8Title($questions[6]['title']) + ->setScoreQ9($questions[7]['score']) + ->setScoreQ9Title($questions[7]['title']) + ->setScoreQ10($questions[8]['score']) + ->setScoreQ10Title($questions[8]['title']) + ->setScoremax($scoremax) + ->setVotes($votes) + ->save(); + return true; + } else { + return false; + } + } + + /** + * + */ + public function processOverall() + { + $stats = Mage::getModel('kiyoh/stats')->getCollection(); + $stats->addFieldToFilter('shop_id', array('neq' => '0')); + + $score = ''; + $scoremax = ''; + $votes = ''; + $i = 0; + + foreach ($stats as $stat) { + $score += $stat->getScore(); + $scoremax += $stat->getScoremax(); + $votes += $stat->getVotes(); + $i++; + } + + if($i > 0) { + $score = ($score / $i); + $scoremax = ($scoremax / $i); + } + $company = 'Overall'; + + if ($indatabase = $this->loadbyShopId(0)) { + $id = $indatabase->getId(); + } else { + $id = ''; + } + + Mage::getModel('kiyoh/stats') + ->setId($id) + ->setShopId(0) + ->setCompany($company) + ->setScore($score) + ->setScoremax($scoremax) + ->setVotes($votes) + ->save(); + } + + public function loadbyShopId($shopId) + { + $this->_getResource()->load($this, $shopId, 'shop_id'); + return $this; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/System/Config/Flushcache.php b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Flushcache.php new file mode 100755 index 0000000..da2bc78 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Flushcache.php @@ -0,0 +1,32 @@ +cleanCache(Magmodules_Kiyoh_Model_Reviews::CACHE_TAG); + } + +} diff --git a/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Cronfrequency.php b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Cronfrequency.php new file mode 100755 index 0000000..0f9271e --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Cronfrequency.php @@ -0,0 +1,39 @@ + Mage::helper('kiyoh')->__('Every 15 minutes'), + '0 * * * *' => Mage::helper('kiyoh')->__('Every Hour'), + '0 */2 * * *' => Mage::helper('kiyoh')->__('Every other Hour'), + '0 8,20 * * *' => Mage::helper('kiyoh')->__('Twice a Day'), + '0 2 * * *' => Mage::helper('kiyoh')->__('Once a Day'), + '0 2 0 * *' => Mage::helper('kiyoh')->__('Once a Week'), + ); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Kiyoh.php b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Kiyoh.php new file mode 100755 index 0000000..3b18b46 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Kiyoh.php @@ -0,0 +1,35 @@ + Mage::helper('kiyoh')->__('Kiyoh.nl'), + 'www.kiyoh.com' => Mage::helper('kiyoh')->__('Kihoy.com'), + ); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Orderstatus.php b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Orderstatus.php new file mode 100755 index 0000000..00e1e8e --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Orderstatus.php @@ -0,0 +1,43 @@ +getStatuses(); + $options = array(); + + $this->_options = array(array('value' => 0, 'label' => Mage::helper('kiyoh')->__('-- none'))); + + foreach ($statuses as $k => $v) { + $options[] = array('label' => $v, 'value' => $k); + } + + $this->_options = array_merge($this->_options, $options); + return $this->_options; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Position.php b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Position.php new file mode 100755 index 0000000..fffd21a --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Position.php @@ -0,0 +1,35 @@ + 'left', 'label' => Mage::helper('kiyoh')->__('Left')); + $position[] = array('value' => 'right', 'label' => Mage::helper('kiyoh')->__('Right')); + return $position; + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Sidebarlink.php b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Sidebarlink.php new file mode 100755 index 0000000..2ac4d98 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Sidebarlink.php @@ -0,0 +1,36 @@ + Mage::helper('kiyoh')->__('None'), + 'external' => Mage::helper('kiyoh')->__('External (Kiyoh.nl)'), + 'internal' => Mage::helper('kiyoh')->__('Internal (/kiyoh)'), + ); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohlogController.php b/app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohlogController.php new file mode 100755 index 0000000..6bbe234 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohlogController.php @@ -0,0 +1,99 @@ +loadLayout() + ->_setActiveMenu('kiyoh/kiyohreviews') + ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager')); + return $this; + } + + /** + * + */ + public function indexAction() + { + $this->_initAction()->renderLayout(); + } + + /** + * + */ + public function massDeleteAction() + { + $logIds = $this->getRequest()->getParam('logids'); + if (!is_array($logIds)) { + Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)')); + } else { + try { + foreach ($logIds as $id) { + Mage::getModel('kiyoh/log')->load($id)->delete(); + } + + $msg = Mage::helper('kiyoh')->__('Total of %d log record(s) deleted.', count($logIds)); + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + } catch (Exception $e) { + Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } + } + + $this->_redirect('*/*/index'); + } + + /** + * + */ + public function cleanAction() + { + $enabled = Mage::getStoreConfig('kiyoh/log/clean'); + $days = Mage::getStoreConfig('kiyoh/log/clean_days'); + $i = 0; + if (($enabled) && ($days > 0)) { + $logmodel = Mage::getModel('kiyoh/log'); + $deldate = date('Y-m-d', strtotime('-' . $days . ' days')); + $logs = $logmodel->getCollection()->addFieldToSelect('id')->addFieldToFilter('date', array('lteq' => $deldate)); + foreach ($logs as $log) { + $logmodel->load($log->getId())->delete(); + $i++; + } + + $msg = Mage::helper('kiyoh')->__('Total of %s log record(s) deleted.', $i); + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + } + + $this->_redirect('*/*/index'); + } + + /** + * @return mixed + */ + protected function _isAllowed() + { + return Mage::getSingleton('admin/session')->isAllowed('admin/kiyoh/kiyoh_log'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohreviewsController.php b/app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohreviewsController.php new file mode 100755 index 0000000..1c72906 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohreviewsController.php @@ -0,0 +1,199 @@ +loadLayout() + ->_setActiveMenu('kiyoh/kiyohreviews') + ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager')); + return $this; + } + + /** + * + */ + public function indexAction() + { + $this->_initAction()->renderLayout(); + } + + /** + * + */ + public function processAction() + { + $storeIds = Mage::getModel('kiyoh/api')->getStoreIds(); + $startTime = microtime(true); + + foreach ($storeIds as $storeId) { + $msg = ''; + $apiId = Mage::getStoreConfig('kiyoh/general/api_id', $storeId); + $result = Mage::getModel('kiyoh/api')->processFeed($storeId, 'history'); + $time = (microtime(true) - $startTime); + Mage::getModel('kiyoh/log')->add('reviews', $storeId, $result, '', $time, '', ''); + + if (($result['review_new'] > 0) || ($result['review_updates'] > 0) || ($result['stats'] == true)) { + $msg = Mage::helper('kiyoh')->__('Webwinkel ID %s:', $apiId) . ' '; + $msg .= Mage::helper('kiyoh')->__('%s new review(s)', $result['review_new']) . ', '; + $msg .= Mage::helper('kiyoh')->__('%s review(s) updated', $result['review_updates']) . ' & '; + $msg .= Mage::helper('kiyoh')->__('and total score updated.'); + } + + if ($msg) { + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + } + } + + Mage::getModel('kiyoh/stats')->processOverall(); + $this->_redirect('adminhtml/system_config/edit/section/kiyoh'); + } + + /** + * + */ + public function massDisableAction() + { + $reviewIds = $this->getRequest()->getParam('reviewids'); + if (!is_array($reviewIds)) { + Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)')); + } else { + try { + foreach ($reviewIds as $reviewId) { + $reviews = Mage::getModel('kiyoh/reviews')->load($reviewId); + $reviews->setStatus(0)->save(); + } + + $msg = Mage::helper('kiyoh')->__('Total of %d review(s) were disabled.', count($reviewIds)); + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + } catch (Exception $e) { + Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } + } + + $this->_redirect('*/*/index'); + } + + /** + * + */ + public function massEnableAction() + { + $reviewIds = $this->getRequest()->getParam('reviewids'); + if (!is_array($reviewIds)) { + Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)')); + } else { + try { + foreach ($reviewIds as $reviewId) { + $reviews = Mage::getModel('kiyoh/reviews')->load($reviewId); + $reviews->setStatus(1)->save(); + } + + $msg = Mage::helper('kiyoh')->__('Total of %d review(s) were enabled.', count($reviewIds)); + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + } catch (Exception $e) { + Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } + } + + $this->_redirect('*/*/index'); + } + + /** + * + */ + public function massEnableSidebarAction() + { + $reviewIds = $this->getRequest()->getParam('reviewids'); + if (!is_array($reviewIds)) { + Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)')); + } else { + try { + foreach ($reviewIds as $reviewId) { + $reviews = Mage::getModel('kiyoh/reviews')->load($reviewId); + $reviews->setSidebar(1)->save(); + } + + $msg = Mage::helper('kiyoh')->__('Total of %d review(s) were added to the sidebar.', count($reviewIds)); + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + } catch (Exception $e) { + Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } + } + + $this->_redirect('*/*/index'); + } + + /** + * + */ + public function massDisableSidebarAction() + { + $reviewIds = $this->getRequest()->getParam('reviewids'); + if (!is_array($reviewIds)) { + Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)')); + } else { + try { + foreach ($reviewIds as $reviewId) { + $reviews = Mage::getModel('kiyoh/reviews')->load($reviewId); + $reviews->setSidebar(0)->save(); + } + + $msg = Mage::helper('kiyoh')->__('Total of %d review(s) were removed from the sidebar.', count($reviewIds)); + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + } catch (Exception $e) { + Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } + } + + $this->_redirect('*/*/index'); + } + + /** + * + */ + public function truncateAction() + { + $i = 0; + $collection = Mage::getModel('kiyoh/reviews')->getCollection(); + foreach ($collection as $item) { + $item->delete(); + $i++; + } + + $msg = Mage::helper('kiyoh')->__('Succefully deleted all %s saved review(s).', $i); + Mage::getSingleton('adminhtml/session')->addSuccess($msg); + $this->_redirect('*/*/index'); + } + + /** + * @return mixed + */ + protected function _isAllowed() + { + return Mage::getSingleton('admin/session')->isAllowed('admin/kiyoh/kiyoh_reviews'); + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/controllers/IndexController.php b/app/code/local/Magmodules/Kiyoh/controllers/IndexController.php new file mode 100755 index 0000000..f9eba9e --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/controllers/IndexController.php @@ -0,0 +1,52 @@ +loadLayout(); + $head = $this->getLayout()->getBlock('head'); + + if ($title = Mage::getStoreConfig('kiyoh/overview/meta_title')) { + $head->setTitle($title); + } + + if ($description = Mage::getStoreConfig('kiyoh/overview/meta_description')) { + $head->setDescription($description); + } + + if ($keywords = Mage::getStoreConfig('kiyoh/overview/meta_keywords')) { + $head->setKeywords($keywords); + } + + $this->renderLayout(); + } else { + $this->_redirect('/'); + } + } + +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/data/kiyoh_setup/data-upgrade-1.1.0-1.1.1.php b/app/code/local/Magmodules/Kiyoh/data/kiyoh_setup/data-upgrade-1.1.0-1.1.1.php new file mode 100755 index 0000000..9882575 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/data/kiyoh_setup/data-upgrade-1.1.0-1.1.1.php @@ -0,0 +1,37 @@ +getConnection(); + $table = $installer->getTable('admin/permission_block'); + $blockNames = array( + 'kiyoh/snippets', + 'kiyoh/custom', + ); + foreach ($blockNames as $blockName) { + $connection->insertOnDuplicate( + $table, array( + 'block_name' => $blockName, + 'is_allowed' => 1, + ) + ); + } +} \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/etc/adminhtml.xml b/app/code/local/Magmodules/Kiyoh/etc/adminhtml.xml new file mode 100755 index 0000000..6cc9784 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/etc/adminhtml.xml @@ -0,0 +1,88 @@ + + + + + + Reviews + 71 + + + KiyOh Connect + 11 + + + Manage Reviews + 100 + adminhtml/kiyohreviews/ + + + Manage Log + 110 + adminhtml/kiyohlog/ + + + KiyOh Config + 120 + adminhtml/system_config/edit/section/kiyoh + + + + + + + + + + Allow Everything + + + + + + + + + KiyOh Connect Permission Setting + + + + + + + Kiyoh Connect + 60 + + + Reviews + 100 + adminhtml/kiyohreviews/ + + + Log + 110 + adminhtml/kiyohlog/ + + + + + + + + \ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/etc/config.xml b/app/code/local/Magmodules/Kiyoh/etc/config.xml new file mode 100755 index 0000000..a376b31 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/etc/config.xml @@ -0,0 +1,243 @@ + + + + + + 1.1.2 + + + + + + Magmodules_Kiyoh_Model + kiyoh_mysql4 + + + Magmodules_Kiyoh_Model_Mysql4 + + + kiyoh_reviews
+
+ + kiyoh_stats
+
+ + kiyoh_log
+
+
+
+
+ + + + Magmodules_Kiyoh + + + core_setup + + + + + core_write + + + + + core_read + + + + + + Magmodules_Kiyoh_Helper + + + + + Magmodules_Kiyoh_Block + + + + + + + singleton + kiyoh/observer + processFeedbackInvitationcallAfterShipment + + + + + + + singleton + kiyoh/observer + processFeedbackInvitationcall + + + + +
+ + + + standard + + Magmodules_Kiyoh + kiyoh + + + + + + + magmodules_kiyoh.xml + + + + + + + + Magmodules_Kiyoh.csv + + + + + + + + + + magmodules_kiyoh.xml + + + + + + + + Magmodules_Kiyoh.csv + + + + + + + + + + + Magmodules_Kiyoh_Adminhtml + + + + + + + + + + kiyoh/reviews/cron_stats + + + kiyoh/observer::processStats + + + + + kiyoh/reviews/cron_reviews + + + kiyoh/observer::processReviews + + + + + kiyoh/reviews/cron_all + + + kiyoh/observer::processHistory + + + + + 0 02 * * * + + + kiyoh/observer::cleanLog + + + + + + + + 0 + + + 0 + */15 * * * * + 0 */2 * * * + 0 2 0 * * + + + 0 + 3 + 150 + external + 0 + 3 + 150 + external + + + 1 + + + 1 + 1 + 10,20,30 + KiyOh Reviews + KiyOh overview page + reviews, kiyoh + + + 0 + complete + 5 + 20 + 0 + 1 + + + 0 + 0 + left + 120 + + + 1 + 1 + 14 + + + +
\ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/etc/system.xml b/app/code/local/Magmodules/Kiyoh/etc/system.xml new file mode 100755 index 0000000..9c2e6d1 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/etc/system.xml @@ -0,0 +1,608 @@ + + + + + + + 200 + + + + + + magmodules + text + 40 + 1 + 1 + 1 + + + kiyoh/adminhtml_widget_info_info + 1 + 1 + 1 + 1 + + + + text + 2 + 1 + 1 + 1 + 1 + + + Event.observe(window, 'load', function() { + if ($('kiyoh_reviews_lastrun')) { + $('kiyoh_reviews_lastrun').style.backgroundColor='#f0f0f0'; + $('kiyoh_reviews_lastrun').disable(); + } + if ($('kiyoh_general_url')) { + $('kiyoh_general_url').style.backgroundColor='#f0f0f0'; + $('kiyoh_general_url').disable(); + } + if ($('kiyoh_general_company')) { + $('kiyoh_general_company').style.backgroundColor='#f0f0f0'; + $('kiyoh_general_company').disable(); + } + }); + + ]]> + + + + + text + kiyoh/adminhtml_widget_field_version + 1 + 1 + 0 + 0 + + + + select + adminhtml/system_config_source_yesno + kiyoh/system_config_flushcache + 2 + 1 + 1 + 1 + + + + kiyoh/adminhtml_widget_form_heading + 3 + 1 + 0 + 1 + + + + select + kiyoh/system_config_source_kiyoh + 4 + 1 + 1 + 1 + + + + text + 5 + 1 + 0 + 1 + + + + text + 6 + 1 + 0 + 1 + You can find this information in your Kiyoh account + + + + kiyoh/adminhtml_widget_form_heading + 10 + 1 + 0 + 1 + + + + text + 11 + 1 + 0 + 1 + + + + text + 12 + 1 + 0 + 1 + + + + + + text + 3 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 1 + 1 + + + + select + kiyoh/system_config_source_cronfrequency + 2 + 1 + 1 + 1 + + 1 + + + + + select + kiyoh/system_config_source_cronfrequency + 3 + 1 + 1 + 1 + + 1 + + + + + select + kiyoh/system_config_source_cronfrequency + 4 + 1 + 1 + 1 + + 1 + + + + + text + 100 + 1 + 1 + 1 + + + + button + kiyoh/adminhtml_widget_buttons_process + 101 + 1 + 1 + 1 + + + + + + text + 4 + 1 + 1 + 1 + 1 + + + + kiyoh/adminhtml_widget_form_heading + 50 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 51 + 1 + 1 + 1 + + + + validate-number + text + 52 + 1 + 1 + 1 + + 1 + + + + + validate-number + text + 53 + 1 + 1 + 1 + + 1 + + + + + select + adminhtml/system_config_source_yesno + 56 + 1 + 1 + 1 + + 1 + + When using both sidebars make sure you only activate the Rich Snippets for only one + sidebar + + + + + select + kiyoh/system_config_source_sidebarlink + 55 + 1 + 1 + 1 + + 1 + + + + + kiyoh/adminhtml_widget_form_heading + 60 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 61 + 1 + 1 + 1 + + + + validate-number + text + 62 + 1 + 1 + 1 + + 1 + + + + + validate-number + text + 63 + 1 + 1 + 1 + + 1 + + + + + select + kiyoh/system_config_source_sidebarlink + 65 + 1 + 1 + 1 + + 1 + + + + + select + adminhtml/system_config_source_yesno + 66 + 1 + 1 + 1 + + 1 + + When using both sidebars make sure you only activate the Rich Snippets for only one + sidebar + + + + + + + text + 6 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 1 + 1 + + + + textarea + 2 + 1 + 1 + 1 + + 1 + + + + + select + adminhtml/system_config_source_enabledisable + 3 + 1 + 1 + 1 + + + + text + 4 + 1 + 1 + 1 + Comma Separated, as: 10,20,30 + + 1 + + + + + kiyoh/adminhtml_widget_form_heading + 10 + 1 + 1 + 1 + + + + text + 11 + 1 + 1 + 1 + + 1 + + + + + textarea + 12 + 1 + 1 + 1 + + 1 + + + + + textarea + 13 + 1 + 1 + 1 + + 1 + + + + + + + text + 7 + 1 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 1 + 1 + Send invitation? + Send customers automatically receive an invitation to share a customer + experience. + + + + + text + 2 + 1 + 1 + 1 + Use the company email address registered with Kiyoh, this is used as en extra + validation. + + + 1 + + + + + select + kiyoh/system_config_source_orderstatus + 3 + 1 + 1 + 1 + 1 + Invitation e-mail is sent after such status is achieved + Specify at which status you want to send the invitation. Default is "Completed" + + + 1 + + + + + text + 4 + 1 + 1 + 1 + Send the invitation x days after the order is completed + This will ensure that the customer receives the invitation shortly after receiving + the product and not before. This increases the opportunity that the client will share + his experience. + + + 1 + + + + + text + 6 + 1 + 1 + 1 + Change only if necessary + Number of days to complete order may last, if it takes longer then no invitation + will be sent. Read more about this feature on Kiyoh.nl. + + + 1 + + + + + + + text + 9 + 1 + 0 + 0 + 1 + + + + select + adminhtml/system_config_source_yesno + 1 + 1 + 0 + 0 + + + + select + adminhtml/system_config_source_yesno + 2 + 1 + 0 + 0 + + 1 + + + + + validate-number + text + 3 + 1 + 0 + 0 + + 1 + + + + + + + text + 10 + 1 + 1 + 1 + 1 + + The extension comes with two coded blocks.
With this blocks you can add your store rating in a Static block or CMS page.


The Rich Snippets Block.
Show your Store-rating with this block and generate results in the Google Search Engine Results better known as Rich Snippets.
Paste the code below at the desired location using a Static Block or a CMS page.

Code: {{block type="kiyoh/snippets" name="kiyohsnippets"}}


Custom Block.
With this block you can create custom block for footer of header, you can paste the code below at the desired location using a Static Block or a CMS page.
To edit this block you need to edit the .phtml file located in the following path: app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml

Code: {{block type="kiyoh/custom" name="kiyoh"}}

]]>
+
+
+
+
+
\ No newline at end of file diff --git a/app/code/local/Magmodules/Kiyoh/sql/kiyoh_setup/mysql4-install-1.0.0.php b/app/code/local/Magmodules/Kiyoh/sql/kiyoh_setup/mysql4-install-1.0.0.php new file mode 100755 index 0000000..5aa56b0 --- /dev/null +++ b/app/code/local/Magmodules/Kiyoh/sql/kiyoh_setup/mysql4-install-1.0.0.php @@ -0,0 +1,103 @@ +startSetup(); +$installer->run( + " + DROP TABLE IF EXISTS {$this->getTable('kiyoh_reviews')}; + CREATE TABLE IF NOT EXISTS {$this->getTable('kiyoh_reviews')} ( + `review_id` int(10) NOT NULL AUTO_INCREMENT, + `shop_id` int(5) NOT NULL, + `company` varchar(255) DEFAULT NULL, + `kiyoh_id` int(5) NOT NULL, + `score` smallint(6) DEFAULT '0', + `score_q2` smallint(6) DEFAULT '0', + `score_q3` smallint(6) DEFAULT '0', + `score_q4` smallint(6) DEFAULT '0', + `score_q5` smallint(6) DEFAULT '0', + `score_q6` smallint(6) DEFAULT '0', + `score_q7` smallint(6) DEFAULT '0', + `score_q8` smallint(6) DEFAULT '0', + `score_q9` smallint(6) DEFAULT '0', + `score_q10` smallint(6) DEFAULT '0', + `customer_name` varchar(255) DEFAULT NULL, + `customer_email` varchar(255) DEFAULT NULL, + `customer_place` varchar(255) DEFAULT NULL, + `recommendation` tinyint(1) DEFAULT NULL, + `positive` text, + `negative` text, + `purchase` text, + `reaction` text, + `date_created` date NOT NULL, + `date_updated` date NOT NULL, + `sidebar` tinyint(1) NOT NULL DEFAULT '1', + `status` tinyint(5) NOT NULL DEFAULT '1', + PRIMARY KEY (`review_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + DROP TABLE IF EXISTS {$this->getTable('kiyoh_log')}; + CREATE TABLE IF NOT EXISTS {$this->getTable('kiyoh_log')} ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `type` varchar(255) NOT NULL, + `shop_id` varchar(255) NOT NULL, + `company` varchar(255) DEFAULT NULL, + `review_update` int(5) DEFAULT '0', + `review_new` int(5) DEFAULT '0', + `response` text, + `order_id` int(10) DEFAULT NULL, + `cron` varchar(255) DEFAULT NULL, + `date` datetime NOT NULL, + `time` varchar(255) NOT NULL, + `api_url` text, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + DROP TABLE IF EXISTS {$this->getTable('kiyoh_stats')}; + CREATE TABLE IF NOT EXISTS {$this->getTable('kiyoh_stats')} ( + `id` int(5) NOT NULL AUTO_INCREMENT, + `company` varchar(255) DEFAULT NULL, + `shop_id` int(5) NOT NULL, + `score` smallint(6) DEFAULT '0', + `score_q2` smallint(6) DEFAULT '0', + `score_q2_title` varchar(255) NOT NULL, + `score_q3` smallint(6) DEFAULT '0', + `score_q3_title` varchar(255) NOT NULL, + `score_q4` smallint(6) DEFAULT '0', + `score_q4_title` varchar(255) NOT NULL, + `score_q5` smallint(6) DEFAULT '0', + `score_q5_title` varchar(255) NOT NULL, + `score_q6` smallint(6) DEFAULT '0', + `score_q6_title` varchar(255) NOT NULL, + `score_q7` smallint(6) DEFAULT '0', + `score_q7_title` varchar(255) NOT NULL, + `score_q8` smallint(6) DEFAULT '0', + `score_q8_title` varchar(255) NOT NULL, + `score_q9` smallint(6) DEFAULT '0', + `score_q9_title` varchar(255) NOT NULL, + `score_q10` smallint(6) DEFAULT '0', + `score_q10_title` varchar(255) NOT NULL, + `scoremax` smallint(6) DEFAULT '0', + `votes` int(5) DEFAULT '0', + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +" +); +$installer->endSetup(); \ No newline at end of file diff --git a/app/design/adminhtml/default/default/layout/magmodules_kiyoh.xml b/app/design/adminhtml/default/default/layout/magmodules_kiyoh.xml new file mode 100755 index 0000000..1cdc5ae --- /dev/null +++ b/app/design/adminhtml/default/default/layout/magmodules_kiyoh.xml @@ -0,0 +1,37 @@ + + + + + + + + magmodules/kiyoh/grid.css + + + + + + + + + + + + \ No newline at end of file diff --git a/app/design/frontend/base/default/layout/magmodules_kiyoh.xml b/app/design/frontend/base/default/layout/magmodules_kiyoh.xml new file mode 100755 index 0000000..0545f1b --- /dev/null +++ b/app/design/frontend/base/default/layout/magmodules_kiyoh.xml @@ -0,0 +1,63 @@ + + + + + + + + magmodules/kiyoh/sidebar.css + + + + + + + + + + + + + + + + + + magmodules/kiyoh/style.css + + + + + + + + + + + + + + + + magmodules/kiyoh/richsnippets.css + + + + \ No newline at end of file diff --git a/app/design/frontend/base/default/template/magmodules/kiyoh/index.phtml b/app/design/frontend/base/default/template/magmodules/kiyoh/index.phtml new file mode 100755 index 0000000..f822b1e --- /dev/null +++ b/app/design/frontend/base/default/template/magmodules/kiyoh/index.phtml @@ -0,0 +1,154 @@ + +getReviews(); + $stats = $this->getStats(); +?> +
+
+

__('Kiyoh'); ?>

+ + + +
+ + getSize()): ?> +
+
+ +
+
+ +
+
+

getCustomerName(); ?> + - formatDate($review->getDateCreated(), 'long', false); ?> + - getCustomerPlace(); ?>

+ getScore()): ?> +
    +
  • + +
  • +
+ +
+ + +
+ + getPagerHtml(); ?> + +

__('No reviews found...'); ?>

+ +
\ No newline at end of file diff --git a/app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/left.phtml b/app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/left.phtml new file mode 100755 index 0000000..0cb363d --- /dev/null +++ b/app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/left.phtml @@ -0,0 +1,74 @@ +getSidebarCollection('left'); +$total = $this->getTotalScore(); +?> + +
+
+ __('Kiyoh') ?> +
+ getPercentage() > 0): ?> + getSnippetsEnabled('left')): ?> +
+
+
+
+

getStarsQty(); ?> / 10

+

__('Based on %s reviews', '' . $total->getVotes() . ''); ?>

+
+
+ +
+
+
+
+

getStarsQty(); ?> / 10

+

__('Based on %s reviews', '' . $total->getVotes() . ''); ?>

+
+
+ + + + formatContent($sidebarreview, 'left'); ?> +
+
+

getCustomerName(); ?>

+ formatDate($sidebarreview->getDateCreated(), 'medium', false); ?> + getScore()): ?> + + +
+
+ + getReviewsUrl('left')): ?> +
+ +
+ +
+
+ +
+ \ No newline at end of file diff --git a/app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/right.phtml b/app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/right.phtml new file mode 100755 index 0000000..01f7cf1 --- /dev/null +++ b/app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/right.phtml @@ -0,0 +1,75 @@ +getSidebarCollection('right'); +$total = $this->getTotalScore(); +?> + +
+
+ __('Kiyoh') ?> +
+ getPercentage() > 0): ?> + getSnippetsEnabled('right')): ?> +
+
+
+
+

getStarsQty(); ?> / 10

+

__('Based on %s reviews', '' . $total->getVotes() . ''); ?>

+
+
+ +
+
+
+
+

getStarsQty(); ?> / 10

+

__('Based on %s reviews', '' . $total->getVotes() . ''); ?>

+
+
+ + + + formatContent($sidebarreview, 'right'); ?> +
+
+

getCustomerName(); ?>

+ formatDate($sidebarreview->getDateCreated(), 'medium', false); ?> + getScore()): ?> + + +
+
+ + getReviewsUrl('right')): ?> +
+ +
+ +
+
+ +
+ \ No newline at end of file diff --git a/app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml b/app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml new file mode 100755 index 0000000..30aa6d8 --- /dev/null +++ b/app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml @@ -0,0 +1,37 @@ +getKiyohEnabled(); +$data = $this->getKiyohData(); + +$percentage = $data->getPercentage(); +$rating = round(($data->getPercentage() / 10), 1); + +?> +
+
+
+ / 10 +

getVotes(); ?> beoordelingen

+
+
+ diff --git a/app/design/frontend/base/default/template/magmodules/kiyoh/widget/richsnippets.phtml b/app/design/frontend/base/default/template/magmodules/kiyoh/widget/richsnippets.phtml new file mode 100755 index 0000000..7689daa --- /dev/null +++ b/app/design/frontend/base/default/template/magmodules/kiyoh/widget/richsnippets.phtml @@ -0,0 +1,32 @@ + +getSnippets()) { ?> +
+ getHtmlStars($snippets->getPercentage()); ?> +
+ +
+ +

__('Rating %s based on %s customer reviews', '' . $snippets->getPercentage() . '%', '' . $snippets->getVotes() . '') ?>getExternalLink(); ?>

+
+
+
+ diff --git a/app/etc/modules/Magmodules_Kiyoh.xml b/app/etc/modules/Magmodules_Kiyoh.xml new file mode 100755 index 0000000..086dd02 --- /dev/null +++ b/app/etc/modules/Magmodules_Kiyoh.xml @@ -0,0 +1,9 @@ + + + + + true + local + + + \ No newline at end of file diff --git a/app/locale/en_US/Magmodules_Kiyoh.csv b/app/locale/en_US/Magmodules_Kiyoh.csv new file mode 100755 index 0000000..9ce3ded --- /dev/null +++ b/app/locale/en_US/Magmodules_Kiyoh.csv @@ -0,0 +1,126 @@ +"%s - Repsonse: %s","%s - Repsonse: %s" +"%s new review(s)","%s new review(s)" +"%s review(s) updated","%s review(s) updated" +"API CREDENTIALS","API CREDENTIALS" +"Activate","Activate" +"Active","Active" +"Add Rich Snippets","Add Rich Snippets" +"Add to Sidebar","Add to Sidebar" +"Add to Sidebar Homepage","Add to Sidebar Homepage" +"Api URL","Api URL" +"Are you sure you want to cleanup logfiles?","Are you sure you want to cleanup logfiles?" +"Are you sure you want to delete all reviews?","Are you sure you want to delete all reviews?" +"Auto Cleaning","Auto Cleaning" +"Based on %s reviews","Based on %s reviews" +"Change only if necessary","Change only if necessary" +"City","City" +"Clean after Days","Clean after Days" +"Cleanup Log","Cleanup Log" +"Comma Separated, as: 10,20,30","Comma Separated, as: 10,20,30" +"Company","Company" +"Company ID","Company ID" +"Company Import","Company Import" +"Connector Code","Connector Code" +"Cron","Cron" +"Date","Date" +"Delay","Delay" +"Delete","Delete" +"Delete all reviews","Delete all reviews" +"Description","Description" +"Email","Email" +"Enable Log Function","Enable Log Function" +"Enabled","Enabled" +"Every 15 minutes","Every 15 minutes" +"Every Hour","Every Hour" +"Every other Hour","Every other Hour" +"External (Kiyoh.nl)","External (Kiyoh.nl)" +"General configuration","General configuration" +"Internal (/kiyoh)","Internal (/kiyoh)" +"Invitation","Invitation" +"Invitation Call","Invitation Call" +"Invitation to write the customer experience","Invitation to write the customer experience" +"Kihoy.com","Kihoy.com" +"KiyOh","KiyOh" +"KiyOh Connect Permission Setting","KiyOh Connect Permission Setting" +"KiyOh Custom Blocks","KiyOh Custom Blocks" +"KiyOh Log Settings","KiyOh Log Settings" +"KiyOh Overview Page","KiyOh Overview Page" +"KiyOh Reviews Sidebar","KiyOh Reviews Sidebar" +"Kiyoh","KiyOh" +"Kiyoh Import Reviews","Kiyoh Import Reviews" +"Kiyoh Logs","Kiyoh Logs" +"Kiyoh Reviews","Kiyoh Reviews" +"Kiyoh.nl","KiyOh.nl" +"Last Update","Last Update" +"Left","Left" +"Left Sidebar","Left Sidebar" +"Length of Reviews","Length of Reviews" +"Link to","Link to" +"Localisation","Localisation" +"Magmodules","Magmodules" +"Manual","Manual" +"Maximum Delay","Maximum Delay" +"Meta Data","Meta Data" +"Meta Keywords","Meta Keywords" +"Negative","Improvement Points" +"No","No" +"No reviews found...","No reviews found..." +"None","None" +"Number of Reviews","Number of Reviews" +"Number of days to complete order may last, if it takes longer then no invitation will be sent. Read more about this feature on Kiyoh.nl.","Number of days to complete order may last, if it takes longer then no invitation will be sent. Read more about this feature on Kiyoh.nl." +"Once a Day","Once a Day" +"Once a Week","Once a Week" +"Overall","Overall" +"Please select item(s)","Please select item(s)" +"Positive","Positive points" +"Process Manually","Process Manually" +"Rating %s based on %s customer reviews","Rating %s based on %s customer reviews" +"Reaction","Reaction" +"Recommend","Recommend" +"Recommendation","Recommendation" +"Remove from Sidebar","Remove from Sidebar" +"Reviews","Reviews" +"Reviews Cron","Reviews Cron" +"Right","Right" +"Right Sidebar","Right Sidebar" +"Score","Score" +"Set to invisible","Set to invisible" +"Set to visible","Set to visible" +"Send customers automatically receive an invitation to share a customer experience.","Send customers automatically receive an invitation to share a customer experience." +"Send the invitation x days after the order is completed","Send the invitation x days after the order is completed" +"Shop","Shop" +"Sidebar",""Sidebar"" +"Stats Cron","Stats Cron" +"Succefully deleted all %s saved review(s).","Succefully deleted all %s saved review(s)." +"Suggestions","Suggestions" +"Specify at which status you want to send the invitation. Default is ""Completed"".","Specify at which status you want to send the invitation. Default is ""Completed""." +"Test API","Test API" +"Time","Time" +"Total of %d log record(s) deleted.","Total of %d log record(s) deleted." +"Total of %d review(s) were added to the sidebar.","Total of %d review(s) were added to the sidebar." +"Total of %d review(s) were disabled.","Total of %d review(s) were disabled." +"Total of %d review(s) were enabled.","Total of %d review(s) were enabled." +"Total of %d review(s) were removed from the sidebar.","Total of %d review(s) were removed from the sidebar." +"Total of %s log record(s) deleted.","Total of %s log record(s) deleted." +"This will ensure that the customer receives the invitation shortly after receiving the product and not before. This increases the opportunity that the client will share his experience.","This will ensure that the customer receives the invitation shortly after receiving the product and not before. This increases the opportunity that the client will share his experience." +"Twice a Day","Twice a Day" +"Type","Type" +"Update Review History","Update Review History" +"Update Reviews","Update Reviews" +"Update Summary","Update Summary" +"Url","Url" +"Use the company email address registered with Kiyoh, this is used as en extra validation.","Use the company email address registered with Kiyoh, this is used as en extra validation." +"Use Cronjob","Use Cronjob" +"User","User" +"View all reviews","View all reviews" +"Webwinkel ID %s:","Webwinkel ID %s:" +"Webwinkel ID %s: no updates found, feed is empty or not found!","Webwinkel ID %s: no updates found, feed is empty or not found!" +"Write review","Write review" +"Yes","Yes" +"You can find this information in your Kiyoh account","You can find this information in your Kiyoh account" +"You can only activate the Rich Snippets when this block is shown on your Homepage only","You can only activate the Rich Snippets when this block is shown on your Homepage only" +"and total score updated.","and total score updated." +"on","on" +"total score updated","total score updated" +"

The extension comes with two coded blocks.
With this blocks you can add your store rating in a Static block or CMS page.


The Rich Snippets Block.
Show your Store-rating with this block and generate results in the Google Search Engine Results better known as Rich Snippets.
Paste the code below at the desired location using a Static Block or a CMS page.

Code: {{block type=""kiyoh/snippets"" name=""kiyohsnippets""}}


Custom Block.
With this block you can create custom block for footer of header, you can paste the code below at the desired location using a Static Block or a CMS page.
To edit this block you need to edit the .phtml file located in the following path: app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml

Code: {{block type=""kiyoh/custom"" name=""kiyoh""}}

","

The extension comes with two coded blocks.
With this blocks you can add your store rating in a Static block or CMS page.


The Rich Snippets Block.
Show your Store-rating with this block and generate results in the Google Search Engine Results better known as Rich Snippets.
Paste the code below at the desired location using a Static Block or a CMS page.

Code: {{block type=""kiyoh/snippets"" name=""kiyohsnippets""}}


Custom Block.
With this block you can create custom block for footer of header, you can paste the code below at the desired location using a Static Block or a CMS page.
To edit this block you need to edit the .phtml file located in the following path: app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml

Code: {{block type=""kiyoh/custom"" name=""kiyoh""}}

" +"When using both sidebars make sure you only activate the Rich Snippets for only one sidebar","When using both sidebars make sure you only activate the Rich Snippets for only one sidebar" \ No newline at end of file diff --git a/app/locale/nl_NL/Magmodules_Kiyoh.csv b/app/locale/nl_NL/Magmodules_Kiyoh.csv new file mode 100755 index 0000000..7b41c47 --- /dev/null +++ b/app/locale/nl_NL/Magmodules_Kiyoh.csv @@ -0,0 +1,132 @@ +"%s - Repsonse: %s","%s - Antwoord: %s" +"%s new review(s)","%s nieuwe beoordeling(en)" +"%s review(s) updated","%s beoordeling(en) geupdate" +"API CREDENTIALS","API Gegevens" +"Activate","Activeren" +"Active","Actief" +"Add Rich Snippets","Voeg Rich Snippets toe" +"Add to Sidebar","Sidebar toevoegen" +"Add to Sidebar Homepage","Voeg toe aan sidebar op Homepage" +"Api URL","Api URL" +"Are you sure you want to cleanup logfiles?","Definitief de logfiles opschonen?" +"Are you sure you want to delete all reviews?","Definitief alle beoordelingen verwijderen?" +"Auto Cleaning","Automatisch opruimen" +"Based on %s reviews","Gebaseerd op %s beoordelingen" +"Change only if necessary","Verander alleen indien noodzakelijk" +"City","Plaats" +"Clean after Days","Opschonen na aantal dagen" +"Cleanup Log","Schoonmaak log" +"Comma Separated, as: 10,20,30","Komma gescheiden als: 10,20,30" +"Company","Bedrijf" +"Company ID","Bedrijfs ID" +"Company Import","Bedrijfs import" +"Connector Code","Connector code" +"Cron","Cron" +"Date","Datum" +"Delay","Vertraging" +"Delete","Verwijder" +"Delete all reviews","Verwijder alle beoordelingen" +"Description","Omschrijving" +"Email","E-mail" +"Enable Log Function","Activeer logfunctie" +"Enabled","Activeer" +"Every 15 minutes","Elke 15 minuten" +"Every Hour","Elk uur" +"Every other Hour","Om het uur" +"External (Kiyoh.nl)","Extern (KiyOh.nl)" +"General configuration","Algemene informatie" +"Internal (/kiyoh)","Intern (/kiyoh)" +"Invitation","Herinnering" +"Invitation Call","Herinnering e-mail" +"Invitation to write the customer experience","Herinnering om een beoordeling te schrijven" +"Kihoy.com","KihOy.com" +"KiyOh","KiyOh" +"KiyOh Connect Permission Setting","KiyOh Connect permissie instellingen" +"KiyOh Custom Blocks","KiyOh elementen" +"KiyOh Log Settings","KiyOh log settings" +"KiyOh Overview Page","KiyOh overzichtpagina" +"KiyOh Reviews Sidebar","KiyOh beoordeling sidebar" +"Kiyoh","KiyOh" +"Kiyoh Import Reviews","KiyOh beoordelingen importeren" +"Kiyoh Logs","KiyOh Logs" +"Kiyoh Reviews","KiyOh beoordelingen" +"Kiyoh.nl","KiyOh.nl" +"Last Update","Laatste Update" +"Left","Links" +"Left Sidebar","Linker sidebar" +"Length of Reviews","Lengte van beoordelingen" +"Link to","Link naar" +"Localisation","Lokalisatie" +"Magmodules","Magmodules" +"Manage Reviews","Beheer Beoordelingen" +"Manage Log","Beheer Log" +"Manual","Handleiding" +"Maximum Delay","Maximale vertraging" +"Meta Data","Meta Data" +"Meta Keywords","Meta zoekwoorden" +"Negative","Verbeterpunten" +"No","Nee" +"No reviews found...","Geen beoordelingen gevonden..." +"None","Geen" +"Number of Reviews","Aantal beoordelingen" +"Number of days to complete order may last, if it takes longer then no invitation will be sent. Read more about this feature on Kiyoh.nl.","Aantal dagen dat een order oud mag zijn alvorens de herinnering wordt verstuurd, als het wijzigen van de orderstatus langer duurt wordt er niks verstuurd." +"Once a Day","Eens per dag" +"Once a Week","Eens per week" +"Overall","Overall" +"Please select item(s)","Selecteer item(s)" +"Positive","Pluspunten" +"Positive points:","Positieve punten:" +"Process Manually","Voer handmatig uit" +"Rating %s based on %s customer reviews","Beoordeling %s gebaseerd op %s klantbeoordelingen" +"Reaction","Reactie" +"Recommend","Aanbevolen" +"Recommend:","Aanbevolen:" +"Recommendation","Aanbeveling" +"Remove from Sidebar","Verwijder van sidebar" +"Reviews","Beoordelingen" +"Reviews Cron","Beoordeling Cron" +"Right","Rechts" +"Right Sidebar","Rechter Sidebar" +"Score","Score" +"Set to invisible","Stel in als niet zichtbaar" +"Set to visible","Maak zichtbaar" +"Send customers automatically receive an invitation to share a customer experience.","Stuur klanten automatisch een e-mail met de herinnering om een beoordeling te schrijven." +"Send the invitation x days after the order is completed","Stuur de herinnering een x aantal dagen nadat de geselecteerde status is bereikt." +"Shop","Winkel" +"Sidebar","Sidebar" +"Stats Cron","Statistieken Cron" +"Succefully deleted all %s saved review(s).","Alle %s opgeslagen beoordelingen zijn succesvol verwijdert." +"Suggestions","Suggesties" +"Suggestions:","Suggesties" +"Specify at which status you want to send the invitation. Default is ""Completed"".","Specificeer vanaf welke status de herinnering verzonden dient te worden. Standaard is ""Completed""." +"Test API","Test API" +"Time","Tijd" +"Total of %d log record(s) deleted.","Een totaal van %d log rij(en) zijn verwijdert." +"Total of %d review(s) were added to the sidebar.","Een totaal van %d beoordeling(en) zijn aan de sidebar toegevoegd." +"Total of %d review(s) were disabled.","Een totaal van %d beoordeling(en) zijn uitgeschakeld." +"Total of %d review(s) were enabled.","Een totaal van %d beoordeling(en) zijn uitgeschakeld." +"Total of %d review(s) were removed from the sidebar.","Een totaal van %d beoordeling(en) zijn verwijdert uit de sidebar" +"Total of %s log record(s) deleted.","Een totaal van %s log rijen(s) verwijdert." +"This will ensure that the customer receives the invitation shortly after receiving the product and not before. This increases the opportunity that the client will share his experience.","Dit zal ervoor zorgen dat de klant na ontvangst van het product nogmaals een uitnodiging ontvangt. Dit vergroot de kans dat de klant zijn ervaring zal delen." +"Twice a Day","Tweemaal per dag" +"Type","Type" +"Update Review History","Update Beoordeling historie" +"Update Reviews","Update beoordelingen" +"Update Summary","Update samenvatting" +"Url","Url" +"Use the company email address registered with Kiyoh, this is used as en extra validation.","Gebruik het e-mail adres waarmee kiyOh geregistreerd staat, dit wordt gebruikt als extra validatie" +"Use Cronjob","Gebruik Cronjob" +"User","Gebruiker" +"View all reviews","Bekijk alle beoordelingen" +"Webwinkel ID %s:","Webwinkel ID %s:" +"Webwinkel ID %s: no updates found, feed is empty or not found!","Webwinkel ID %s: geen updates gevonden, feed is leeg of niet beschikbaar." +"Write review","Schrijf beoordeling" +"Yes","Ja" +"You can find this information in your Kiyoh account","Je kunt deze informatie vinden in je KiyOh account." +"You can only activate the Rich Snippets when this block is shown on your Homepage only","U kunt deze optie enkel activeren wanneer de sidebar op de homepage wordt vertoond. Indien u ook gebruikt maakt van de homepage widget dan raden wij u aan deze optie uit te schakelen om dubbele Rich Snippets te voorkomen." +"and total score updated.","totaal score geüpdate." +"on","via" +"total score updated","totaal score geüpdate" +"

The extension comes with two coded blocks.
With this blocks you can add your store rating in a Static block or CMS page.


The Rich Snippets Block.
Show your Store-rating with this block and generate results in the Google Search Engine Results better known as Rich Snippets.
Paste the code below at the desired location using a Static Block or a CMS page.

Code: {{block type=""kiyoh/snippets"" name=""kiyohsnippets""}}


Custom Block.
With this block you can create custom block for footer of header, you can paste the code below at the desired location using a Static Block or a CMS page.
To edit this block you need to edit the .phtml file located in the following path: app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml

Code: {{block type=""kiyoh/custom"" name=""kiyoh""}}

","

Deze extensie komt met 2 verschillende blokken.
Met deze blokken kan je de winkelbeoordeling in een static-block of CMS pagina plaatsen.


Het Rich Snippets blok.
Toon de webwinkel-waardering met in blok en genereer hiermee de zogenaamde Rich Snippets waarbij de winkelbeoordelingen worden getoond in de Zoekmachine resultaten van bijvoorbeeld Google. Plaat de onderstaande code op de gewenste plaats in een statische blok of een CMS-pagina.

De code: {{block type=""kiyoh/snippets"" name=""kiyohsnippets""}}


Custom blok.
Met dit custom blok is het mogelijk om eenvoudig een eigen blok creëren met daarin verschillende waardes als het aantal klanbeoordelingen, bedrijfsnaam en gemiddelde rating. Plaats de onderstaande code op de gewenste plek in een statisch blok of een CMS-pagina. Om dit blok naar wens te bewerken en eventueel aan te vullen met de geweneste informatie is het mogelijk om het .phtml bestand aan te passen. Deze is te vinden via de volgende path: app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml 

De code: {{block type=""kiyoh/custom"" name=""kiyoh""}}

" +"Rating %s based on %s customer reviews","totaal %s tevreden klanten op basis van %s beoordelingen" +"When using both sidebars make sure you only activate the Rich Snippets for only one sidebar","Zorg ervoor dat er maar 1 Rich Snippet actief is bij gebruik van beide sidebars." \ No newline at end of file diff --git a/modman b/modman new file mode 100755 index 0000000..0a60800 --- /dev/null +++ b/modman @@ -0,0 +1,23 @@ +app/code/local/Magmodules/Kiyoh app/code/local/Magmodules/Kiyoh +app/etc/modules/Magmodules_Kiyoh.xml app/etc/modules/Magmodules_Kiyoh.xml +app/locale/en_US/Magmodules_Kiyoh.csv app/locale/en_US/Magmodules_Kiyoh.csv +app/locale/nl_NL/Magmodules_Kiyoh.csv app/locale/nl_NL/Magmodules_Kiyoh.csv +app/design/adminhtml/default/default/layout/magmodules_kiyoh.xml app/design/adminhtml/default/default/layout/magmodules_kiyoh.xml +app/design/frontend/base/default/layout/magmodules_kiyoh.xml app/design/frontend/base/default/layout/magmodules_kiyoh.xml +app/design/frontend/base/default/template/magmodules/kiyoh/index.phtml app/design/frontend/base/default/template/magmodules/kiyoh/index.phtml +app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/left.phtml app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/left.phtml +app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/right.phtml app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/right.phtml +app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml +app/design/frontend/base/default/template/magmodules/kiyoh/widget/richsnippets.phtml app/design/frontend/base/default/template/magmodules/kiyoh/widget/richsnippets.phtml +skin/adminhtml/default/default/magmodules/kiyoh/grid.css skin/adminhtml/default/default/magmodules/kiyoh/grid.css +skin/adminhtml/default/default/magmodules/kiyoh/star.png skin/adminhtml/default/default/magmodules/kiyoh/star.png +skin/frontend/base/default/magmodules/kiyoh/images/5-stars-empty.png skin/frontend/base/default/magmodules/kiyoh/images/5-stars-empty.png +skin/frontend/base/default/magmodules/kiyoh/images/5-stars-full.png skin/frontend/base/default/magmodules/kiyoh/images/5-stars-full.png +skin/frontend/base/default/magmodules/kiyoh/images/bkg_rating.gif skin/frontend/base/default/magmodules/kiyoh/images/bkg_rating.gif +skin/frontend/base/default/magmodules/kiyoh/images/greystar.png skin/frontend/base/default/magmodules/kiyoh/images/greystar.png +skin/frontend/base/default/magmodules/kiyoh/images/logo.png skin/frontend/base/default/magmodules/kiyoh/images/logo.png +skin/frontend/base/default/magmodules/kiyoh/images/star.png skin/frontend/base/default/magmodules/kiyoh/images/star.png +skin/frontend/base/default/magmodules/kiyoh/richsnippets.css skin/frontend/base/default/magmodules/kiyoh/richsnippets.css +skin/frontend/base/default/magmodules/kiyoh/sidebar.css skin/frontend/base/default/magmodules/kiyoh/sidebar.css +skin/frontend/base/default/magmodules/kiyoh/style.css skin/frontend/base/default/magmodules/kiyoh/style.css + diff --git a/skin/adminhtml/default/default/magmodules/kiyoh/grid.css b/skin/adminhtml/default/default/magmodules/kiyoh/grid.css new file mode 100755 index 0000000..7870465 --- /dev/null +++ b/skin/adminhtml/default/default/magmodules/kiyoh/grid.css @@ -0,0 +1,94 @@ +/* + * Magmodules.eu - http://www.magmodules.eu + * + * NOTICE OF LICENSE + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to info@magmodules.eu so we can send you a copy immediately. + * + * @category Magmodules + * @package Magmodules_Kiyoh + * @author Magmodules