Version Notes
First official relase
Download this release
Release Info
Developer | Feedaty |
Extension | feedaty |
Version | 1.1.13 |
Comparing to | |
See all releases |
Version 1.1.13
- app/code/community/Feedaty/Badge/Block/LinkCsv.php +19 -0
- app/code/community/Feedaty/Badge/Block/Product.php +10 -0
- app/code/community/Feedaty/Badge/Helper/Data.php +5 -0
- app/code/community/Feedaty/Badge/Model/Generate.php +72 -0
- app/code/community/Feedaty/Badge/Model/Observe.php +61 -0
- app/code/community/Feedaty/Badge/Model/Order.php +14 -0
- app/code/community/Feedaty/Badge/Model/OrderStatuses.php +15 -0
- app/code/community/Feedaty/Badge/Model/PositionProduct.php +24 -0
- app/code/community/Feedaty/Badge/Model/PositionStore.php +23 -0
- app/code/community/Feedaty/Badge/Model/StyleProduct.php +17 -0
- app/code/community/Feedaty/Badge/Model/StyleStore.php +17 -0
- app/code/community/Feedaty/Badge/Model/WebService.php +156 -0
- app/code/community/Feedaty/Badge/controllers/Adminhtml/Badge.php +10 -0
- app/code/community/Feedaty/Badge/controllers/IndexController.php +39 -0
- app/code/community/Feedaty/Badge/etc/adminhtml.xml +22 -0
- app/code/community/Feedaty/Badge/etc/config.xml +136 -0
- app/code/community/Feedaty/Badge/etc/system.xml +215 -0
- app/code/community/Feedaty/Badge/etc/widget.xml +7 -0
- app/design/frontend/default/default/layout/Feedaty.xml +12 -0
- app/design/frontend/default/default/template/feedaty/base.phtml +5 -0
- app/design/frontend/default/default/template/feedaty/product_reviews.phtml +34 -0
- app/etc/modules/Feedaty_Badge.xml +9 -0
- app/locale/it_IT/Feedaty.csv +37 -0
- package.xml +18 -0
app/code/community/Feedaty/Badge/Block/LinkCsv.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Block_LinkCsv extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
6 |
+
{
|
7 |
+
$this->setElement($element);
|
8 |
+
$url = $this->getUrl('feedatyexport.csv'); //
|
9 |
+
|
10 |
+
$html = $this->getLayout()->createBlock('adminhtml/widget_button')
|
11 |
+
->setType('button')
|
12 |
+
->setClass('scalable')
|
13 |
+
->setLabel($this->__('Salva ora'))
|
14 |
+
->setOnClick("document.location.href = '".$url."'")
|
15 |
+
->toHtml();
|
16 |
+
|
17 |
+
return $html;
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Feedaty/Badge/Block/Product.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Block_Product extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->setTemplate('feedaty/base.phtml');
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Feedaty/Badge/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/community/Feedaty/Badge/Model/Generate.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
define("FEEDATY_DEBUG",false);
|
4 |
+
|
5 |
+
class Feedaty_Badge_Model_Generate {
|
6 |
+
public function product_badge($observer) {
|
7 |
+
$block = $observer->getBlock();
|
8 |
+
$transport = $observer->getTransport();
|
9 |
+
|
10 |
+
if ($block->getNameInLayout()==Mage::getStoreConfig('feedaty_badge_options/widget_products/product_position')) {
|
11 |
+
// Verify that plugin is enable
|
12 |
+
$plugin_enabled = Mage::getStoreConfig('feedaty_badge_options/widget_products/product_enabled');
|
13 |
+
if($plugin_enabled!=0){
|
14 |
+
$product = Mage::registry('current_product');
|
15 |
+
$product = $product->getId();
|
16 |
+
if (!is_null($product)) {
|
17 |
+
$data = Feedaty_Badge_Model_WebService::_get_FeedatyData();
|
18 |
+
|
19 |
+
$html = $transport->getHtml();
|
20 |
+
$transport->setHtml($html.str_replace("__insert_ID__",$product,$data[Mage::getStoreConfig('feedaty_badge_options/widget_products/badge_style')]['html_embed']));
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
public function product_reviews($observer) {
|
26 |
+
$block = $observer->getBlock();
|
27 |
+
$transport = $observer->getTransport();
|
28 |
+
|
29 |
+
$html = $transport->getHtml();
|
30 |
+
//$transport->setHtml("<p>".$block->getNameInLayout()."</p>".$html);return;
|
31 |
+
|
32 |
+
if ($block->getNameInLayout()==Mage::getStoreConfig('feedaty_badge_options/review_products/product_position')) {
|
33 |
+
// Verify that plugin is enable
|
34 |
+
$plugin_enabled = Mage::getStoreConfig('feedaty_badge_options/review_products/product_enabled');
|
35 |
+
$product = Mage::registry('current_product');
|
36 |
+
if($plugin_enabled!=0 && !is_null($product)){
|
37 |
+
$product = $product->getId();
|
38 |
+
$toview['data_review'] = Feedaty_Badge_Model_WebService::retrive_informations_product($product);
|
39 |
+
|
40 |
+
if (Mage::getStoreConfig('feedaty_badge_options/review_products/order_review') == 1)
|
41 |
+
$toview['data_review']['Feedbacks'] = array_reverse($toview['data_review']['Feedbacks']);
|
42 |
+
|
43 |
+
$toview['count_review'] = Mage::getStoreConfig('feedaty_badge_options/review_products/count_review');
|
44 |
+
$toview['link'] = '<a href="'.$toview['data_review']['Product']['Url'].'">'.Mage::helper('adminhtml')->__('Leggi tutte le recensioni').'</a>';
|
45 |
+
|
46 |
+
if (count($toview['data_review']['Feedbacks']) > 0) {
|
47 |
+
$html = $transport->getHtml();
|
48 |
+
$buttons = Mage::app()->getLayout()->createBlock('badge/product', 'addthis', array('template'=>'feedaty/product_reviews.phtml'))->setData('view', $toview)->setTemplate('feedaty/product_reviews.phtml'); //->setData('view', $toview);
|
49 |
+
$html .= $buttons->toHtml();
|
50 |
+
$transport->setHtml($html);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
public function store_badge($observer) {
|
56 |
+
$block = $observer->getBlock();
|
57 |
+
$transport = $observer->getTransport();
|
58 |
+
|
59 |
+
if ($block->getNameInLayout()==Mage::getStoreConfig('feedaty_badge_options/widget_store/store_position')) {
|
60 |
+
Feedaty_Badge_Model_WebService::send_notification();
|
61 |
+
// Verify that plugin is enable
|
62 |
+
$plugin_enabled = Mage::getStoreConfig('feedaty_badge_options/widget_store/enabled');
|
63 |
+
if($plugin_enabled!=0){
|
64 |
+
$data = Feedaty_Badge_Model_WebService::_get_FeedatyData();
|
65 |
+
|
66 |
+
$ver = json_decode(json_encode(Mage::getConfig()->getNode()->modules->Feedaty_Badge->version),true);
|
67 |
+
$html = '<!-- P.M. '.$ver[0].' -->'.$data[Mage::getStoreConfig('feedaty_badge_options/widget_store/badge_style')]['html_embed'].$transport->getHtml();
|
68 |
+
$transport->setHtml($html);
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
app/code/community/Feedaty/Badge/Model/Observe.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Model_Observe
|
3 |
+
{
|
4 |
+
public function intercept_order(& $observer){
|
5 |
+
|
6 |
+
$order = $observer->getEvent()->getOrder();
|
7 |
+
|
8 |
+
foreach ($order->getAllStatusHistory() as $orderComment){
|
9 |
+
$verify[$orderComment->getStatus()]++;
|
10 |
+
}
|
11 |
+
|
12 |
+
if (($order->getStatus() == Mage::getStoreConfig('feedaty_global/sendorder/sendorder')) && ($verify[Mage::getStoreConfig('feedaty_global/sendorder/sendorder')] <= 1)) {
|
13 |
+
// ********************************
|
14 |
+
// Getting informations about order
|
15 |
+
// and products
|
16 |
+
$objproducts = $order->getAllItems();
|
17 |
+
unset($fd_products);
|
18 |
+
|
19 |
+
foreach ($objproducts as $itemId => $item) {
|
20 |
+
unset($tmp);
|
21 |
+
//$tmp['sku'] = $item->getSku();
|
22 |
+
$tmp['Name'] = $item->getName();
|
23 |
+
$tmp['Brand'] = $item->getBrand();
|
24 |
+
$tmp['Id'] = $item->getProductId();
|
25 |
+
$fd_oProduct = Mage::getModel('catalog/product')->load((int) $tmp['Id']);
|
26 |
+
Mage::getModel('core/url_rewrite')->loadByRequestPath(
|
27 |
+
$tmp['Url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$fd_oProduct->getUrlPath()
|
28 |
+
);
|
29 |
+
if ($fd_oProduct->getImage() != "no_selection")
|
30 |
+
$tmp['ImageUrl'] = Mage::getModel('catalog/product_media_config')->getMediaUrl( $fd_oProduct->getImage() );
|
31 |
+
else
|
32 |
+
$tmp['ImageUrl'] = "";
|
33 |
+
//$tmp['Price'] = $item->getPrice();
|
34 |
+
|
35 |
+
$fd_products[] = $tmp;
|
36 |
+
}
|
37 |
+
// ********************************
|
38 |
+
|
39 |
+
// *******************************
|
40 |
+
// Formatting the array to be sent
|
41 |
+
$tmp_order['OrderId'] = $order->getId();
|
42 |
+
$tmp_order['OrderDate'] = date("Y-m-d H:i:s");
|
43 |
+
$tmp_order['CustomerEmail'] = $order->getBillingAddress()->getEmail();
|
44 |
+
$tmp_order['CustomerId'] = $order->getBillingAddress()->getEmail();
|
45 |
+
//$order['name'] = $order->getBillingAddress()->getName();
|
46 |
+
$tmp_order['Platform'] = "Magento ".MAGE::getVersion();
|
47 |
+
$tmp_order['Products'] = $fd_products;
|
48 |
+
|
49 |
+
$fd_data['orders'][] = $tmp_order;
|
50 |
+
$fd_data['merchantCode'] = Mage::getStoreConfig('feedaty_global/feedaty_preferences/feedaty_code');
|
51 |
+
|
52 |
+
// *******************************
|
53 |
+
|
54 |
+
// *********************************
|
55 |
+
// Sending request to feedaty server
|
56 |
+
Feedaty_Badge_Model_WebService::send_order($fd_data);
|
57 |
+
// *********************************
|
58 |
+
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
app/code/community/Feedaty/Badge/Model/Order.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Model_Order
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$return = array(
|
7 |
+
array("value"=>"0","label"=>Mage::helper('adminhtml')->__("Newest reviews first")),
|
8 |
+
array("value"=>"1","label"=>Mage::helper('adminhtml')->__("Old reviews first")),
|
9 |
+
);
|
10 |
+
|
11 |
+
return $return;
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
app/code/community/Feedaty/Badge/Model/OrderStatuses.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Model_OrderStatuses
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStatuses();
|
7 |
+
|
8 |
+
foreach ($statuses as $k=>$v) {
|
9 |
+
$return[] = array('value'=>$k,'label'=>$v);
|
10 |
+
}
|
11 |
+
|
12 |
+
return $return;
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
app/code/community/Feedaty/Badge/Model/PositionProduct.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Model_PositionProduct
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$return = array(
|
7 |
+
array("value"=>"content","label"=>Mage::helper('core')->__("After Content")),
|
8 |
+
array("value"=>"catalog.product.related","label"=>Mage::helper('core')->__("Product Related")),
|
9 |
+
array("value"=>"productalert.price","label"=>Mage::helper('core')->__("After Price")),
|
10 |
+
array("value"=>"productalert.stock","label"=>Mage::helper('core')->__("After Stock Informations")),
|
11 |
+
array("value"=>"product.info.simple","label"=>Mage::helper('core')->__("Simple")),
|
12 |
+
array("value"=>"product.info.simple.extra.child0","label"=>Mage::helper('core')->__("Extra child")),
|
13 |
+
array("value"=>"product.info.addtocart","label"=>Mage::helper('core')->__("Add to cart")),
|
14 |
+
array("value"=>"product.description","label"=>Mage::helper('core')->__("Product description")),
|
15 |
+
array("value"=>"product.attributes","label"=>Mage::helper('core')->__("Product attributes")),
|
16 |
+
array("value"=>"product.info.upsell","label"=>Mage::helper('core')->__("Product upsell")),
|
17 |
+
array("value"=>"product.info.additional","label"=>Mage::helper('core')->__("Product additional")),
|
18 |
+
array("value"=>"product_tag_list","label"=>Mage::helper('core')->__("Product tag list"))
|
19 |
+
);
|
20 |
+
|
21 |
+
return $return;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
app/code/community/Feedaty/Badge/Model/PositionStore.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Model_PositionStore
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$return = array(
|
7 |
+
array("value"=>"cms_page","label"=>Mage::helper('core')->__("Position Cms page")),
|
8 |
+
array("value"=>"page_content_heading","label"=>Mage::helper('core')->__("Position Page content heading")),
|
9 |
+
array("value"=>"cart_sidebar","label"=>Mage::helper('core')->__("Position Cart sidebar")),
|
10 |
+
array("value"=>"wishlist_sidebar","label"=>Mage::helper('core')->__("Position Wishlist sidebar")),
|
11 |
+
array("value"=>"right.reports.product.viewed","label"=>Mage::helper('core')->__("Position Right product viewed")),
|
12 |
+
array("value"=>"right.reports.product.compared","label"=>Mage::helper('core')->__("Position Right product compared")),
|
13 |
+
/*array("value"=>"right.permanent.callout","label"=>Mage::helper('core')->__("Position Right permanent callout")),*/
|
14 |
+
array("value"=>"right.poll","label"=>Mage::helper('core')->__("Position Right poll")),
|
15 |
+
array("value"=>"right","label"=>Mage::helper('core')->__("Position Right")),
|
16 |
+
array("value"=>"left","label"=>Mage::helper('core')->__("Position Left")),
|
17 |
+
array("value"=>"bottom.container","label"=>Mage::helper('core')->__("Position Bottom container")),
|
18 |
+
);
|
19 |
+
|
20 |
+
return $return;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
app/code/community/Feedaty/Badge/Model/StyleProduct.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Model_StyleProduct
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$data = Feedaty_Badge_Model_WebService::_get_FeedatyData();
|
7 |
+
|
8 |
+
foreach ($data as $k=>$v) {
|
9 |
+
if ($v['type'] == "product")
|
10 |
+
$return[] = array('value'=>$k,'label'=>' <img src="'.$v['thumb'].'"><br />');
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
return $return;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
app/code/community/Feedaty/Badge/Model/StyleStore.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_Model_StyleStore
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$data = Feedaty_Badge_Model_WebService::_get_FeedatyData();
|
7 |
+
|
8 |
+
foreach ($data as $k=>$v) {
|
9 |
+
if ($v['type'] == "merchant")
|
10 |
+
$return[] = array('value'=>$k,'label'=>' <img src="'.$v['thumb'].'"><br />');
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
return $return;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
app/code/community/Feedaty/Badge/Model/WebService.php
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Feedaty_Badge_Model_WebService {
|
4 |
+
// Fetch all reviews and info about badge
|
5 |
+
|
6 |
+
|
7 |
+
public function retrive_informations_product($id) {
|
8 |
+
$cache = Mage::app()->getCache();
|
9 |
+
|
10 |
+
$content = $cache->load("feedaty_product_".$id.(int) FEEDATY_DEBUG);
|
11 |
+
|
12 |
+
if (!$content || strlen($content) == 0) {
|
13 |
+
$feedaty_code = Mage::getStoreConfig('feedaty_global/feedaty_preferences/feedaty_code');
|
14 |
+
|
15 |
+
$ch = curl_init();
|
16 |
+
if (FEEDATY_DEBUG)
|
17 |
+
$url = 'http://widget.stage.zoorate.com/go.php?function=feed&action=ws&task=product&merchant_code='.$feedaty_code.'&ProductID='.$id.'&language='.Mage::app()->getLocale()->getLocaleCode();
|
18 |
+
else
|
19 |
+
$url = 'http://widget.zoorate.com/go.php?function=feed&action=ws&task=product&merchant_code='.$feedaty_code.'&ProductID='.$id.'&language='.Mage::app()->getLocale()->getLocaleCode();
|
20 |
+
|
21 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
22 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
23 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, '3');
|
24 |
+
$content = trim(curl_exec($ch));
|
25 |
+
curl_close($ch);
|
26 |
+
|
27 |
+
if (strlen($content) > 0)
|
28 |
+
$cache->save($content, "feedaty_product_".$id, array("feedaty_cache"), 3*60*60); // 3 hours of cache
|
29 |
+
}
|
30 |
+
|
31 |
+
$data = json_decode($content,true);
|
32 |
+
|
33 |
+
return $data;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function retrive_informations_store() {
|
37 |
+
$cache = Mage::app()->getCache();
|
38 |
+
|
39 |
+
$content = $cache->load("feedaty_store");
|
40 |
+
|
41 |
+
if (!$content || strlen($content) < 5) {
|
42 |
+
$feedaty_code = Mage::getStoreConfig('feedaty_global/feedaty_preferences/feedaty_code');
|
43 |
+
$ch = curl_init();
|
44 |
+
// Recensioni in ordine dalla più recente alla meno
|
45 |
+
if (FEEDATY_DEBUG)
|
46 |
+
$url = 'http://widget.stage.zoorate.com/go.php?function=feed&action=ws&task=merchant&merchant_code='.$feedaty_code;
|
47 |
+
else
|
48 |
+
$url = 'http://widget.zoorate.com/go.php?function=feed&action=ws&task=merchant&merchant_code='.$feedaty_code;
|
49 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
50 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
51 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, '3');
|
52 |
+
$content = trim(curl_exec($ch));
|
53 |
+
curl_close($ch);
|
54 |
+
if (strlen($content) > 0)
|
55 |
+
$cache->save($content, "feedaty_store", array("feedaty_cache"), 3*60*60); // 3 hours of cache
|
56 |
+
}
|
57 |
+
|
58 |
+
$data = json_decode($content,true);
|
59 |
+
|
60 |
+
//print_r($data);
|
61 |
+
|
62 |
+
return $data;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function send_order($data) {
|
66 |
+
$ch = curl_init();
|
67 |
+
if (FEEDATY_DEBUG)
|
68 |
+
$url = 'http://stage.zoorate.com/ws/feedatyapi.svc/SubmitOrders';
|
69 |
+
else
|
70 |
+
$url = 'http://www.zoorate.com/ws/feedatyapi.svc/SubmitOrders';
|
71 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
72 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
73 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, '60');
|
74 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
75 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($data));
|
76 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: application/json'));
|
77 |
+
curl_setopt($ch, CURLOPT_HEADER, 1);
|
78 |
+
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
79 |
+
$content = trim(curl_exec($ch));
|
80 |
+
curl_close($ch);
|
81 |
+
}
|
82 |
+
|
83 |
+
public function _get_FeedatyData() {
|
84 |
+
$cache = Mage::app()->getCache();
|
85 |
+
|
86 |
+
$content = $cache->load("feedaty_store");
|
87 |
+
|
88 |
+
$feedaty_code = Mage::getStoreConfig('feedaty_global/feedaty_preferences/feedaty_code');
|
89 |
+
|
90 |
+
$content =$cache->load("FeedatyData".$feedaty_code.Mage::app()->getLocale()->getLocaleCode().(int) FEEDATY_DEBUG);
|
91 |
+
|
92 |
+
if (!$content || strlen($content) == 0) {
|
93 |
+
$ch = curl_init();
|
94 |
+
if (FEEDATY_DEBUG)
|
95 |
+
$url = 'http://widget.stage.zoorate.com/go.php?function=feed_be&action=widget_list&merchant_code='.$feedaty_code.'&language='.Mage::app()->getLocale()->getLocaleCode();
|
96 |
+
else
|
97 |
+
$url = 'http://widget.zoorate.com/go.php?function=feed_be&action=widget_list&merchant_code='.$feedaty_code.'&language='.Mage::app()->getLocale()->getLocaleCode();
|
98 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
99 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
100 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, '60');
|
101 |
+
$content = trim(curl_exec($ch));
|
102 |
+
curl_close($ch);
|
103 |
+
|
104 |
+
$cache->save($content, "FeedatyData".$feedaty_code.Mage::app()->getLocale()->getLocaleCode().(int) FEEDATY_DEBUG, array("feedaty_cache"), 24*60*60); // 24 hours of cache
|
105 |
+
}
|
106 |
+
|
107 |
+
$data = json_decode($content,true);
|
108 |
+
|
109 |
+
return $data;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function send_notification() {
|
113 |
+
$cache = Mage::app()->getCache();
|
114 |
+
|
115 |
+
$content = $cache->load("feedaty_notification");
|
116 |
+
|
117 |
+
$cnt = Mage::getStoreConfig('feedaty_global/feedaty_preferences/feedaty_code')."-".Mage::getStoreConfig('feedaty_badge_options/widget_store/enabled')."-".Mage::getStoreConfig('feedaty_badge_options/widget_products/product_enabled');
|
118 |
+
|
119 |
+
if (1==1 || $content != $cnt) {
|
120 |
+
$store = Mage::app()->getStore();
|
121 |
+
|
122 |
+
$ver = json_decode(json_encode(Mage::getConfig()->getNode()->modules->Feedaty_Badge->version),true);
|
123 |
+
|
124 |
+
$fdata['keyValuePairs'][] = array("Key" => "Platform", "Value" => "Magento ".MAGE::getVersion());
|
125 |
+
$fdata['keyValuePairs'][] = array("Key" => "Version", "Value" => $ver[0]);
|
126 |
+
$fdata['keyValuePairs'][] = array("Key" => "Url", "Value" => Mage::getBaseUrl());
|
127 |
+
$fdata['keyValuePairs'][] = array("Key" => "Os", "Value" => PHP_OS);
|
128 |
+
$fdata['keyValuePairs'][] = array("Key" => "Php Version", "Value" => phpversion());
|
129 |
+
$fdata['keyValuePairs'][] = array("Key" => "Name", "Value" => $store->getName());
|
130 |
+
$fdata['keyValuePairs'][] = array("Key" => "Action", "Value" => "Enabled");
|
131 |
+
$fdata['keyValuePairs'][] = array("Key" => "Position_Merchant", "Value" => Mage::getStoreConfig('feedaty_badge_options/widget_store/store_position'));
|
132 |
+
$fdata['keyValuePairs'][] = array("Key" => "Position_Product", "Value" => Mage::getStoreConfig('feedaty_badge_options/widget_products/product_position'));
|
133 |
+
|
134 |
+
$fdata['merchantCode'] = Mage::getStoreConfig('feedaty_global/feedaty_preferences/feedaty_code');
|
135 |
+
|
136 |
+
$ch = curl_init();
|
137 |
+
|
138 |
+
if (FEEDATY_DEBUG)
|
139 |
+
$url = 'http://stage.zoorate.com/ws/feedatyapi.svc/SetKeyValue';
|
140 |
+
else
|
141 |
+
$url = 'http://www.zoorate.com/ws/feedatyapi.svc/SetKeyValue';
|
142 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
143 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
144 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, '60');
|
145 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
146 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($fdata));
|
147 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: application/json','Expect:'));
|
148 |
+
curl_setopt($ch, CURLOPT_HEADER, 1);
|
149 |
+
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
150 |
+
$content = trim(curl_exec($ch));
|
151 |
+
curl_close($ch);
|
152 |
+
|
153 |
+
$cache->save($cnt, "feedaty_notification", array("feedaty_cache"), 31*24*60*60);
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
app/code/community/Feedaty/Badge/controllers/Adminhtml/Badge.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Excellence_Employee_Adminhtml_EmployeeController extends Mage_Adminhtml_Controller_action
|
3 |
+
{
|
4 |
+
|
5 |
+
public function indexAction() {
|
6 |
+
$this->loadLayout();
|
7 |
+
$this->renderLayout();
|
8 |
+
}
|
9 |
+
|
10 |
+
}
|
app/code/community/Feedaty/Badge/controllers/IndexController.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Feedaty_Badge_IndexController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction() {
|
5 |
+
|
6 |
+
header("Cache-Control: public");
|
7 |
+
header("Content-Description: File Transfer");
|
8 |
+
header("Content-Disposition: attachment; filename=feedatyexport.csv");
|
9 |
+
header("Content-Transfer-Encoding: binary");
|
10 |
+
|
11 |
+
$csv = '"Order ID","UserID","E-mail","Date","Product ID","Extra","Product Url","Product Image","Platform"'."\n";
|
12 |
+
|
13 |
+
$orders = Mage::getModel('sales/order')->getCollection()
|
14 |
+
->addFieldToFilter('status', Mage::getStoreConfig('feedaty_global/sendorder/sendorder'))
|
15 |
+
;
|
16 |
+
|
17 |
+
foreach ($orders as $order) {
|
18 |
+
|
19 |
+
$objproducts = $order->getAllItems();
|
20 |
+
|
21 |
+
foreach ($objproducts as $itemId => $item) {
|
22 |
+
$fd_oProduct = Mage::getModel('catalog/product')->load((int) $item->getProductId());
|
23 |
+
Mage::getModel('core/url_rewrite')->loadByRequestPath(
|
24 |
+
$tmp['Url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$fd_oProduct->getUrlPath()
|
25 |
+
);
|
26 |
+
if ($fd_oProduct->getImage() != "no_selection")
|
27 |
+
$tmp['ImageUrl'] = Mage::getModel('catalog/product_media_config')->getMediaUrl( $fd_oProduct->getImage() );
|
28 |
+
else
|
29 |
+
$tmp['ImageUrl'] = "";
|
30 |
+
|
31 |
+
$csv .= '"'.$order->getId().'","'.$order->getBillingAddress()->getEmail().'","'.$order->getBillingAddress()->getEmail().'",'
|
32 |
+
.'"'.$order->getCreatedAt().'","'.$item->getProductId().'","'.str_replace('"','""',$item->getName()).'","'.$tmp['Url'].'","'.$tmp['ImageUrl'].'","Magento '.MAGE::getVersion().'"'
|
33 |
+
."\n";
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
echo $csv;
|
38 |
+
}
|
39 |
+
}
|
app/code/community/Feedaty/Badge/etc/adminhtml.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<feedaty translate="title" module="feedaty">
|
12 |
+
<title>Feedaty</title>
|
13 |
+
</feedaty>
|
14 |
+
</children>
|
15 |
+
</config>
|
16 |
+
</children>
|
17 |
+
</system>
|
18 |
+
</children>
|
19 |
+
</admin>
|
20 |
+
</resources>
|
21 |
+
</acl>
|
22 |
+
</config>
|
app/code/community/Feedaty/Badge/etc/config.xml
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Feedaty_Badge>
|
5 |
+
<version>0.0.1</version>
|
6 |
+
</Feedaty_Badge>
|
7 |
+
</modules>
|
8 |
+
<admin>
|
9 |
+
<routers>
|
10 |
+
<exportcsvfeedaty>
|
11 |
+
<use>admin</use>
|
12 |
+
<args>
|
13 |
+
<module>Feedaty_Badge</module>
|
14 |
+
<frontName>feedatyexport.csv</frontName>
|
15 |
+
</args>
|
16 |
+
</exportcsvfeedaty>
|
17 |
+
</routers>
|
18 |
+
</admin>
|
19 |
+
<global>
|
20 |
+
<helpers>
|
21 |
+
<badge>
|
22 |
+
<class>Feedaty_Badge_Helper</class>
|
23 |
+
</badge>
|
24 |
+
</helpers>
|
25 |
+
<blocks>
|
26 |
+
<badge>
|
27 |
+
<class>Feedaty_Badge_Block</class>
|
28 |
+
</badge>
|
29 |
+
</blocks>
|
30 |
+
<models>
|
31 |
+
<badge>
|
32 |
+
<class>Feedaty_Badge_Model</class>
|
33 |
+
</badge>
|
34 |
+
<webservice>
|
35 |
+
<class>Feedaty_WebService_Model</class>
|
36 |
+
</webservice>
|
37 |
+
</models>
|
38 |
+
<events>
|
39 |
+
<sales_order_save_after>
|
40 |
+
<observers>
|
41 |
+
<feedaty_badget_observe>
|
42 |
+
<type>singleton</type>
|
43 |
+
<class>badge/observe</class>
|
44 |
+
<method>intercept_order</method>
|
45 |
+
</feedaty_badget_observe>
|
46 |
+
</observers>
|
47 |
+
</sales_order_save_after>
|
48 |
+
</events>
|
49 |
+
</global>
|
50 |
+
<adminhtml>
|
51 |
+
<acl>
|
52 |
+
<resources>
|
53 |
+
<admin>
|
54 |
+
<children>
|
55 |
+
<system>
|
56 |
+
<children>
|
57 |
+
<config>
|
58 |
+
<children>
|
59 |
+
<feedaty_badge_options>
|
60 |
+
<title>Feedaty Configuration</title>
|
61 |
+
</feedaty_badge_options>
|
62 |
+
<feedaty_global>
|
63 |
+
<title>Feedaty preferences</title>
|
64 |
+
</feedaty_global>
|
65 |
+
</children>
|
66 |
+
</config>
|
67 |
+
</children>
|
68 |
+
</system>
|
69 |
+
</children>
|
70 |
+
</admin>
|
71 |
+
</resources>
|
72 |
+
</acl>
|
73 |
+
</adminhtml>
|
74 |
+
<default>
|
75 |
+
<badge_options>
|
76 |
+
<general translate="general" module="badge">
|
77 |
+
<color>light</color>
|
78 |
+
<style>padding-top: 20px;</style>
|
79 |
+
<disable_fb_like>0</disable_fb_like>
|
80 |
+
<disable_twitter>0</disable_twitter>
|
81 |
+
<disable_comments>0</disable_comments>
|
82 |
+
<disable_plusone>0</disable_plusone>
|
83 |
+
</general>
|
84 |
+
<fb_comments translate="Facebook comments" module="badge">
|
85 |
+
<width>525</width>
|
86 |
+
<number>10</number>
|
87 |
+
</fb_comments>
|
88 |
+
<twitter translate="Facebook comments" module="badge">
|
89 |
+
<text>Check it out!</text>
|
90 |
+
</twitter>
|
91 |
+
</badge_options>
|
92 |
+
</default>
|
93 |
+
<frontend>
|
94 |
+
<translate>
|
95 |
+
<modules>
|
96 |
+
<translations>
|
97 |
+
<files>
|
98 |
+
<default>Feedaty.csv</default>
|
99 |
+
</files>
|
100 |
+
</translations>
|
101 |
+
</modules>
|
102 |
+
</translate>
|
103 |
+
<events>
|
104 |
+
<core_block_abstract_to_html_after>
|
105 |
+
<observers>
|
106 |
+
<product_badge>
|
107 |
+
<type>singleton</type>
|
108 |
+
<class>badge/generate</class>
|
109 |
+
<method>product_badge</method>
|
110 |
+
</product_badge>
|
111 |
+
<product_reviews>
|
112 |
+
<type>singleton</type>
|
113 |
+
<class>badge/generate</class>
|
114 |
+
<method>product_reviews</method>
|
115 |
+
</product_reviews>
|
116 |
+
<store_badge>
|
117 |
+
<type>singleton</type>
|
118 |
+
<class>badge/generate</class>
|
119 |
+
<method>store_badge</method>
|
120 |
+
</store_badge>
|
121 |
+
</observers>
|
122 |
+
</core_block_abstract_to_html_after>
|
123 |
+
</events>
|
124 |
+
</frontend>
|
125 |
+
<adminhtml>
|
126 |
+
<translate>
|
127 |
+
<modules>
|
128 |
+
<translations>
|
129 |
+
<files>
|
130 |
+
<default>Feedaty.csv</default>
|
131 |
+
</files>
|
132 |
+
</translations>
|
133 |
+
</modules>
|
134 |
+
</translate>
|
135 |
+
</adminhtml>
|
136 |
+
</config>
|
app/code/community/Feedaty/Badge/etc/system.xml
ADDED
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<!-- <tabs> -->
|
3 |
+
<!-- <beesocial_config translate="label" module="beesocial"> -->
|
4 |
+
<!-- <label>Beetailer</label> -->
|
5 |
+
<!-- <sort_order>99999</sort_order> -->
|
6 |
+
<!-- </beesocial_config> -->
|
7 |
+
<!-- </tabs> -->
|
8 |
+
<tabs>
|
9 |
+
<feedaty>
|
10 |
+
<label>Feedaty</label>
|
11 |
+
<sort_order>195</sort_order>
|
12 |
+
</feedaty>
|
13 |
+
</tabs>
|
14 |
+
<sections>
|
15 |
+
<feedaty_badge_options translate="label" module="badge">
|
16 |
+
<label>Widget preferences</label>
|
17 |
+
<tab>feedaty</tab>
|
18 |
+
<frontend_type>text</frontend_type>
|
19 |
+
<sort_order>1000</sort_order>
|
20 |
+
<show_in_default>1</show_in_default>
|
21 |
+
<show_in_website>1</show_in_website>
|
22 |
+
<show_in_store>1</show_in_store>
|
23 |
+
<groups>
|
24 |
+
<widget_store translate="label source_model">
|
25 |
+
<label>Widget store</label>
|
26 |
+
<frontend_type>text</frontend_type>
|
27 |
+
<sort_order>0</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>1</show_in_store>
|
31 |
+
<fields>
|
32 |
+
<enabled>
|
33 |
+
<label>Enabled</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
36 |
+
<sort_order>1</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
</enabled>
|
41 |
+
<badge_style>
|
42 |
+
<label>Style</label>
|
43 |
+
<frontend_type>radios</frontend_type>
|
44 |
+
<source_model>Feedaty_Badge_Model_StyleStore</source_model>
|
45 |
+
<sort_order>2</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
</badge_style>
|
50 |
+
<store_position>
|
51 |
+
<label>Position</label>
|
52 |
+
<frontend_type>select</frontend_type>
|
53 |
+
<source_model>Feedaty_Badge_Model_PositionStore</source_model>
|
54 |
+
<sort_order>4</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</store_position>
|
59 |
+
</fields>
|
60 |
+
</widget_store>
|
61 |
+
<widget_products translate="label">
|
62 |
+
<label>Widget products</label>
|
63 |
+
<frontend_type>text</frontend_type>
|
64 |
+
<sort_order>2</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
<fields>
|
69 |
+
<product_enabled>
|
70 |
+
<label>Enabled</label>
|
71 |
+
<frontend_type>select</frontend_type>
|
72 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
73 |
+
<sort_order>1</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
</product_enabled>
|
78 |
+
<badge_style>
|
79 |
+
<label>Style</label>
|
80 |
+
<frontend_type>radios</frontend_type>
|
81 |
+
<source_model>Feedaty_Badge_Model_StyleProduct</source_model>
|
82 |
+
<sort_order>2</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
<show_in_website>1</show_in_website>
|
85 |
+
<show_in_store>1</show_in_store>
|
86 |
+
</badge_style>
|
87 |
+
<product_position>
|
88 |
+
<label>Position</label>
|
89 |
+
<frontend_type>select</frontend_type>
|
90 |
+
<source_model>Feedaty_Badge_Model_PositionProduct</source_model>
|
91 |
+
<sort_order>4</sort_order>
|
92 |
+
<show_in_default>1</show_in_default>
|
93 |
+
<show_in_website>1</show_in_website>
|
94 |
+
<show_in_store>1</show_in_store>
|
95 |
+
</product_position>
|
96 |
+
</fields>
|
97 |
+
</widget_products>
|
98 |
+
<review_products translate="label">
|
99 |
+
<label>Review products</label>
|
100 |
+
<frontend_type>text</frontend_type>
|
101 |
+
<sort_order>3</sort_order>
|
102 |
+
<show_in_default>1</show_in_default>
|
103 |
+
<show_in_website>1</show_in_website>
|
104 |
+
<show_in_store>1</show_in_store>
|
105 |
+
<fields>
|
106 |
+
<product_enabled>
|
107 |
+
<label>Enabled</label>
|
108 |
+
<frontend_type>select</frontend_type>
|
109 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
110 |
+
<sort_order>1</sort_order>
|
111 |
+
<show_in_default>1</show_in_default>
|
112 |
+
<show_in_website>1</show_in_website>
|
113 |
+
<show_in_store>1</show_in_store>
|
114 |
+
</product_enabled>
|
115 |
+
<count_review>
|
116 |
+
<label>Number of reviews</label>
|
117 |
+
<frontend_type>text</frontend_type>
|
118 |
+
<sort_order>3</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>1</show_in_store>
|
122 |
+
<validate>validate-number</validate>
|
123 |
+
</count_review>
|
124 |
+
<order_review>
|
125 |
+
<label>Order</label>
|
126 |
+
<frontend_type>select</frontend_type>
|
127 |
+
<source_model>Feedaty_Badge_Model_Order</source_model>
|
128 |
+
<sort_order>4</sort_order>
|
129 |
+
<show_in_default>1</show_in_default>
|
130 |
+
<show_in_website>1</show_in_website>
|
131 |
+
<show_in_store>1</show_in_store>
|
132 |
+
</order_review>
|
133 |
+
<product_position>
|
134 |
+
<label>Position</label>
|
135 |
+
<frontend_type>select</frontend_type>
|
136 |
+
<source_model>Feedaty_Badge_Model_PositionProduct</source_model>
|
137 |
+
<sort_order>10</sort_order>
|
138 |
+
<show_in_default>1</show_in_default>
|
139 |
+
<show_in_website>1</show_in_website>
|
140 |
+
<show_in_store>1</show_in_store>
|
141 |
+
</product_position>
|
142 |
+
</fields>
|
143 |
+
</review_products>
|
144 |
+
</groups>
|
145 |
+
</feedaty_badge_options>
|
146 |
+
<feedaty_global translate="label" module="badge">
|
147 |
+
<label>Feedaty preferences</label>
|
148 |
+
<tab>feedaty</tab>
|
149 |
+
<frontend_type>text</frontend_type>
|
150 |
+
<sort_order>1000</sort_order>
|
151 |
+
<show_in_default>1</show_in_default>
|
152 |
+
<show_in_website>1</show_in_website>
|
153 |
+
<show_in_store>1</show_in_store>
|
154 |
+
<groups>
|
155 |
+
<feedaty_preferences translate="label">
|
156 |
+
<label>Feedaty</label>
|
157 |
+
<frontend_type>text</frontend_type>
|
158 |
+
<sort_order>2</sort_order>
|
159 |
+
<show_in_default>1</show_in_default>
|
160 |
+
<show_in_website>1</show_in_website>
|
161 |
+
<show_in_store>1</show_in_store>
|
162 |
+
<fields>
|
163 |
+
<feedaty_code>
|
164 |
+
<label>Feedaty code</label>
|
165 |
+
<frontend_type>text</frontend_type>
|
166 |
+
<sort_order>1</sort_order>
|
167 |
+
<show_in_default>1</show_in_default>
|
168 |
+
<show_in_website>0</show_in_website>
|
169 |
+
<show_in_store>0</show_in_store>
|
170 |
+
<validate>validate-number</validate>
|
171 |
+
</feedaty_code>
|
172 |
+
</fields>
|
173 |
+
</feedaty_preferences>
|
174 |
+
<sendorder translate="label source_model">
|
175 |
+
<label>Order options</label>
|
176 |
+
<frontend_type>select</frontend_type>
|
177 |
+
<sort_order>20</sort_order>
|
178 |
+
<show_in_default>1</show_in_default>
|
179 |
+
<show_in_website>1</show_in_website>
|
180 |
+
<show_in_store>1</show_in_store>
|
181 |
+
<fields>
|
182 |
+
<sendorder>
|
183 |
+
<label>Status</label>
|
184 |
+
<frontend_type>select</frontend_type>
|
185 |
+
<source_model>Feedaty_Badge_Model_OrderStatuses</source_model>
|
186 |
+
<sort_order>2</sort_order>
|
187 |
+
<show_in_default>1</show_in_default>
|
188 |
+
<show_in_website>1</show_in_website>
|
189 |
+
<show_in_store>1</show_in_store>
|
190 |
+
</sendorder>
|
191 |
+
</fields>
|
192 |
+
</sendorder>
|
193 |
+
<export translate="label source_model">
|
194 |
+
<label>Initial orders export</label>
|
195 |
+
<frontend_type>select</frontend_type>
|
196 |
+
<sort_order>30</sort_order>
|
197 |
+
<show_in_default>1</show_in_default>
|
198 |
+
<show_in_website>0</show_in_website>
|
199 |
+
<show_in_store>0</show_in_store>
|
200 |
+
<fields>
|
201 |
+
<exportbutton>
|
202 |
+
<label>Export to csv</label>
|
203 |
+
<frontend_type>button</frontend_type>
|
204 |
+
<frontend_model>Feedaty_Badge_Block_LinkCsv</frontend_model>
|
205 |
+
<sort_order>11</sort_order>
|
206 |
+
<show_in_default>1</show_in_default>
|
207 |
+
<show_in_website>1</show_in_website>
|
208 |
+
<show_in_store>1</show_in_store>
|
209 |
+
</exportbutton>
|
210 |
+
</fields>
|
211 |
+
</export>
|
212 |
+
</groups>
|
213 |
+
</feedaty_global>
|
214 |
+
</sections>
|
215 |
+
</config>
|
app/code/community/Feedaty/Badge/etc/widget.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<widgets>
|
3 |
+
<badge_product_reviews type="badge/product_reviews">
|
4 |
+
<name>Feedaty Widget Product</name>
|
5 |
+
<description type="desc">Adds the Feedaty Widget for Products</description>
|
6 |
+
</badge_product_reviews>
|
7 |
+
</widgets>
|
app/design/frontend/default/default/layout/Feedaty.xml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<catalog_product_view>
|
4 |
+
<reference name="product.info">
|
5 |
+
<block type="feedaty/base" name="feedaty_base">
|
6 |
+
<action method="setTemplate">
|
7 |
+
<template>feedaty/base.phtml</template>
|
8 |
+
</action>
|
9 |
+
</block>
|
10 |
+
</reference>
|
11 |
+
</catalog_product_view>
|
12 |
+
</layout>
|
app/design/frontend/default/default/template/feedaty/base.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $view = $this->getView();
|
2 |
+
|
3 |
+
$view['generated'] = str_replace("{rate}",$view['rate'],$view['generated']);
|
4 |
+
?>
|
5 |
+
<?php echo $generated; ?>
|
app/design/frontend/default/default/template/feedaty/product_reviews.phtml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="box-collateral box-reviews" id="customer-reviews">
|
2 |
+
<h2><?php echo $this->__('Customer Reviews') ?></h2>
|
3 |
+
<dl>
|
4 |
+
|
5 |
+
<?php $view = $this->getView(); ?>
|
6 |
+
<?php foreach ($view['data_review']['Feedbacks'] as $k=>$r) { ?>
|
7 |
+
<!-- start here -->
|
8 |
+
<dt>
|
9 |
+
<?php //echo $this->__('Review by <span>%s</span>', $this->htmlEscape("ugo")) ?>
|
10 |
+
</dt>
|
11 |
+
<dd>
|
12 |
+
<table class="ratings-table">
|
13 |
+
<col width="1" />
|
14 |
+
<col />
|
15 |
+
<tbody>
|
16 |
+
|
17 |
+
<tr>
|
18 |
+
<th></th>
|
19 |
+
<td>
|
20 |
+
<div class="rating-box">
|
21 |
+
<div class="rating" style="width:<?php echo $r['ProductRating']*20?>%;"></div>
|
22 |
+
</div>
|
23 |
+
</td>
|
24 |
+
</tr>
|
25 |
+
|
26 |
+
</tbody>
|
27 |
+
</table>
|
28 |
+
<?php echo $r['ProductReview']; ?>
|
29 |
+
</dd>
|
30 |
+
<!-- end here -->
|
31 |
+
<?php } ?>
|
32 |
+
</dl>
|
33 |
+
<?php echo $view['link']; ?>
|
34 |
+
</div>
|
app/etc/modules/Feedaty_Badge.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Feedaty_Badge>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Feedaty_Badge>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/it_IT/Feedaty.csv
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Style","Stile"
|
2 |
+
"Enabled Review","Recensioni attive"
|
3 |
+
"Widget products","Widget nella scheda prodotto"
|
4 |
+
"Widget preferences","Configurazione widget"
|
5 |
+
"Feedaty code","Codice Feedaty"
|
6 |
+
"Feedaty preferences","Configurazione Feedaty"
|
7 |
+
"Review products","Recensioni nella scheda prodotto"
|
8 |
+
"Newest reviews first","Recensioni recenti prima"
|
9 |
+
"Old reviews first","Recensioni vecchie prima"
|
10 |
+
"Position Cms page","Posizione contenuto"
|
11 |
+
"Position Page content heading","Posizione intestazione contenuto"
|
12 |
+
"Position Cart sidebar","Posizione barra carrello"
|
13 |
+
"Position Wishlist sidebar",Posizione barra lista dei desideri"
|
14 |
+
"Position Right product viewed","Posizione prodotti visti"
|
15 |
+
"Position Right product compared","Posizione prodotti comparati"
|
16 |
+
"Position Right poll","Posizione sondaggio"
|
17 |
+
"Position Right","Posizione destra"
|
18 |
+
"Position Left","Posizione sinistra"
|
19 |
+
"Position Bottom container","Posizione pie di pagina"
|
20 |
+
"Number of reviews","Numero di recensioni"
|
21 |
+
"After Content","Posizione contenuto"
|
22 |
+
"Product Related","Posizione prodotti collegati"
|
23 |
+
"After Price","Posizione prezzo"
|
24 |
+
"After Stock Informations","Posizione inventario"
|
25 |
+
"Simple","Posizione simple"
|
26 |
+
"Extra child","Posizione extra"
|
27 |
+
"Add to cart","Posizione aggiungi al carrello"
|
28 |
+
"Product description","Posizione descrizione"
|
29 |
+
"Product attributes","Posizione attributi"
|
30 |
+
"Product upsell","Posizione prodotti simili"
|
31 |
+
"Product additional","Posizione informazioni addizionali"
|
32 |
+
"Product tag list","Posizione tag dei prodotti"
|
33 |
+
"Order options","Opzioni notifica ordine"
|
34 |
+
"Initial orders export","Esportazione ordini precedenti"
|
35 |
+
"Export to csv","Esporta in csv"
|
36 |
+
"Save now","Salva ora"
|
37 |
+
"Leggi tutte le recensioni","Leggi tutte le recensioni 111"
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>feedaty</name>
|
4 |
+
<version>1.1.13</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Feedaty Widget</summary>
|
10 |
+
<description>Feedaty is a social commerce site dedicated to online stores for the professional management of customer feedback. The service is provided through a platform Saas (Software as a Service) and may be activated quickly and easily through a short integration process.</description>
|
11 |
+
<notes>First official relase</notes>
|
12 |
+
<authors><author><name>Feedaty</name><user>feedtest</user><email>info@feedaty.com</email></author></authors>
|
13 |
+
<date>2013-06-18</date>
|
14 |
+
<time>15:40:55</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Feedaty"><dir name="Badge"><dir name="Block"><file name="LinkCsv.php" hash="92bf7932d32914adcc1b9547b59c7d49"/><file name="Product.php" hash="d896175131b871bf7f309e57ef5099dd"/></dir><dir name="Helper"><file name="Data.php" hash="51386589a569b1e52baa7f30f07a946b"/></dir><dir name="Model"><file name="Generate.php" hash="695aad4e2cedaa0dd4bf7435df66d6f6"/><file name="Observe.php" hash="45794a85aed6fc242f164731fb031ab3"/><file name="Order.php" hash="ad5588401fb34ee4e081c7e27bc2b694"/><file name="OrderStatuses.php" hash="c122ad1e6360bd53bc3598c4c3046a02"/><file name="PositionProduct.php" hash="5ed4224b515770f1b2f794a039f6d6c5"/><file name="PositionStore.php" hash="9f3b948fd1046a2b428d51fe51f72778"/><file name="StyleProduct.php" hash="e306b9889e6f5d15bd3db729bf158eda"/><file name="StyleStore.php" hash="612898c7f347753f21a761c2addd7cd0"/><file name="WebService.php" hash="9e63c9e84abe9d264bf8f832227115b2"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="Badge.php" hash="5b9815ddacd49bdac7f4f3450621759b"/></dir><file name="IndexController.php" hash="3331c66c765ea34e2b2f341e06ea4622"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dfb3514a624955eb430780b923f10fb0"/><file name="config.xml" hash="37832ca12efdd22638277d45f76c4e2b"/><file name="system.xml" hash="ecf35eb131cba17fb4bcff37497efa3c"/><file name="widget.xml" hash="f2b00c74bc9a0e7690be5cbe474efb47"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="Feedaty.xml" hash="eff88446ec32cc43a30a6c54a6f4937a"/></dir><dir name="template"><dir name="feedaty"><file name="base.phtml" hash="0009ab0914e8cb8ab1f3461ff2d6822b"/><file name="product_reviews.phtml" hash="f0978d0158078ab72ab1bad86b1a3933"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="it_IT"><file name="Feedaty.csv" hash="4d219cae9bc37e462c9604c475833adf"/></dir></target><target name="mageetc"><dir name="modules"><file name="Feedaty_Badge.xml" hash="e4e47863d6724079e09a6d4d53152275"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>4.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|