Version Notes
1.2.0
Download this release
Release Info
| Developer | EcomwiseTeam |
| Extension | Ecomwise_BestsellerSidebarFree |
| Version | 1.2.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.2.0
- app/code/community/Ecomwise/Base/Model/ExtensionsLicencer/Observer.php +1 -13
- app/code/community/Ecomwise/Base/etc/config.xml +1 -1
- app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Abstract.php +90 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Adminhtml/Support.php +20 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Bestsellers.php +1 -100
- app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Widget.php +5 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/Helper/Data.php +0 -1
- app/code/community/Ecomwise/FreeBestsellerssidebar/etc/config.xml +5 -1
- app/code/community/Ecomwise/FreeBestsellerssidebar/etc/system.xml +23 -23
- app/code/community/Ecomwise/FreeBestsellerssidebar/etc/widget.xml +21 -0
- app/design/adminhtml/default/default/template/freebestsellerssidebar/support.phtml +54 -0
- app/design/frontend/base/default/layout/freebestsellerssidebar.xml +2 -2
- app/design/frontend/base/default/template/freebestsellerssidebar/freebestsellerssidebar.phtml +53 -84
- app/locale/en_US/Ecomwise_FreeBestsellerssidebar.csv +3 -0
- package.xml +5 -5
- skin/adminhtml/default/default/images/ecomwise/extensions_logo.png +0 -0
- skin/frontend/base/default/freebestsellerssidebar/css/style.css +4 -0
app/code/community/Ecomwise/Base/Model/ExtensionsLicencer/Observer.php
CHANGED
|
@@ -158,19 +158,7 @@ class Ecomwise_Base_Model_ExtensionsLicencer_Observer {
|
|
| 158 |
}
|
| 159 |
|
| 160 |
private function getIpAddress(){
|
| 161 |
-
|
| 162 |
-
foreach ($ip_keys as $key){
|
| 163 |
-
if (array_key_exists($key, $_SERVER) === true){
|
| 164 |
-
foreach (explode(',', $_SERVER[$key]) as $ip){
|
| 165 |
-
$ip = trim($ip);
|
| 166 |
-
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false){
|
| 167 |
-
return $ip;
|
| 168 |
-
}
|
| 169 |
-
}
|
| 170 |
-
}
|
| 171 |
-
}
|
| 172 |
-
|
| 173 |
-
return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
|
| 174 |
}
|
| 175 |
|
| 176 |
private function getFrequency(){
|
| 158 |
}
|
| 159 |
|
| 160 |
private function getIpAddress(){
|
| 161 |
+
return isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
}
|
| 163 |
|
| 164 |
private function getFrequency(){
|
app/code/community/Ecomwise/Base/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Ecomwise_Base>
|
| 5 |
-
<version>1.0.
|
| 6 |
</Ecomwise_Base>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Ecomwise_Base>
|
| 5 |
+
<version>1.0.1</version>
|
| 6 |
</Ecomwise_Base>
|
| 7 |
</modules>
|
| 8 |
<global>
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Abstract.php
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Ecomwise_FreeBestsellerssidebar_Block_Abstract extends Mage_Core_Block_Template
|
| 3 |
+
{
|
| 4 |
+
public function getBestsellers()
|
| 5 |
+
{
|
| 6 |
+
$storeId = Mage::app()->getStore()->getStoreId();
|
| 7 |
+
$productsCollection = $this->getProductsCollection();
|
| 8 |
+
return $this->filterConfigurables($productsCollection);
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
private function filterConfigurables($productsCollection)
|
| 12 |
+
{
|
| 13 |
+
|
| 14 |
+
$products = array();
|
| 15 |
+
$products_return = array();
|
| 16 |
+
$products_ids = array();
|
| 17 |
+
|
| 18 |
+
foreach($productsCollection as $product)
|
| 19 |
+
{
|
| 20 |
+
if ($parent_id = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()))
|
| 21 |
+
{
|
| 22 |
+
if(!is_array($parent_id)){
|
| 23 |
+
$parent_id = array($parent_id);
|
| 24 |
+
}
|
| 25 |
+
foreach($parent_id as $par_id){
|
| 26 |
+
$parent = Mage::getModel('catalog/product')->load($par_id);
|
| 27 |
+
if(in_array($parent->getId(), $products_ids))
|
| 28 |
+
{
|
| 29 |
+
$products[$parent->getId()]['qty'] += $this->intQty($product->getOrderedQty());
|
| 30 |
+
}
|
| 31 |
+
else
|
| 32 |
+
{
|
| 33 |
+
$products_ids[] = $parent->getId();
|
| 34 |
+
$products[$parent->getId()]['qty'] = $this->intQty($product->getOrderedQty());
|
| 35 |
+
$products[$parent->getId()]['product'] = $parent;
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
else
|
| 40 |
+
{
|
| 41 |
+
$products[$product->getId()]['qty'] = $this->intQty($product->getOrderedQty());
|
| 42 |
+
$products[$product->getId()] ['product']= Mage::getModel('catalog/product')->load($product->getId());;
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
foreach($products as $product)
|
| 46 |
+
{
|
| 47 |
+
$products_return[] = array($product['qty'],$product['product']);
|
| 48 |
+
}
|
| 49 |
+
arsort($products_return);
|
| 50 |
+
|
| 51 |
+
return $products_return;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
private function getProductsCollection()
|
| 55 |
+
{
|
| 56 |
+
$productCollection = Mage::getResourceModel('reports/product_collection')
|
| 57 |
+
->addOrderedQty()
|
| 58 |
+
->addAttributeToSelect(array('entity_id', 'entity_type_id', 'attribute_set_id', 'type_id', 'sku', 'has_options', 'required_options', 'created_at', 'updated_at'))
|
| 59 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
| 60 |
+
->addStoreFilter(Mage::app()->getStore()->getId())
|
| 61 |
+
->setOrder('ordered_qty', 'desc')
|
| 62 |
+
->setPageSize(3);
|
| 63 |
+
|
| 64 |
+
return $productCollection;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
public function title(){
|
| 68 |
+
return Mage::getStoreConfig('freebestsellerssidebar/parameters/block_title');
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
private function intQty($float)
|
| 72 |
+
{
|
| 73 |
+
return intval($float);
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
protected function _prepareLayout()
|
| 77 |
+
{
|
| 78 |
+
$head = $this->getLayout()->getBlock('head');
|
| 79 |
+
$head->addItem('skin_css', 'freebestsellerssidebar/css/style.css');
|
| 80 |
+
return parent::_prepareLayout();
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
protected function _toHtml() {
|
| 84 |
+
if (!$this->getTemplate() || Mage::getStoreConfig('freebestsellerssidebar/parameters/enabled') == 0 ) {
|
| 85 |
+
return '';
|
| 86 |
+
}
|
| 87 |
+
$html = $this->renderView();
|
| 88 |
+
return $html;
|
| 89 |
+
}
|
| 90 |
+
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Adminhtml/Support.php
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Ecomwise_FreeBestsellerssidebar_Block_Adminhtml_Support extends Mage_Adminhtml_Block_Abstract
|
| 3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
protected $_template = 'freebestsellerssidebar/support.phtml';
|
| 7 |
+
|
| 8 |
+
public $module = 'Ecomwise_FreeBestsellerssidebar';
|
| 9 |
+
public $supportUrl = 'http://support.ecomwise.com/support/tickets/new';
|
| 10 |
+
public $email = 'feedback@ecomwise.com';
|
| 11 |
+
public $faq = 'http://support.ecomwise.com/support/solutions/folders/111251';
|
| 12 |
+
public $name = 'Bestseller Sidebar Free';
|
| 13 |
+
public $compatibility = 'Magento CE 1.7-1.9';
|
| 14 |
+
public $manualUrl = 'http://support.ecomwise.com/support/solutions/articles/69216-bestseller-sidebar';
|
| 15 |
+
|
| 16 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
| 17 |
+
{
|
| 18 |
+
return $this->toHtml();
|
| 19 |
+
}
|
| 20 |
+
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Bestsellers.php
CHANGED
|
@@ -1,108 +1,9 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
-
class Ecomwise_FreeBestsellerssidebar_Block_Bestsellers extends Mage_Core_Block_Template
|
| 4 |
{
|
| 5 |
public function __construct()
|
| 6 |
{
|
| 7 |
parent::__construct();
|
| 8 |
$this->setTemplate('freebestsellerssidebar/freebestsellerssidebar.phtml');
|
| 9 |
}
|
| 10 |
-
|
| 11 |
-
public function getBestsellers()
|
| 12 |
-
{
|
| 13 |
-
$storeId = Mage::app()->getStore()->getStoreId();
|
| 14 |
-
|
| 15 |
-
$productsCollection = $this->getProductsCollection();
|
| 16 |
-
|
| 17 |
-
return $this->filterConfigurables($productsCollection);
|
| 18 |
-
}
|
| 19 |
-
|
| 20 |
-
private function filterConfigurables($productsCollection)
|
| 21 |
-
{
|
| 22 |
-
|
| 23 |
-
$products = array();
|
| 24 |
-
$products_return = array();
|
| 25 |
-
$products_ids = array();
|
| 26 |
-
|
| 27 |
-
foreach($productsCollection as $product)
|
| 28 |
-
{
|
| 29 |
-
if ($parent_id = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()))
|
| 30 |
-
{
|
| 31 |
-
$parent = Mage::getModel('catalog/product')->load($parent_id);
|
| 32 |
-
if(in_array($parent->getId(), $products_ids))
|
| 33 |
-
{
|
| 34 |
-
$products[$parent->getId()]['qty'] += $this->intQty($product->getOrderedQty());
|
| 35 |
-
}
|
| 36 |
-
else
|
| 37 |
-
{
|
| 38 |
-
$products_ids[] = $parent->getId();
|
| 39 |
-
$products[$parent->getId()]['qty'] = $this->intQty($product->getOrderedQty());
|
| 40 |
-
$products[$parent->getId()]['product'] = $parent;
|
| 41 |
-
}
|
| 42 |
-
}
|
| 43 |
-
else
|
| 44 |
-
{
|
| 45 |
-
$products[$product->getId()]['qty'] = $this->intQty($product->getOrderedQty());
|
| 46 |
-
$products[$product->getId()] ['product']= Mage::getModel('catalog/product')->load($product->getId());;
|
| 47 |
-
}
|
| 48 |
-
}
|
| 49 |
-
foreach($products as $product)
|
| 50 |
-
{
|
| 51 |
-
$products_return[] = array($product['qty'],$product['product']);
|
| 52 |
-
}
|
| 53 |
-
arsort($products_return);
|
| 54 |
-
|
| 55 |
-
return $products_return;
|
| 56 |
-
}
|
| 57 |
-
|
| 58 |
-
private function getProductsCollection()
|
| 59 |
-
{
|
| 60 |
-
$productCollection = Mage::getResourceModel('reports/product_collection')
|
| 61 |
-
->addOrderedQty()
|
| 62 |
-
->addAttributeToSelect(array('entity_id', 'entity_type_id', 'attribute_set_id', 'type_id', 'sku', 'has_options', 'required_options', 'created_at', 'updated_at'))
|
| 63 |
-
->setStoreId(Mage::app()->getStore()->getId())
|
| 64 |
-
->addStoreFilter(Mage::app()->getStore()->getId())
|
| 65 |
-
->setOrder('ordered_qty', 'desc')
|
| 66 |
-
->setPageSize(3);
|
| 67 |
-
|
| 68 |
-
return $productCollection;
|
| 69 |
-
}
|
| 70 |
-
|
| 71 |
-
public function title(){
|
| 72 |
-
return Mage::getStoreConfig('freebestsellerssidebar/parameters/block_title');
|
| 73 |
-
}
|
| 74 |
-
|
| 75 |
-
private function intQty($float)
|
| 76 |
-
{
|
| 77 |
-
return intval($float);
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
/**** STYLE AND JAVA SCRIPT ****/
|
| 82 |
-
public function getStyle()
|
| 83 |
-
{
|
| 84 |
-
|
| 85 |
-
$vs_File =Mage::getBaseDir('skin').DS.'freebestsellerssidebar'.DS.'default/style.css';
|
| 86 |
-
|
| 87 |
-
try
|
| 88 |
-
{
|
| 89 |
-
$vs_Skin = file_get_contents($vs_File);
|
| 90 |
-
$vs_Skin = str_replace("[[IMAGES_FOLDER]]", Mage::getBaseUrl('skin').'freebestsellerssidebar/default/images', $vs_Skin);
|
| 91 |
-
|
| 92 |
-
$vs_Skin = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $vs_Skin);
|
| 93 |
-
$vs_Skin = str_replace(array("\t","\n","\r"), '', $vs_Skin);
|
| 94 |
-
}
|
| 95 |
-
catch(Exception $e)
|
| 96 |
-
{
|
| 97 |
-
$vs_Skin = "/*Skin file: $vs_File could not be read*/";
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
-
return trim($vs_Skin);
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
public function getJs()
|
| 104 |
-
{
|
| 105 |
-
return '<script type="text/javascript" src="'.Mage::getBaseUrl('js').'freebestsellerssidebar/freebestsellerssidebar.js"></script>';
|
| 106 |
-
}
|
| 107 |
-
|
| 108 |
}
|
| 1 |
<?php
|
| 2 |
+
class Ecomwise_FreeBestsellerssidebar_Block_Bestsellers extends Ecomwise_FreeBestsellerssidebar_Block_Abstract
|
|
|
|
| 3 |
{
|
| 4 |
public function __construct()
|
| 5 |
{
|
| 6 |
parent::__construct();
|
| 7 |
$this->setTemplate('freebestsellerssidebar/freebestsellerssidebar.phtml');
|
| 8 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Widget.php
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Ecomwise_FreeBestsellerssidebar_Block_Widget extends Ecomwise_FreeBestsellerssidebar_Block_Abstract implements Mage_Widget_Block_Interface
|
| 3 |
+
{
|
| 4 |
+
|
| 5 |
+
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Helper/Data.php
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
class Ecomwise_FreeBestsellerssidebar_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
{
|
| 5 |
|
| 1 |
<?php
|
|
|
|
| 2 |
class Ecomwise_FreeBestsellerssidebar_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
{
|
| 4 |
|
app/code/community/Ecomwise/FreeBestsellerssidebar/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Ecomwise_FreeBestsellerssidebar>
|
| 5 |
-
<version>1.0
|
| 6 |
</Ecomwise_FreeBestsellerssidebar>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
|
@@ -124,6 +124,10 @@
|
|
| 124 |
<style>
|
| 125 |
<skin>default</skin>
|
| 126 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
</freebestsellerssidebar>
|
| 128 |
</default>
|
| 129 |
</config>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Ecomwise_FreeBestsellerssidebar>
|
| 5 |
+
<version>1.2.0</version>
|
| 6 |
</Ecomwise_FreeBestsellerssidebar>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
| 124 |
<style>
|
| 125 |
<skin>default</skin>
|
| 126 |
</style>
|
| 127 |
+
<parameters>
|
| 128 |
+
<enabled>1</enabled>
|
| 129 |
+
<block_title>Best Sellers</block_title>
|
| 130 |
+
</parameters>
|
| 131 |
</freebestsellerssidebar>
|
| 132 |
</default>
|
| 133 |
</config>
|
app/code/community/Ecomwise/FreeBestsellerssidebar/etc/system.xml
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
-
|
| 3 |
<config>
|
| 4 |
<tabs>
|
| 5 |
<ecomwise translate="label">
|
| 6 |
-
<label>
|
| 7 |
<sort_order>100</sort_order>
|
| 8 |
</ecomwise>
|
| 9 |
</tabs>
|
|
@@ -17,41 +16,42 @@
|
|
| 17 |
<show_in_website>1</show_in_website>
|
| 18 |
<show_in_store>1</show_in_store>
|
| 19 |
<groups>
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
<label>Bestseller Sidebar Free</label>
|
| 29 |
<frontend_type>select</frontend_type>
|
| 30 |
-
<frontend_model>freebestsellerssidebar/
|
| 31 |
<sort_order>1</sort_order>
|
| 32 |
<show_in_default>1</show_in_default>
|
| 33 |
<show_in_website>1</show_in_website>
|
| 34 |
<show_in_store>1</show_in_store>
|
| 35 |
-
</
|
| 36 |
-
<disable_ext translate="label">
|
| 37 |
-
<label>Disable</label>
|
| 38 |
-
<frontend_type>select</frontend_type>
|
| 39 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 40 |
-
<sort_order>10</sort_order>
|
| 41 |
-
<show_in_default>1</show_in_default>
|
| 42 |
-
<show_in_website>1</show_in_website>
|
| 43 |
-
<show_in_store>1</show_in_store>
|
| 44 |
-
</disable_ext>
|
| 45 |
</fields>
|
| 46 |
-
|
| 47 |
<parameters translate="label">
|
| 48 |
-
<label>
|
| 49 |
<frontend_type>text</frontend_type>
|
| 50 |
<sort_order>2</sort_order>
|
| 51 |
<show_in_default>1</show_in_default>
|
| 52 |
<show_in_website>1</show_in_website>
|
| 53 |
<show_in_store>1</show_in_store>
|
| 54 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
<block_title translate="label">
|
| 56 |
<label>Block title</label>
|
| 57 |
<frontend_type>text</frontend_type>
|
| 1 |
<?xml version="1.0"?>
|
|
|
|
| 2 |
<config>
|
| 3 |
<tabs>
|
| 4 |
<ecomwise translate="label">
|
| 5 |
+
<label><![CDATA[<div style="position: absolute;"><img id="ecomwise_block" src="" alt="" border="0" /></div> <script>$('ecomwise_block').src = SKIN_URL + "images/ecomwise/extensions_logo.png";</script>]]></label>
|
| 6 |
<sort_order>100</sort_order>
|
| 7 |
</ecomwise>
|
| 8 |
</tabs>
|
| 16 |
<show_in_website>1</show_in_website>
|
| 17 |
<show_in_store>1</show_in_store>
|
| 18 |
<groups>
|
| 19 |
+
<info translate="label">
|
| 20 |
+
<label>Info & Support</label>
|
| 21 |
+
<frontend_type>text</frontend_type>
|
| 22 |
+
<sort_order>1</sort_order>
|
| 23 |
+
<show_in_default>1</show_in_default>
|
| 24 |
+
<show_in_website>1</show_in_website>
|
| 25 |
+
<show_in_store>1</show_in_store>
|
| 26 |
+
<fields>
|
| 27 |
+
<bestseller_version translate="label">
|
| 28 |
<label>Bestseller Sidebar Free</label>
|
| 29 |
<frontend_type>select</frontend_type>
|
| 30 |
+
<frontend_model>freebestsellerssidebar/adminhtml_support</frontend_model>
|
| 31 |
<sort_order>1</sort_order>
|
| 32 |
<show_in_default>1</show_in_default>
|
| 33 |
<show_in_website>1</show_in_website>
|
| 34 |
<show_in_store>1</show_in_store>
|
| 35 |
+
</bestseller_version>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
</fields>
|
| 37 |
+
</info>
|
| 38 |
<parameters translate="label">
|
| 39 |
+
<label>Settings</label>
|
| 40 |
<frontend_type>text</frontend_type>
|
| 41 |
<sort_order>2</sort_order>
|
| 42 |
<show_in_default>1</show_in_default>
|
| 43 |
<show_in_website>1</show_in_website>
|
| 44 |
<show_in_store>1</show_in_store>
|
| 45 |
<fields>
|
| 46 |
+
<enabled translate="label">
|
| 47 |
+
<label>Extension Enabled</label>
|
| 48 |
+
<frontend_type>select</frontend_type>
|
| 49 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 50 |
+
<sort_order>5</sort_order>
|
| 51 |
+
<show_in_default>1</show_in_default>
|
| 52 |
+
<show_in_website>1</show_in_website>
|
| 53 |
+
<show_in_store>1</show_in_store>
|
| 54 |
+
</enabled>
|
| 55 |
<block_title translate="label">
|
| 56 |
<label>Block title</label>
|
| 57 |
<frontend_type>text</frontend_type>
|
app/code/community/Ecomwise/FreeBestsellerssidebar/etc/widget.xml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<widgets>
|
| 3 |
+
<bestseller_widget type="freebestsellerssidebar/widget" translate="name description" module="freebestsellerssidebar">
|
| 4 |
+
<name>Free Bestseller</name>
|
| 5 |
+
<description>Adds a Bestseller block</description>
|
| 6 |
+
<parameters>
|
| 7 |
+
<template translate="label">
|
| 8 |
+
<label>Frontend Template</label>
|
| 9 |
+
<visible>1</visible>
|
| 10 |
+
<required>1</required>
|
| 11 |
+
<type>select</type>
|
| 12 |
+
<values>
|
| 13 |
+
<text translate="label">
|
| 14 |
+
<value>freebestsellerssidebar/freebestsellerssidebar.phtml</value>
|
| 15 |
+
<label>Free Bestseller</label>
|
| 16 |
+
</text>
|
| 17 |
+
</values>
|
| 18 |
+
</template>
|
| 19 |
+
</parameters>
|
| 20 |
+
</bestseller_widget>
|
| 21 |
+
</widgets>
|
app/design/adminhtml/default/default/template/freebestsellerssidebar/support.phtml
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php $_helper = $this->helper('freebestsellerssidebar'); ?>
|
| 2 |
+
<style type="text/css">
|
| 3 |
+
.contentWrap h2{
|
| 4 |
+
font-size:13px;
|
| 5 |
+
padding: 10px 0 4px;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
.contentWrap .version h2, .contentWrap .compatibility h2 {
|
| 9 |
+
float: left;
|
| 10 |
+
width: 200px;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
.contentWrap .installation{
|
| 14 |
+
padding-bottom:20px;
|
| 15 |
+
}
|
| 16 |
+
.contentWrap div{
|
| 17 |
+
padding-bottom:15px;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
.contentWrap div.paragraph{
|
| 21 |
+
padding: 11px 0 4px;
|
| 22 |
+
}
|
| 23 |
+
</style>
|
| 24 |
+
<div class="contentWrap">
|
| 25 |
+
<div>
|
| 26 |
+
<h2><?php echo $_helper->__('Name & Version:');?></h2>
|
| 27 |
+
<p><?php echo $this->name?> <?php echo Mage::getConfig()->getModuleConfig($this->module)->version;?></p>
|
| 28 |
+
</div>
|
| 29 |
+
<div>
|
| 30 |
+
<h2><?php echo $_helper->__('Compatibility:');?></h2>
|
| 31 |
+
<p><?php echo $this->compatibility;?></p>
|
| 32 |
+
</div>
|
| 33 |
+
<div class="documentation">
|
| 34 |
+
<h2><?php echo $_helper->__('Documentation & Installation');?></h2>
|
| 35 |
+
<p><?php echo $_helper->__('Read the installation manual & user guide to help you with the installation and configuration.');?></p>
|
| 36 |
+
<p><?php echo $_helper->__('<a class="pdf" href="'.$this->manualUrl.'" title="Download User Guide" target="'.$this->manualUrl.'">Bestseller Sidebar Free installation & user guide</a>');?></p>
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
<div class="questions">
|
| 40 |
+
<h2><?php echo $_helper->__('Support & Questions?');?></h2>
|
| 41 |
+
<p><?php echo $_helper->__('Visit our %s for more info.','<a href="'.$this->faq.'" target="_blank">FAQ page</a>');?></p>
|
| 42 |
+
<p><?php echo $_helper->__('<a class="support" href="'.$this->supportUrl.'" title="Contact Support" target="_blank">'.$_helper->__('Contact support').'</a>');?></p>
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
+
<div class="about">
|
| 46 |
+
<h2><?php echo $_helper->__('About B2B Extensions');?></h2>
|
| 47 |
+
<p><?php echo $_helper->__('B2B Extensions is a product of %s','<a href="http://www.ecomwise.com/" target="_blank">Ecomwise.com</a>');?></p>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
<div class="mail">
|
| 51 |
+
<h2><?php echo $_helper->__('Do you have Feedback or improvements?');?></h2>
|
| 52 |
+
<p><?php echo $_helper->__('<a href="mailto:'.$this->email.'" target="_blank">Please e-mail us your feedback</a>');?></p>
|
| 53 |
+
</div>
|
| 54 |
+
</div>
|
app/design/frontend/base/default/layout/freebestsellerssidebar.xml
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<layout version="0.1.0">
|
| 3 |
-
<default>
|
| 4 |
<reference name="left">
|
| 5 |
<block type="Ecomwise_FreeBestsellerssidebar/bestsellers"/>
|
| 6 |
</reference>
|
| 7 |
-
</default>
|
| 8 |
<freebestsellerssidebar_index_index>
|
| 9 |
<reference name="content">
|
| 10 |
<block type="Ecomwise_FreeBestsellerssidebar/bestsellers"/>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<layout version="0.1.0">
|
| 3 |
+
<!-- <default>
|
| 4 |
<reference name="left">
|
| 5 |
<block type="Ecomwise_FreeBestsellerssidebar/bestsellers"/>
|
| 6 |
</reference>
|
| 7 |
+
</default> -->
|
| 8 |
<freebestsellerssidebar_index_index>
|
| 9 |
<reference name="content">
|
| 10 |
<block type="Ecomwise_FreeBestsellerssidebar/bestsellers"/>
|
app/design/frontend/base/default/template/freebestsellerssidebar/freebestsellerssidebar.phtml
CHANGED
|
@@ -1,84 +1,53 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
?>
|
| 21 |
-
<
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
€ <?php echo number_format($product->getPrice(),2)?>
|
| 55 |
-
<?php }?>
|
| 56 |
-
</b>
|
| 57 |
-
</div>
|
| 58 |
-
</td>
|
| 59 |
-
<td>
|
| 60 |
-
<a href="<?php echo $product->getProductUrl() ?>"
|
| 61 |
-
title="<?php echo $this->getImageLabel($product, 'small_image') ?>"
|
| 62 |
-
class="product-image">
|
| 63 |
-
<img src="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(85)?>"
|
| 64 |
-
width="85"
|
| 65 |
-
height="85" />
|
| 66 |
-
</a>
|
| 67 |
-
</td>
|
| 68 |
-
</tr>
|
| 69 |
-
<?php
|
| 70 |
-
}
|
| 71 |
-
?>
|
| 72 |
-
</table>
|
| 73 |
-
<?php
|
| 74 |
-
}else{
|
| 75 |
-
if(Mage::registry('current_category')){
|
| 76 |
-
echo $this->__('No results category');
|
| 77 |
-
}else{
|
| 78 |
-
echo $this->__('No results');
|
| 79 |
-
}
|
| 80 |
-
}
|
| 81 |
-
?>
|
| 82 |
-
</div>
|
| 83 |
-
</div>
|
| 84 |
-
<?php }?>
|
| 1 |
+
<div class="block block-bestsellers">
|
| 2 |
+
<div class="block-title"><strong><?php echo $this->title();?></strong></div>
|
| 3 |
+
<div class="block-content">
|
| 4 |
+
<?php $product_block = $this->getLayout()->createBlock('catalog/product') ?>
|
| 5 |
+
<?php $wee = Mage::helper('weee');
|
| 6 |
+
$_helper = $this->helper('catalog/output');
|
| 7 |
+
$bestsellers = $this->getBestsellers();
|
| 8 |
+
$_taxHelper = Mage::helper('tax');
|
| 9 |
+
if(count($bestsellers) > 0){
|
| 10 |
+
?>
|
| 11 |
+
<table>
|
| 12 |
+
<?php
|
| 13 |
+
foreach($bestsellers as $product_array) {
|
| 14 |
+
$qty = $product_array[0];
|
| 15 |
+
$product = $product_array[1];
|
| 16 |
+
$product = Mage::getModel("catalog/product")->load($product->getId());
|
| 17 |
+
//$_finalPrice = $_taxHelper->getPrice($product, $product->getFinalPrice());
|
| 18 |
+
//$price_html = $product_block->getPriceHtml($product);
|
| 19 |
+
$price_html = Mage::helper('core')->currency($product->getFinalPrice(), true, false);
|
| 20 |
+
?>
|
| 21 |
+
<tr>
|
| 22 |
+
<td>
|
| 23 |
+
<a href="<?php echo $product->getProductUrl() ?>"
|
| 24 |
+
title="<?php echo $this->stripTags($this->getImageLabel($product, 'small_image'), null, true) ?>"
|
| 25 |
+
class="product-image">
|
| 26 |
+
<img src="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(75)?>" />
|
| 27 |
+
</a>
|
| 28 |
+
</td>
|
| 29 |
+
<td>
|
| 30 |
+
<?php $tax = $wee->getAmountForDisplay($product); ?>
|
| 31 |
+
<div class="product-title"><?php echo $product->getName()?></div>
|
| 32 |
+
<div class="bestsellers-price">
|
| 33 |
+
<?php echo $price_html?>
|
| 34 |
+
</div>
|
| 35 |
+
<div class="more-info">
|
| 36 |
+
<a href="<?php echo $product->getProductUrl()?>"><span><?php echo $this->__("More Info.")?></span></a>
|
| 37 |
+
</div>
|
| 38 |
+
<div style="clear:all"></div>
|
| 39 |
+
</td>
|
| 40 |
+
</tr>
|
| 41 |
+
<?php } ?>
|
| 42 |
+
</table>
|
| 43 |
+
<?php
|
| 44 |
+
}else{
|
| 45 |
+
if(Mage::registry('current_category')){
|
| 46 |
+
echo $this->__('No results category');
|
| 47 |
+
}else{
|
| 48 |
+
echo $this->__('No results');
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
?>
|
| 52 |
+
</div>
|
| 53 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/locale/en_US/Ecomwise_FreeBestsellerssidebar.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"More Info.","More Info."
|
| 2 |
+
"No results category","No results category"
|
| 3 |
+
"No results","No results"
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Ecomwise_BestsellerSidebarFree</name>
|
| 4 |
-
<version>1.0
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>OSL-3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Ecomwise_BestsellerSidebarFree</summary>
|
| 10 |
<description>Ecomwise_BestsellerSidebarFree</description>
|
| 11 |
-
<notes>1.0
|
| 12 |
<authors><author><name>EcomwiseTeam</name><user>EcomwiseTeam</user><email>info@ecomwise.com</email></author></authors>
|
| 13 |
-
<date>
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magecommunity"><dir><dir name="Ecomwise"><dir name="Base"><dir name="Block"><dir name="NotificationsNotifier"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Ecomwise"><file name="Extensions.php" hash="bd35aca3be511e975d9f52200b61793a"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7b4c6e200a7c96d8b636057efad0cc1e"/></dir><dir name="Model"><dir name="ExtensionsLicencer"><file name="Observer.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.0.0</min><max>5.9.9</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Ecomwise_BestsellerSidebarFree</name>
|
| 4 |
+
<version>1.2.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>OSL-3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Ecomwise_BestsellerSidebarFree</summary>
|
| 10 |
<description>Ecomwise_BestsellerSidebarFree</description>
|
| 11 |
+
<notes>1.2.0</notes>
|
| 12 |
<authors><author><name>EcomwiseTeam</name><user>EcomwiseTeam</user><email>info@ecomwise.com</email></author></authors>
|
| 13 |
+
<date>2015-01-13</date>
|
| 14 |
+
<time>15:19:08</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir><dir name="Ecomwise"><dir name="Base"><dir name="Block"><dir name="NotificationsNotifier"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Ecomwise"><file name="Extensions.php" hash="bd35aca3be511e975d9f52200b61793a"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7b4c6e200a7c96d8b636057efad0cc1e"/></dir><dir name="Model"><dir name="ExtensionsLicencer"><file name="Observer.php" hash="e5ce78f2d1de491159194d5c26fa8338"/></dir><dir name="NotificationsNotifier"><file name="Observer.php" hash="d7717cc44d954eb771a26160ea6206ae"/><dir name="Source"><dir name="Updates"><file name="Type.php" hash="9dc2b16665b60c4334a5e9b75bbcd1fd"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4233a2cbfb1c2b8a5de6ca8911955195"/><file name="system.xml" hash="89d092ed5df73b846826e6032d741885"/></dir></dir><dir name="FreeBestsellerssidebar"><dir name="Block"><file name="Abstract.php" hash="04e0286f653df0d2c28c8a2eefb76179"/><dir name="Adminhtml"><file name="Support.php" hash="a7fc214556a1853fae80b515e72694f7"/></dir><file name="Bestsellers.php" hash="c92309d515e9eb35ca872d96cf3f1553"/><dir name="System"><dir name="Config"><file name="Version.php" hash="4a10e2f43f98048da892a8bf019c19be"/></dir></dir><file name="Widget.php" hash="689d592b061d6ea0f547bb46856e7674"/></dir><dir name="Helper"><file name="Data.php" hash="a57b126129fc38bfb54a7b4251d7991e"/></dir><dir name="controllers"><file name="IndexController.php" hash="da6e76303cfd35a4bb93a15f743a4be2"/></dir><dir name="etc"><file name="config.xml" hash="859febd670800a05b8163bfb1705187e"/><file name="system.xml" hash="9195f5683bef3da6fc2cdf9545e73d8f"/><file name="widget.xml" hash="703d1b7fa3fbcc85796db3731161d3d3"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Ecomwise_Base.xml" hash=""/><file name="Ecomwise_FreeBestsellerssidebar.xml" hash=""/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="freebestsellerssidebar.xml" hash=""/></dir><dir name="template"><dir name="freebestsellerssidebar"><file name="freebestsellerssidebar.phtml" hash=""/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="freebestsellerssidebar"><file name="support.phtml" hash="0f47fb67af822425ca2b9f65a76bc088"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Ecomwise_FreeBestsellerssidebar.csv" hash="6908d107d99642b2c729ed6e12696383"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="ecomwise"><file name="extensions_logo.png" hash="398cfc27d0a8fc693da176e102e7c013"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="freebestsellerssidebar"><dir name="css"><file name="style.css" hash="8ccd998fc2f2a36532686ba61dc1faec"/></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.0.0</min><max>5.9.9</max></php></required></dependencies>
|
| 18 |
</package>
|
skin/adminhtml/default/default/images/ecomwise/extensions_logo.png
ADDED
|
Binary file
|
skin/frontend/base/default/freebestsellerssidebar/css/style.css
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.block-bestsellers { }
|
| 2 |
+
.block-bestsellers .block-content { padding: 5px 10px; }
|
| 3 |
+
.block-bestsellers td { padding: 5px; }
|
| 4 |
+
.block-bestsellers b { }
|
