Version Notes
0.1.0
Download this release
Release Info
Developer | EcomwiseTeam |
Extension | Ecomwise_BestsellerSidebarFree |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- INSTALLATION GUIDE.txt +57 -0
- USER GUIDE.txt +40 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Bestsellers.php +108 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/Block/System/Config/Version.php +7 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/Helper/Data.php +6 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/controllers/IndexController.php +9 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/etc/config.xml +129 -0
- app/code/community/Ecomwise/FreeBestsellerssidebar/etc/system.xml +68 -0
- app/design/frontend/default/default/layout/freebestsellerssidebar.xml +13 -0
- app/design/frontend/default/default/template/freebestsellerssidebar/freebestsellerssidebar.phtml +84 -0
- app/etc/modules/Ecomwise_FreeBestsellerssidebar.xml +10 -0
- package.xml +18 -0
INSTALLATION GUIDE.txt
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---- INSTALL NOTES ----
|
2 |
+
|
3 |
+
1. Copy the folders (and its content): "app","js" and "skin" to your root magento directory
|
4 |
+
2. If you are not using the default theme, then additionaly copy the following files and folders to your theme directory:
|
5 |
+
app/design/frontend/default/default/layout/callme.xml (file)
|
6 |
+
app/design/frontend/default/default/template/callme (folder and its content)
|
7 |
+
3.Clear the magento cache
|
8 |
+
4.Log out and log in again in your magento admin
|
9 |
+
5. For older versions like Magento 1.3.x it might be even needed for you to explicitely clear the magento cache files from /root/var/cache
|
10 |
+
So, once you are here, select all folders, and delete them including their content.
|
11 |
+
6. One additional measure that might need to be applied for Magento 1.3.x versions might be to clear your browser history (browser cache)
|
12 |
+
|
13 |
+
-- IMPORTANT NOTE --
|
14 |
+
|
15 |
+
Due to translating Java script purposes this extension overrides the Magento core file:
|
16 |
+
app/code/core/Mage/Core/Helper/Js.php
|
17 |
+
by using the file:
|
18 |
+
app/code/core/Mage/Core/Helper/Js.php
|
19 |
+
|
20 |
+
The changes are actually a added java script error for translation on lines: 208-209
|
21 |
+
|
22 |
+
|
23 |
+
If you already have a override of the Js.php file just make sure to copy these two lines
|
24 |
+
from the extension file and put it in the already present one.
|
25 |
+
If not you are risking to loose the previous overrides.
|
26 |
+
|
27 |
+
|
28 |
+
---- CONFIGURATION ----
|
29 |
+
|
30 |
+
In the magento admin browse to: System->Configuration,
|
31 |
+
and then under the "General" tab, look for the "Call me" link.
|
32 |
+
|
33 |
+
Two parameters are editable:
|
34 |
+
- the "email" to whom the request for call will be sent
|
35 |
+
- the "frontend message", which is purely the text that shows in the block
|
36 |
+
after the user has submitted the form successfully
|
37 |
+
- the "default message", which is purely the text that shows in the block by default
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
---- USAGE ----
|
43 |
+
|
44 |
+
You can call the block with a code simmilar to:
|
45 |
+
|
46 |
+
<reference name="reference_name">
|
47 |
+
<block type="Ecomwise_Callme/callme" name="block_name" template="callme/callme.phtml"></block>
|
48 |
+
</reference>
|
49 |
+
|
50 |
+
|
51 |
+
---- COMPATIBILITY ----
|
52 |
+
|
53 |
+
Magento 1.4.0, 1.4.1, 1.4.2
|
54 |
+
Magento 1.3.0, 1.3.1, 1.3.2
|
55 |
+
|
56 |
+
|
57 |
+
|
USER GUIDE.txt
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
-- CONFIGURATION --
|
2 |
+
|
3 |
+
The configuration for this extension is done via the Magento's backend:
|
4 |
+
System -> Configuration -> Catalog -> Bestsellers Sidebar
|
5 |
+
|
6 |
+
In the parameters section you are allowed to specify only the title of the block that is shown on the front.
|
7 |
+
For more options take a look at the Pro version of this extension
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
-- LOCATION OF DISPLAY --
|
12 |
+
|
13 |
+
The location of display is determined with the bestsellerssidebar.xml file found in app/design/frontend/default/default/layout folder
|
14 |
+
|
15 |
+
By default the block is displayed in all pages on the rightsidebar (pages that do have right sidebar).
|
16 |
+
|
17 |
+
To display the block on every page the <default></default> tag is used.
|
18 |
+
And the actual code that dispayls the block is:
|
19 |
+
<reference name="right">
|
20 |
+
<block type="bestsellerssidebar/bestsellers"/>
|
21 |
+
</reference>
|
22 |
+
|
23 |
+
The code above can be called in other .xml files as well.
|
24 |
+
|
25 |
+
Wyas to change the display
|
26 |
+
|
27 |
+
Example problem: lets say you only like to display this block on the only and only on the category page and only on the left sidebar.
|
28 |
+
|
29 |
+
Example solution:
|
30 |
+
- First remove the <default></default> tag and all its content from bestsellerssidebar.xml file.
|
31 |
+
- Open the catalog.xml file from your theme
|
32 |
+
- Add the following code
|
33 |
+
<reference name="left">
|
34 |
+
<block type="bestsellerssidebar/bestsellers"/>
|
35 |
+
</reference>
|
36 |
+
under the following tag: <catalog_category_default translate="label">
|
37 |
+
|
38 |
+
For more details about Magento layouts please visit:
|
39 |
+
http://www.magentocommerce.com/design_guide/articles/intro-to-layouts
|
40 |
+
http://magebase.com/magento-tutorials/demystifying-magentos-layout-xml-part-1/
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Block/Bestsellers.php
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Block/System/Config/Version.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ecomwise_FreeBestsellerssidebar_Block_System_Config_Version extends Mage_Adminhtml_Block_System_Config_Form_Field{
|
3 |
+
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element){
|
5 |
+
return (string) "v".Mage::getConfig()->getNode()->modules->Ecomwise_FreeBestsellerssidebar->version;
|
6 |
+
}
|
7 |
+
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecomwise_FreeBestsellerssidebar_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/controllers/IndexController.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ecomwise_FreeBestsellerssidebar_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout();
|
7 |
+
$this->renderLayout();
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Ecomwise/FreeBestsellerssidebar/etc/config.xml
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ecomwise_FreeBestsellerssidebar>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Ecomwise_FreeBestsellerssidebar>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<freebestsellerssidebar>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Ecomwise_FreeBestsellerssidebar</module>
|
14 |
+
<frontName>freebestsellerssidebar</frontName>
|
15 |
+
</args>
|
16 |
+
</freebestsellerssidebar>
|
17 |
+
</routers>
|
18 |
+
<translate>
|
19 |
+
<modules>
|
20 |
+
<Ecomwise_FreeBestsellerssidebar>
|
21 |
+
<files>
|
22 |
+
<default>Ecomwise_FreeBestsellerssidebar.csv</default>
|
23 |
+
</files>
|
24 |
+
</Ecomwise_FreeBestsellerssidebar>
|
25 |
+
</modules>
|
26 |
+
</translate>
|
27 |
+
<layout>
|
28 |
+
<updates>
|
29 |
+
<freebestsellerssidebar>
|
30 |
+
<file>freebestsellerssidebar.xml</file>
|
31 |
+
</freebestsellerssidebar>
|
32 |
+
</updates>
|
33 |
+
</layout>
|
34 |
+
</frontend>
|
35 |
+
<admin>
|
36 |
+
<routers>
|
37 |
+
<freebestsellerssidebar>
|
38 |
+
<use>admin</use>
|
39 |
+
<args>
|
40 |
+
<module>Ecomwise_FreeBestsellerssidebar</module>
|
41 |
+
<frontName>freebestsellerssidebar</frontName>
|
42 |
+
</args>
|
43 |
+
</freebestsellerssidebar>
|
44 |
+
</routers>
|
45 |
+
</admin>
|
46 |
+
<adminhtml>
|
47 |
+
<acl>
|
48 |
+
<resources>
|
49 |
+
<all>
|
50 |
+
<title>Allow Everything</title>
|
51 |
+
</all>
|
52 |
+
<admin>
|
53 |
+
<children>
|
54 |
+
<system>
|
55 |
+
<children>
|
56 |
+
<config>
|
57 |
+
<children>
|
58 |
+
<freebestsellerssidebar translate="title" module="freebestsellerssidebar">
|
59 |
+
<title>Free Bestsellers Sidebar</title>
|
60 |
+
</freebestsellerssidebar>
|
61 |
+
</children>
|
62 |
+
</config>
|
63 |
+
</children>
|
64 |
+
</system>
|
65 |
+
</children>
|
66 |
+
</admin>
|
67 |
+
</resources>
|
68 |
+
</acl>
|
69 |
+
</adminhtml>
|
70 |
+
<global>
|
71 |
+
<models>
|
72 |
+
<freebestsellerssidebar>
|
73 |
+
<class>Ecomwise_FreeBestsellerssidebar_Model</class>
|
74 |
+
<resourceModel>freebestsellerssidebar_mysql4</resourceModel>
|
75 |
+
</freebestsellerssidebar>
|
76 |
+
<freebestsellerssidebar_mysql4>
|
77 |
+
<class>Ecomwise_Bestsellerssidebar_Model_Mysql4</class>
|
78 |
+
<entities>
|
79 |
+
<freebestsellerssidebar>
|
80 |
+
<table>freebestsellerssidebar</table>
|
81 |
+
</freebestsellerssidebar>
|
82 |
+
</entities>
|
83 |
+
</freebestsellerssidebar_mysql4>
|
84 |
+
</models>
|
85 |
+
<resources>
|
86 |
+
<freebestsellerssidebar_setup>
|
87 |
+
<setup>
|
88 |
+
<module>Ecomwise_FreeBestsellerssidebar</module>
|
89 |
+
</setup>
|
90 |
+
<connection>
|
91 |
+
<use>core_setup</use>
|
92 |
+
</connection>
|
93 |
+
</freebestsellerssidebar_setup>
|
94 |
+
<freebestsellerssidebar_write>
|
95 |
+
<connection>
|
96 |
+
<use>core_write</use>
|
97 |
+
</connection>
|
98 |
+
</freebestsellerssidebar_write>
|
99 |
+
<freebestsellerssidebar_read>
|
100 |
+
<connection>
|
101 |
+
<use>core_read</use>
|
102 |
+
</connection>
|
103 |
+
</freebestsellerssidebar_read>
|
104 |
+
</resources>
|
105 |
+
<blocks>
|
106 |
+
<Ecomwise_FreeBestsellerssidebar>
|
107 |
+
<class>Ecomwise_FreeBestsellerssidebar_Block</class>
|
108 |
+
</Ecomwise_FreeBestsellerssidebar>
|
109 |
+
<freebestsellerssidebar>
|
110 |
+
<class>Ecomwise_FreeBestsellerssidebar_Block</class>
|
111 |
+
</freebestsellerssidebar>
|
112 |
+
</blocks>
|
113 |
+
<helpers>
|
114 |
+
<freebestsellerssidebar>
|
115 |
+
<class>Ecomwise_FreeBestsellerssidebar_Helper</class>
|
116 |
+
</freebestsellerssidebar>
|
117 |
+
</helpers>
|
118 |
+
</global>
|
119 |
+
<default>
|
120 |
+
<freebestsellerssidebar>
|
121 |
+
<config>
|
122 |
+
<active>1</active>
|
123 |
+
</config>
|
124 |
+
<style>
|
125 |
+
<skin>default</skin>
|
126 |
+
</style>
|
127 |
+
</freebestsellerssidebar>
|
128 |
+
</default>
|
129 |
+
</config>
|
app/code/community/Ecomwise/FreeBestsellerssidebar/etc/system.xml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<tabs>
|
5 |
+
<ecomwise translate="label">
|
6 |
+
<label>B2B-extensions</label>
|
7 |
+
<sort_order>100</sort_order>
|
8 |
+
</ecomwise>
|
9 |
+
</tabs>
|
10 |
+
<sections>
|
11 |
+
<freebestsellerssidebar translate="label" module="freebestsellerssidebar">
|
12 |
+
<label>Bestseller Sidebar Free</label>
|
13 |
+
<tab>ecomwise</tab>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>110</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>1</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<groups>
|
20 |
+
<info translate="label">
|
21 |
+
<label>Info</label>
|
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 |
+
<freebestsellerssidebar_version translate="label">
|
28 |
+
<label>Bestseller Sidebar Free</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<frontend_model>freebestsellerssidebar/system_config_version</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 |
+
</freebestsellerssidebar_version>
|
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 |
+
</info>
|
47 |
+
<parameters translate="label">
|
48 |
+
<label>Parameters</label>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<sort_order>3</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>
|
58 |
+
<sort_order>10</sort_order>
|
59 |
+
<show_in_default>1</show_in_default>
|
60 |
+
<show_in_website>1</show_in_website>
|
61 |
+
<show_in_store>1</show_in_store>
|
62 |
+
</block_title>
|
63 |
+
</fields>
|
64 |
+
</parameters>
|
65 |
+
</groups>
|
66 |
+
</freebestsellerssidebar>
|
67 |
+
</sections>
|
68 |
+
</config>
|
app/design/frontend/default/default/layout/freebestsellerssidebar.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"/>
|
11 |
+
</reference>
|
12 |
+
</freebestsellerssidebar_index_index>
|
13 |
+
</layout>
|
app/design/frontend/default/default/template/freebestsellerssidebar/freebestsellerssidebar.phtml
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //echo $this->getJs();?>
|
2 |
+
<?php
|
3 |
+
$freebestsellerssidebarStatus = (bool) Mage::getStoreConfig('freebestsellerssidebar/info/disable_ext', Mage::app()->getStore());
|
4 |
+
if(!$freebestsellerssidebarStatus){
|
5 |
+
?>
|
6 |
+
<style><?php echo $this->getStyle()?></style>
|
7 |
+
|
8 |
+
<?php
|
9 |
+
$version = Mage::getVersion();
|
10 |
+
$subversion = substr($version, strpos($version,'.')+1, 1);
|
11 |
+
?>
|
12 |
+
|
13 |
+
<?php
|
14 |
+
$version = Mage::getVersion();
|
15 |
+
$subversion = substr($version, strpos($version,'.')+1, 1);
|
16 |
+
?>
|
17 |
+
|
18 |
+
<?php
|
19 |
+
if($subversion == 4 or $subversion == 5){
|
20 |
+
?>
|
21 |
+
<div class="block block-bestsellers">
|
22 |
+
<div class="block-title"><strong><span><?php echo $this->title();?></span></strong></div>
|
23 |
+
<div class="block-content">
|
24 |
+
|
25 |
+
<?php }else{?>
|
26 |
+
<div class="box base-mini">
|
27 |
+
<div class="head"><h4><?php echo $this->title();?></h4></div>
|
28 |
+
<div class="content">
|
29 |
+
<?php }?>
|
30 |
+
|
31 |
+
<?php
|
32 |
+
$_helper = $this->helper('catalog/output');
|
33 |
+
$bestsellers = $this->getBestsellers();
|
34 |
+
if(count($bestsellers) > 0){
|
35 |
+
?>
|
36 |
+
<table>
|
37 |
+
<?php
|
38 |
+
foreach($bestsellers as $product_array){
|
39 |
+
$qty = $product_array[0];
|
40 |
+
$product = $product_array[1];
|
41 |
+
?>
|
42 |
+
<tr>
|
43 |
+
<td>
|
44 |
+
<div><?php echo $product->getName()?></div>
|
45 |
+
<div>
|
46 |
+
<b>
|
47 |
+
<?php
|
48 |
+
$finalPrice = number_format($product->getSpecialPrice(),2);
|
49 |
+
$price = $product->getPrice();
|
50 |
+
if($product->getSpecialPrice()){?>
|
51 |
+
<div class="from-price">Van: €<?php echo number_format($price, 2)?></div>
|
52 |
+
<div>Voor: € <span class="to-price"><?php echo number_format($finalPrice, 2)?></span></div>
|
53 |
+
<?php }else{ ?>
|
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 }?>
|
app/etc/modules/Ecomwise_FreeBestsellerssidebar.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Ecomwise_FreeBestsellerssidebar>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>community</codePool>
|
8 |
+
</Ecomwise_FreeBestsellerssidebar>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Ecomwise_BestsellerSidebarFree</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL-3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>BestsellerSidebarFree</summary>
|
10 |
+
<description>BestsellerSidebarFree</description>
|
11 |
+
<notes>0.1.0</notes>
|
12 |
+
<authors><author><name>EcomwiseTeam</name><user>EcomwiseTeam</user><email>info@experius.nl</email></author></authors>
|
13 |
+
<date>2013-01-11</date>
|
14 |
+
<time>11:27:29</time>
|
15 |
+
<contents><target name="magecommunity"><dir><dir name="Ecomwise"><dir name="FreeBestsellerssidebar"><dir name="Block"><file name="Bestsellers.php" hash="8d5091f0ec6732939351b1168704a5db"/><dir name="System"><dir name="Config"><file name="Version.php" hash="4a10e2f43f98048da892a8bf019c19be"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="b9f99eb6fe6e0ce7882f59bcf461fc47"/></dir><dir name="controllers"><file name="IndexController.php" hash="da6e76303cfd35a4bb93a15f743a4be2"/></dir><dir name="etc"><file name="config.xml" hash="fba57015b26fcff7c7fb15a11ce76fbb"/><file name="system.xml" hash="7d213718231b08a7efd6df743c2b4cbd"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Ecomwise_FreeBestsellerssidebar.xml" hash="1c4a63ce196b6cbdb5c85d0413924c62"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="freebestsellerssidebar.xml" hash="7615c9da98102d060d3e359cfd07a7a9"/></dir><dir name="template"><dir name="freebestsellerssidebar"><file name="freebestsellerssidebar.phtml" hash="8c57553269a76b8289662ab04cd61755"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="nl_NL"><file name="Experius_FreeBestsellerssidebar.xml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><dir name="en_US"><file name="Experius_FreeBestsellerssidebar.xml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></target><target name="mage"><dir><dir><file name="INSTALLATION GUIDE.txt" hash="b6174b848dfc2081be5dc792fe4abd41"/><file name="USER GUIDE.txt" hash="1717f7c1e859ea2aa59b934a7a003fbe"/></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.0.0</min><max>5.4.8</max></php></required></dependencies>
|
18 |
+
</package>
|