Version Notes
- Bug Fixing & Enhancement
- Manufacturer visible link in header panel
- Image upload issue while uploading image having space in name (< Magento 1.5)
Download this release
Release Info
| Developer | Biztech |
| Extension | manufacturer_brand_logo |
| Version | 1.1.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.5 to 1.1.6
- app/code/local/Bc/Bcall/Helper/Data.php +0 -25
- app/code/local/Bc/Bcall/etc/adminhtml.xml +0 -54
- app/code/local/Bc/Bcall/etc/config.xml +0 -105
- app/code/local/Bc/Bcall/etc/system.xml +0 -32
- app/code/local/Bc/Manufacturer/Block/Adminhtml/Grid/Renderer1/Image.php +0 -15
- app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer.php +0 -12
- app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit.php +0 -45
- app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Form.php +0 -19
- app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Form.php +0 -89
- app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tabs.php +0 -24
- app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Grid.php +0 -137
- app/code/local/Bc/Manufacturer/Block/Manufacturer.php +0 -17
- app/code/local/Bc/Manufacturer/Helper/Data.php +0 -6
- app/code/local/Bc/Manufacturer/Model/Manufacturer.php +0 -10
- app/code/local/Bc/Manufacturer/Model/Mysql4/Manufacturer.php +0 -10
- app/code/local/Bc/Manufacturer/Model/Mysql4/Manufacturer/Collection.php +0 -10
- app/code/local/Bc/Manufacturer/Model/Status.php +0 -15
- app/code/local/Bc/Manufacturer/controllers/Adminhtml/ManufacturerController.php +0 -243
- app/code/local/Bc/Manufacturer/controllers/IndexController.php +0 -47
- app/code/local/Bc/Manufacturer/etc/adminhtml.xml +0 -52
- app/code/local/Bc/Manufacturer/etc/config.xml +0 -107
- app/code/local/Bc/Manufacturer/sql/manufacturer_setup/mysql4-install-0.1.0.php +0 -23
- app/design/adminhtml/default/default/layout/manufacturer.xml +22 -0
- app/design/frontend/base/default/layout/manufacturer.xml +30 -0
- app/design/frontend/base/default/template/manufacturer/layer/filter.phtml +36 -0
- app/design/frontend/base/default/template/manufacturer/manufacturer.phtml +21 -84
- app/design/frontend/base/default/template/manufacturer/manufacturer_resize.phtml +17 -22
- app/design/frontend/base/default/template/manufacturer/product_manufacturer.phtml +1 -2
- app/design/frontend/base/default/template/manufacturer/view.phtml +111 -0
- app/etc/modules/Bc_Bcall.xml +5 -6
- app/etc/modules/Bc_Manufacturer.xml +22 -0
- package.xml +7 -5
app/code/local/Bc/Bcall/Helper/Data.php
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* @category Codnitive
|
| 16 |
-
* @package Codnitive_Codall
|
| 17 |
-
* @author Hassan Barza <support@codnitive.com>
|
| 18 |
-
* @copyright Copyright (c) 2011 CODNITIVE Co. (http://www.codnitive.com)
|
| 19 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
-
*/
|
| 21 |
-
|
| 22 |
-
class Bc_Bcall_Helper_Data extends Mage_Core_Helper_Data
|
| 23 |
-
{
|
| 24 |
-
|
| 25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Bcall/etc/adminhtml.xml
DELETED
|
@@ -1,54 +0,0 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* Magento
|
| 5 |
-
*
|
| 6 |
-
* NOTICE OF LICENSE
|
| 7 |
-
*
|
| 8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
*
|
| 12 |
-
* DISCLAIMER
|
| 13 |
-
*
|
| 14 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 15 |
-
* versions in the future. If you wish to customize Magento for your
|
| 16 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
-
*
|
| 18 |
-
* @category Codnitive
|
| 19 |
-
* @package Codnitive_Codall
|
| 20 |
-
* @author Hassan Barza <support@codnitive.com>
|
| 21 |
-
* @copyright Copyright (c) 2011 CODNITIVE Co. (http://www.codnitive.com)
|
| 22 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 23 |
-
*/
|
| 24 |
-
-->
|
| 25 |
-
<config>
|
| 26 |
-
<menu>
|
| 27 |
-
<biztech module="bcall">
|
| 28 |
-
<title>Biztech</title>
|
| 29 |
-
<sort_order>90</sort_order>
|
| 30 |
-
</biztech>
|
| 31 |
-
</menu>
|
| 32 |
-
<acl>
|
| 33 |
-
<resources>
|
| 34 |
-
<all>
|
| 35 |
-
<title>Allow Everything</title>
|
| 36 |
-
</all>
|
| 37 |
-
<admin>
|
| 38 |
-
<children>
|
| 39 |
-
<system>
|
| 40 |
-
<children>
|
| 41 |
-
<config>
|
| 42 |
-
<children>
|
| 43 |
-
<bcall>
|
| 44 |
-
<title>Biztech</title>
|
| 45 |
-
</bcall>
|
| 46 |
-
</children>
|
| 47 |
-
</config>
|
| 48 |
-
</children>
|
| 49 |
-
</system>
|
| 50 |
-
</children>
|
| 51 |
-
</admin>
|
| 52 |
-
</resources>
|
| 53 |
-
</acl>
|
| 54 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Bcall/etc/config.xml
DELETED
|
@@ -1,105 +0,0 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* Magento
|
| 5 |
-
*
|
| 6 |
-
* NOTICE OF LICENSE
|
| 7 |
-
*
|
| 8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
*
|
| 12 |
-
* DISCLAIMER
|
| 13 |
-
*
|
| 14 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 15 |
-
* versions in the future. If you wish to customize Magento for your
|
| 16 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
-
*
|
| 18 |
-
* @category bcnitive
|
| 19 |
-
* @package bcnitive_bcall
|
| 20 |
-
* @author Hassan Barza <support@bcnitive.com>
|
| 21 |
-
* @copyright Copyright (c) 2011 bcNITIVE Co. (http://www.bcnitive.com)
|
| 22 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 23 |
-
*/
|
| 24 |
-
-->
|
| 25 |
-
<config>
|
| 26 |
-
<modules>
|
| 27 |
-
<Bc_bcall>
|
| 28 |
-
<version>1.1.1</version>
|
| 29 |
-
<title>Biztech</title>
|
| 30 |
-
</Bc_bcall>
|
| 31 |
-
</modules>
|
| 32 |
-
|
| 33 |
-
<global>
|
| 34 |
-
<models>
|
| 35 |
-
<bcall>
|
| 36 |
-
<class>Bc_Bcall_Model</class>
|
| 37 |
-
</bcall>
|
| 38 |
-
</models>
|
| 39 |
-
<helpers>
|
| 40 |
-
<bcall>
|
| 41 |
-
<class>Bc_Bcall_Helper</class>
|
| 42 |
-
</bcall>
|
| 43 |
-
</helpers>
|
| 44 |
-
<resources>
|
| 45 |
-
<bcall_setup>
|
| 46 |
-
<setup>
|
| 47 |
-
<module>Bc_Bcall</module>
|
| 48 |
-
</setup>
|
| 49 |
-
<connection>
|
| 50 |
-
<use>core_setup</use>
|
| 51 |
-
</connection>
|
| 52 |
-
</bcall_setup>
|
| 53 |
-
<bcall_write>
|
| 54 |
-
<connection>
|
| 55 |
-
<use>core_write</use>
|
| 56 |
-
</connection>
|
| 57 |
-
</bcall_write>
|
| 58 |
-
<bcall_read>
|
| 59 |
-
<connection>
|
| 60 |
-
<use>core_read</use>
|
| 61 |
-
</connection>
|
| 62 |
-
</bcall_read>
|
| 63 |
-
</resources>
|
| 64 |
-
<blocks>
|
| 65 |
-
<bcall>
|
| 66 |
-
<class>Bc_Bcall_Block</class>
|
| 67 |
-
</bcall>
|
| 68 |
-
</blocks>
|
| 69 |
-
</global>
|
| 70 |
-
|
| 71 |
-
<adminhtml>
|
| 72 |
-
<translate>
|
| 73 |
-
<modules>
|
| 74 |
-
<Bc_bcall>
|
| 75 |
-
<files>
|
| 76 |
-
<default>Bc_Bcall.csv</default>
|
| 77 |
-
</files>
|
| 78 |
-
</Bc_bcall>
|
| 79 |
-
</modules>
|
| 80 |
-
</translate>
|
| 81 |
-
|
| 82 |
-
<acl>
|
| 83 |
-
<resources>
|
| 84 |
-
<all>
|
| 85 |
-
<title>Allow Everything</title>
|
| 86 |
-
</all>
|
| 87 |
-
<admin>
|
| 88 |
-
<children>
|
| 89 |
-
<system>
|
| 90 |
-
<children>
|
| 91 |
-
<config>
|
| 92 |
-
<children>
|
| 93 |
-
<bcall>
|
| 94 |
-
<title>Biztech</title>
|
| 95 |
-
</bcall>
|
| 96 |
-
</children>
|
| 97 |
-
</config>
|
| 98 |
-
</children>
|
| 99 |
-
</system>
|
| 100 |
-
</children>
|
| 101 |
-
</admin>
|
| 102 |
-
</resources>
|
| 103 |
-
</acl>
|
| 104 |
-
</adminhtml>
|
| 105 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Bcall/etc/system.xml
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* Magento
|
| 5 |
-
*
|
| 6 |
-
* NOTICE OF LICENSE
|
| 7 |
-
*
|
| 8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
*
|
| 12 |
-
* DISCLAIMER
|
| 13 |
-
*
|
| 14 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 15 |
-
* versions in the future. If you wish to customize Magento for your
|
| 16 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
-
*
|
| 18 |
-
* @category Codnitive
|
| 19 |
-
* @package Codnitive_Codall
|
| 20 |
-
* @author Hassan Barza <support@codnitive.com>
|
| 21 |
-
* @copyright Copyright (c) 2011 CODNITIVE Co. (http://www.codnitive.com)
|
| 22 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 23 |
-
*/
|
| 24 |
-
-->
|
| 25 |
-
<config>
|
| 26 |
-
<tabs>
|
| 27 |
-
<biztech translate="label" module="bcall">
|
| 28 |
-
<label>Biztech</label>
|
| 29 |
-
<sort_order>250</sort_order>
|
| 30 |
-
</biztech>
|
| 31 |
-
</tabs>
|
| 32 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Adminhtml/Grid/Renderer1/Image.php
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Block_Adminhtml_Grid_Renderer1_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
| 4 |
-
{
|
| 5 |
-
public function render(Varien_Object $row)
|
| 6 |
-
{
|
| 7 |
-
if($row->getdata('filename')==""){
|
| 8 |
-
return "";
|
| 9 |
-
}
|
| 10 |
-
else{
|
| 11 |
-
//you can also use some resizer here...
|
| 12 |
-
return "<img src='".Mage::getBaseUrl("media")."/Manufacturer/".$row->getdata('filename')."' width='75' height='75'/>";
|
| 13 |
-
}
|
| 14 |
-
}
|
| 15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer.php
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Bc_Manufacturer_Block_Adminhtml_Manufacturer extends Mage_Adminhtml_Block_Widget_Grid_Container
|
| 3 |
-
{
|
| 4 |
-
public function __construct()
|
| 5 |
-
{
|
| 6 |
-
$this->_controller = 'adminhtml_manufacturer';
|
| 7 |
-
$this->_blockGroup = 'manufacturer';
|
| 8 |
-
$this->_headerText = Mage::helper('manufacturer')->__('Manufacturer Manager');
|
| 9 |
-
$this->_addButtonLabel = Mage::helper('manufacturer')->__('Add Manufacturer');
|
| 10 |
-
parent::__construct();
|
| 11 |
-
}
|
| 12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit.php
DELETED
|
@@ -1,45 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Block_Adminhtml_Manufacturer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
| 4 |
-
{
|
| 5 |
-
public function __construct()
|
| 6 |
-
{
|
| 7 |
-
parent::__construct();
|
| 8 |
-
|
| 9 |
-
$this->_objectId = 'id';
|
| 10 |
-
$this->_blockGroup = 'manufacturer';
|
| 11 |
-
$this->_controller = 'adminhtml_manufacturer';
|
| 12 |
-
|
| 13 |
-
$this->_updateButton('save', 'label', Mage::helper('manufacturer')->__('Save Manufacturer'));
|
| 14 |
-
$this->_updateButton('delete', 'label', Mage::helper('manufacturer')->__('Delete Manufacturer'));
|
| 15 |
-
|
| 16 |
-
$this->_addButton('saveandcontinue', array(
|
| 17 |
-
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
| 18 |
-
'onclick' => 'saveAndContinueEdit()',
|
| 19 |
-
'class' => 'save',
|
| 20 |
-
), -100);
|
| 21 |
-
|
| 22 |
-
$this->_formScripts[] = "
|
| 23 |
-
function toggleEditor() {
|
| 24 |
-
if (tinyMCE.getInstanceById('manufacturer_content') == null) {
|
| 25 |
-
tinyMCE.execCommand('mceAddControl', false, 'manufacturer_content');
|
| 26 |
-
} else {
|
| 27 |
-
tinyMCE.execCommand('mceRemoveControl', false, 'manufacturer_content');
|
| 28 |
-
}
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
function saveAndContinueEdit(){
|
| 32 |
-
editForm.submit($('edit_form').action+'back/edit/');
|
| 33 |
-
}
|
| 34 |
-
";
|
| 35 |
-
}
|
| 36 |
-
|
| 37 |
-
public function getHeaderText()
|
| 38 |
-
{
|
| 39 |
-
if( Mage::registry('manufacturer_data') && Mage::registry('manufacturer_data')->getId() ) {
|
| 40 |
-
return Mage::helper('manufacturer')->__("Edit Manufacturer"); //'%s'", $this->htmlEscape(Mage::registry('manufacturer_data')->getMenufecturerName()));
|
| 41 |
-
} else {
|
| 42 |
-
return Mage::helper('manufacturer')->__('Add Manufacturer');
|
| 43 |
-
}
|
| 44 |
-
}
|
| 45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Form.php
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
| 4 |
-
{
|
| 5 |
-
protected function _prepareForm()
|
| 6 |
-
{
|
| 7 |
-
$form = new Varien_Data_Form(array(
|
| 8 |
-
'id' => 'edit_form',
|
| 9 |
-
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
| 10 |
-
'method' => 'post',
|
| 11 |
-
'enctype' => 'multipart/form-data'
|
| 12 |
-
)
|
| 13 |
-
);
|
| 14 |
-
|
| 15 |
-
$form->setUseContainer(true);
|
| 16 |
-
$this->setForm($form);
|
| 17 |
-
return parent::_prepareForm();
|
| 18 |
-
}
|
| 19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Form.php
DELETED
|
@@ -1,89 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
| 4 |
-
{
|
| 5 |
-
protected function _prepareForm()
|
| 6 |
-
{
|
| 7 |
-
$form = new Varien_Data_Form();
|
| 8 |
-
$this->setForm($form);
|
| 9 |
-
$fieldset = $form->addFieldset('manufacturer_form', array('legend'=>Mage::helper('manufacturer')->__('Manufacturer information')));
|
| 10 |
-
//get Manufecturer's Attribut options
|
| 11 |
-
//DebugBreak();
|
| 12 |
-
$attribute_code=Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product', "manufacturer");
|
| 13 |
-
$attributeInfo = Mage::getModel('eav/entity_attribute')->load($attribute_code);
|
| 14 |
-
$attribute_table = Mage::getModel('eav/entity_attribute_source_table')->setAttribute($attributeInfo);
|
| 15 |
-
$attributeOptions = $attribute_table->getAllOptions(false);
|
| 16 |
-
$default=array('value'=>'','label'=>'Choose Brand');
|
| 17 |
-
$i=0;
|
| 18 |
-
$manufacturer[$i]=$default;
|
| 19 |
-
foreach($attributeOptions as $key=>$value){
|
| 20 |
-
$i++;
|
| 21 |
-
$manufacturer[$i]=$value;
|
| 22 |
-
}
|
| 23 |
-
//End
|
| 24 |
-
$fieldset->addField('menufecturer_name', 'select', array(
|
| 25 |
-
'label' => Mage::helper('manufacturer')->__('Select Manufacturer'),
|
| 26 |
-
'class' => 'required-entry',
|
| 27 |
-
'required' => true,
|
| 28 |
-
'name' => 'menufecturer_name',
|
| 29 |
-
'values' =>$manufacturer,
|
| 30 |
-
));
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
//At the time of insert of manufacturer the image uploaded is reqired
|
| 34 |
-
//While time of Edit the control can be blank
|
| 35 |
-
if(Mage::registry('manufacturer_data')->getData('filename')!=""){
|
| 36 |
-
$fieldset->addField('filename', 'file', array(
|
| 37 |
-
'label' => Mage::helper('manufacturer/data')->__('Brand Logo'),
|
| 38 |
-
'required' => false,
|
| 39 |
-
'name' => 'filename',
|
| 40 |
-
'after_element_html' => Mage::registry('manufacturer_data')->getData('filename') != "" ? '<span class="hint"><img src="'.Mage::getBaseUrl('media')."Manufacturer/".Mage::registry('manufacturer_data')->getData('filename').'" width="25" height="25" name="manufacturer_image" style="vertical-align: middle;" /></span>':'',
|
| 41 |
-
));
|
| 42 |
-
}else{
|
| 43 |
-
$fieldset->addField('filename', 'file', array(
|
| 44 |
-
'label' => Mage::helper('manufacturer/data')->__('Brand Logo'),
|
| 45 |
-
'class' => 'required-entry',
|
| 46 |
-
'required' => true,
|
| 47 |
-
'name' => 'filename',
|
| 48 |
-
'after_element_html' => Mage::registry('manufacturer_data')->getData('filename') != "" ? '<span class="hint"><img src="'.Mage::getBaseUrl('media')."Manufacturer/".Mage::registry('manufacturer_data')->getData('filename').'" width="25" height="25" name="manufacturer_image" style="vertical-align: middle;" /></span>':'',
|
| 49 |
-
));
|
| 50 |
-
}
|
| 51 |
-
//<br/><input type="checkbox" name="image_chk" id="image_chk"/><label for="image_chk"> Delete Image</label>
|
| 52 |
-
|
| 53 |
-
$fieldset->addField('status', 'select', array(
|
| 54 |
-
'label' => Mage::helper('manufacturer')->__('Status'),
|
| 55 |
-
'name' => 'status',
|
| 56 |
-
'values' => array(
|
| 57 |
-
array(
|
| 58 |
-
'value' => 1,
|
| 59 |
-
'label' => Mage::helper('manufacturer')->__('Enabled'),
|
| 60 |
-
),
|
| 61 |
-
|
| 62 |
-
array(
|
| 63 |
-
'value' => 2,
|
| 64 |
-
'label' => Mage::helper('manufacturer')->__('Disabled'),
|
| 65 |
-
),
|
| 66 |
-
),
|
| 67 |
-
));
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
/*$fieldset->addField('content', 'editor', array(
|
| 72 |
-
'name' => 'content',
|
| 73 |
-
'label' => Mage::helper('manufacturer')->__('Content'),
|
| 74 |
-
'title' => Mage::helper('manufacturer')->__('Content'),
|
| 75 |
-
'style' => 'width:700px; height:500px;',
|
| 76 |
-
'wysiwyg' => false,
|
| 77 |
-
'required' => true,
|
| 78 |
-
));*/
|
| 79 |
-
|
| 80 |
-
if ( Mage::getSingleton('adminhtml/session')->getManufacturerData() )
|
| 81 |
-
{
|
| 82 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->getManufacturerData());
|
| 83 |
-
Mage::getSingleton('adminhtml/session')->setManufacturerData(null);
|
| 84 |
-
} elseif ( Mage::registry('manufacturer_data') ) {
|
| 85 |
-
$form->setValues(Mage::registry('manufacturer_data')->getData());
|
| 86 |
-
}
|
| 87 |
-
return parent::_prepareForm();
|
| 88 |
-
}
|
| 89 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tabs.php
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
| 4 |
-
{
|
| 5 |
-
|
| 6 |
-
public function __construct()
|
| 7 |
-
{
|
| 8 |
-
parent::__construct();
|
| 9 |
-
$this->setId('manufacturer_tabs');
|
| 10 |
-
$this->setDestElementId('edit_form');
|
| 11 |
-
$this->setTitle(Mage::helper('manufacturer')->__('Manufacturer Information'));
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
protected function _beforeToHtml()
|
| 15 |
-
{
|
| 16 |
-
$this->addTab('form_section', array(
|
| 17 |
-
'label' => Mage::helper('manufacturer')->__('Manufacturer Information'),
|
| 18 |
-
'title' => Mage::helper('manufacturer')->__('Manufacturer Information'),
|
| 19 |
-
'content' => $this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit_tab_form')->toHtml(),
|
| 20 |
-
));
|
| 21 |
-
|
| 22 |
-
return parent::_beforeToHtml();
|
| 23 |
-
}
|
| 24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Adminhtml/Manufacturer/Grid.php
DELETED
|
@@ -1,137 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Block_Adminhtml_Manufacturer_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
| 4 |
-
{
|
| 5 |
-
public function __construct()
|
| 6 |
-
{
|
| 7 |
-
parent::__construct();
|
| 8 |
-
$this->setId('manufacturerGrid');
|
| 9 |
-
$this->setDefaultSort('manufacturer_id');
|
| 10 |
-
$this->setDefaultDir('ASC');
|
| 11 |
-
$this->setSaveParametersInSession(true);
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
protected function _prepareCollection()
|
| 15 |
-
{
|
| 16 |
-
$collection = Mage::getModel('manufacturer/manufacturer')->getCollection();
|
| 17 |
-
$this->setCollection($collection);
|
| 18 |
-
return parent::_prepareCollection();
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
protected function _prepareColumns()
|
| 22 |
-
{
|
| 23 |
-
$this->addColumn('manufacturer_id', array(
|
| 24 |
-
'header' => Mage::helper('manufacturer')->__('ID'),
|
| 25 |
-
'align' =>'right',
|
| 26 |
-
'width' => '50px',
|
| 27 |
-
'index' => 'manufacturer_id',
|
| 28 |
-
));
|
| 29 |
-
|
| 30 |
-
//get Manufecturer's Attribut options
|
| 31 |
-
$attribute_code=Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product', "manufacturer");
|
| 32 |
-
$attributeInfo = Mage::getModel('eav/entity_attribute')->load($attribute_code);
|
| 33 |
-
$attribute_table = Mage::getModel('eav/entity_attribute_source_table')->setAttribute($attributeInfo);
|
| 34 |
-
$attributeOptions = $attribute_table->getAllOptions(false);
|
| 35 |
-
foreach($attributeOptions as $key=>$value){
|
| 36 |
-
$manufacturer[$value['value']]=$value['label'];
|
| 37 |
-
}
|
| 38 |
-
//End
|
| 39 |
-
$this->addColumn('menufecturer_name', array(
|
| 40 |
-
'header' => Mage::helper('manufacturer')->__('Manufacturer Name'),
|
| 41 |
-
'align' =>'left',
|
| 42 |
-
'index' =>'menufecturer_name',
|
| 43 |
-
'type' =>'options',
|
| 44 |
-
'options' =>$manufacturer,
|
| 45 |
-
));
|
| 46 |
-
|
| 47 |
-
$this->addColumn('filename', array(
|
| 48 |
-
'header' => Mage::helper('manufacturer')->__('Thumbnail'),
|
| 49 |
-
'renderer' => 'manufacturer/adminhtml_grid_renderer1_image',
|
| 50 |
-
'filter'=>false,
|
| 51 |
-
'align' =>'left',
|
| 52 |
-
'type' => 'image',
|
| 53 |
-
'width' => '100px',
|
| 54 |
-
'index' => 'filename',
|
| 55 |
-
));
|
| 56 |
-
|
| 57 |
-
/*
|
| 58 |
-
$this->addColumn('content', array(
|
| 59 |
-
'header' => Mage::helper('manufacturer')->__('Item Content'),
|
| 60 |
-
'width' => '150px',
|
| 61 |
-
'index' => 'content',
|
| 62 |
-
));
|
| 63 |
-
*/
|
| 64 |
-
|
| 65 |
-
$this->addColumn('status', array(
|
| 66 |
-
'header' => Mage::helper('manufacturer')->__('Status'),
|
| 67 |
-
'align' => 'left',
|
| 68 |
-
'width' => '80px',
|
| 69 |
-
'index' => 'status',
|
| 70 |
-
'type' => 'options',
|
| 71 |
-
'options' => array(
|
| 72 |
-
1 => 'Enabled',
|
| 73 |
-
2 => 'Disabled',
|
| 74 |
-
),
|
| 75 |
-
));
|
| 76 |
-
|
| 77 |
-
$this->addColumn('action',
|
| 78 |
-
array(
|
| 79 |
-
'header' => Mage::helper('manufacturer')->__('Action'),
|
| 80 |
-
'width' => '100',
|
| 81 |
-
'type' => 'action',
|
| 82 |
-
'getter' => 'getId',
|
| 83 |
-
'actions' => array(
|
| 84 |
-
array(
|
| 85 |
-
'caption' => Mage::helper('manufacturer')->__('Edit'),
|
| 86 |
-
'url' => array('base'=> '*/*/edit'),
|
| 87 |
-
'field' => 'id'
|
| 88 |
-
)
|
| 89 |
-
),
|
| 90 |
-
'filter' => false,
|
| 91 |
-
'sortable' => false,
|
| 92 |
-
'index' => 'stores',
|
| 93 |
-
'is_system' => true,
|
| 94 |
-
));
|
| 95 |
-
|
| 96 |
-
//$this->addExportType('*/*/exportCsv', Mage::helper('manufacturer')->__('CSV'));
|
| 97 |
-
//$this->addExportType('*/*/exportXml', Mage::helper('manufacturer')->__('XML'));
|
| 98 |
-
|
| 99 |
-
return parent::_prepareColumns();
|
| 100 |
-
}
|
| 101 |
-
|
| 102 |
-
protected function _prepareMassaction()
|
| 103 |
-
{
|
| 104 |
-
$this->setMassactionIdField('manufacturer_id');
|
| 105 |
-
$this->getMassactionBlock()->setFormFieldName('manufacturer');
|
| 106 |
-
|
| 107 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
| 108 |
-
'label' => Mage::helper('manufacturer')->__('Delete'),
|
| 109 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
| 110 |
-
'confirm' => Mage::helper('manufacturer')->__('Are you sure?')
|
| 111 |
-
));
|
| 112 |
-
|
| 113 |
-
$statuses = Mage::getSingleton('manufacturer/status')->getOptionArray();
|
| 114 |
-
|
| 115 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
| 116 |
-
$this->getMassactionBlock()->addItem('status', array(
|
| 117 |
-
'label'=> Mage::helper('manufacturer')->__('Change status'),
|
| 118 |
-
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
| 119 |
-
'additional' => array(
|
| 120 |
-
'visibility' => array(
|
| 121 |
-
'name' => 'status',
|
| 122 |
-
'type' => 'select',
|
| 123 |
-
'class' => 'required-entry',
|
| 124 |
-
'label' => Mage::helper('manufacturer')->__('Status'),
|
| 125 |
-
'values' => $statuses
|
| 126 |
-
)
|
| 127 |
-
)
|
| 128 |
-
));
|
| 129 |
-
return $this;
|
| 130 |
-
}
|
| 131 |
-
|
| 132 |
-
public function getRowUrl($row)
|
| 133 |
-
{
|
| 134 |
-
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
| 135 |
-
}
|
| 136 |
-
|
| 137 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Block/Manufacturer.php
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Bc_Manufacturer_Block_Manufacturer extends Mage_Core_Block_Template
|
| 3 |
-
{
|
| 4 |
-
public function _prepareLayout()
|
| 5 |
-
{
|
| 6 |
-
return parent::_prepareLayout();
|
| 7 |
-
}
|
| 8 |
-
|
| 9 |
-
public function getManufacturer()
|
| 10 |
-
{
|
| 11 |
-
if (!$this->hasData('manufacturer')) {
|
| 12 |
-
$this->setData('manufacturer', Mage::registry('manufacturer'));
|
| 13 |
-
}
|
| 14 |
-
return $this->getData('manufacturer');
|
| 15 |
-
|
| 16 |
-
}
|
| 17 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Helper/Data.php
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
-
{
|
| 5 |
-
|
| 6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Model/Manufacturer.php
DELETED
|
@@ -1,10 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Model_Manufacturer extends Mage_Core_Model_Abstract
|
| 4 |
-
{
|
| 5 |
-
public function _construct()
|
| 6 |
-
{
|
| 7 |
-
parent::_construct();
|
| 8 |
-
$this->_init('manufacturer/manufacturer');
|
| 9 |
-
}
|
| 10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Model/Mysql4/Manufacturer.php
DELETED
|
@@ -1,10 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Model_Mysql4_Manufacturer extends Mage_Core_Model_Mysql4_Abstract
|
| 4 |
-
{
|
| 5 |
-
public function _construct()
|
| 6 |
-
{
|
| 7 |
-
// Note that the manufacturer_id refers to the key field in your database table.
|
| 8 |
-
$this->_init('manufacturer/manufacturer', 'manufacturer_id');
|
| 9 |
-
}
|
| 10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Model/Mysql4/Manufacturer/Collection.php
DELETED
|
@@ -1,10 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Model_Mysql4_Manufacturer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
| 4 |
-
{
|
| 5 |
-
public function _construct()
|
| 6 |
-
{
|
| 7 |
-
parent::_construct();
|
| 8 |
-
$this->_init('manufacturer/manufacturer');
|
| 9 |
-
}
|
| 10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/Model/Status.php
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Model_Status extends Varien_Object
|
| 4 |
-
{
|
| 5 |
-
const STATUS_ENABLED = 1;
|
| 6 |
-
const STATUS_DISABLED = 2;
|
| 7 |
-
|
| 8 |
-
static public function getOptionArray()
|
| 9 |
-
{
|
| 10 |
-
return array(
|
| 11 |
-
self::STATUS_ENABLED => Mage::helper('manufacturer')->__('Enabled'),
|
| 12 |
-
self::STATUS_DISABLED => Mage::helper('manufacturer')->__('Disabled')
|
| 13 |
-
);
|
| 14 |
-
}
|
| 15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/controllers/Adminhtml/ManufacturerController.php
DELETED
|
@@ -1,243 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Bc_Manufacturer_Adminhtml_ManufacturerController extends Mage_Adminhtml_Controller_action
|
| 4 |
-
{
|
| 5 |
-
|
| 6 |
-
protected function _initAction() {
|
| 7 |
-
$this->loadLayout()
|
| 8 |
-
->_setActiveMenu('manufacturer/items')
|
| 9 |
-
->_addBreadcrumb(Mage::helper('adminhtml')->__('Manufacturer Manager'), Mage::helper('adminhtml')->__('Manufacturer Manager'));
|
| 10 |
-
|
| 11 |
-
return $this;
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
public function indexAction() {
|
| 15 |
-
$this->_initAction()
|
| 16 |
-
->renderLayout();
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
public function editAction() {
|
| 20 |
-
$id = $this->getRequest()->getParam('id');
|
| 21 |
-
$model = Mage::getModel('manufacturer/manufacturer')->load($id);
|
| 22 |
-
|
| 23 |
-
if ($model->getId() || $id == 0) {
|
| 24 |
-
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
| 25 |
-
if (!empty($data)) {
|
| 26 |
-
$model->setData($data);
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
-
Mage::register('manufacturer_data', $model);
|
| 30 |
-
|
| 31 |
-
$this->loadLayout();
|
| 32 |
-
$this->_setActiveMenu('manufacturer/items');
|
| 33 |
-
|
| 34 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Manufacturer Manager'), Mage::helper('adminhtml')->__('Manufacturer Manager'));
|
| 35 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Manufacturer News'), Mage::helper('adminhtml')->__('Manufacturer News'));
|
| 36 |
-
|
| 37 |
-
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
| 38 |
-
|
| 39 |
-
$this->_addContent($this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit'))
|
| 40 |
-
->_addLeft($this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit_tabs'));
|
| 41 |
-
|
| 42 |
-
$this->renderLayout();
|
| 43 |
-
} else {
|
| 44 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manufacturer')->__('Manufacturer does not exist'));
|
| 45 |
-
$this->_redirect('*/*/');
|
| 46 |
-
}
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
public function newAction() {
|
| 50 |
-
$this->_forward('edit');
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
public function saveAction() {
|
| 54 |
-
$data = $this->getRequest()->getPost();
|
| 55 |
-
//DebugBreak();
|
| 56 |
-
//If the manufacturer already exits or not
|
| 57 |
-
$collection=Mage::getModel('manufacturer/manufacturer')->getCollection()->addFieldToFilter('menufecturer_name',$data['menufecturer_name']);
|
| 58 |
-
$manufacturer_data=$collection->getData();
|
| 59 |
-
if(count($collection)>0 && $manufacturer_data[0]['status']==1 && $this->getRequest()->getParam('id')!=$manufacturer_data[0]['manufacturer_id']){
|
| 60 |
-
$this->_forward('edit');
|
| 61 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Manufacturer Already Exists'));
|
| 62 |
-
|
| 63 |
-
//Mage::getSingleton('adminhtml/session')->setFormData(false);
|
| 64 |
-
}else{
|
| 65 |
-
if ($data) {
|
| 66 |
-
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
| 67 |
-
try {
|
| 68 |
-
/* Starting upload */
|
| 69 |
-
$uploader = new Varien_File_Uploader('filename');
|
| 70 |
-
|
| 71 |
-
// Any extention would work
|
| 72 |
-
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
| 73 |
-
$uploader->setAllowRenameFiles(false);
|
| 74 |
-
|
| 75 |
-
// Set the file upload mode
|
| 76 |
-
// false -> get the file directly in the specified folder
|
| 77 |
-
// true -> get the file in the product like folders
|
| 78 |
-
// (file.jpg will go in something like /media/f/i/file.jpg)
|
| 79 |
-
$uploader->setFilesDispersion(false);
|
| 80 |
-
|
| 81 |
-
// We set media/Manufacturer as the upload dir
|
| 82 |
-
$path = Mage::getBaseDir('media') . DS ."Manufacturer". DS ;
|
| 83 |
-
$uploader->save($path, $_FILES['filename']['name']);
|
| 84 |
-
|
| 85 |
-
} catch (Exception $e) {
|
| 86 |
-
|
| 87 |
-
}
|
| 88 |
-
|
| 89 |
-
//If the uploaded file is not image it will mnot allow to save manufacturer
|
| 90 |
-
$fileName=$_FILES['filename']['name'];
|
| 91 |
-
$fileName=explode(".", $fileName);
|
| 92 |
-
//this way the name is saved in DB
|
| 93 |
-
try{
|
| 94 |
-
if($uploader->chechAllowedExtension($fileName[1]))
|
| 95 |
-
$data['filename'] = $_FILES['filename']['name'];
|
| 96 |
-
else{
|
| 97 |
-
Mage::getSingleton('adminhtml/session')->addError("Upload Image Files Only");
|
| 98 |
-
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
| 99 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
| 100 |
-
return;
|
| 101 |
-
}
|
| 102 |
-
}catch (Exception $e) {
|
| 103 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 104 |
-
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
| 105 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
| 106 |
-
return;
|
| 107 |
-
}
|
| 108 |
-
|
| 109 |
-
}
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
$model = Mage::getModel('manufacturer/manufacturer');
|
| 113 |
-
$model->setData($data)
|
| 114 |
-
->setId($this->getRequest()->getParam('id'));
|
| 115 |
-
|
| 116 |
-
try {
|
| 117 |
-
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
| 118 |
-
$model->setCreatedTime(now())
|
| 119 |
-
->setUpdateTime(now());
|
| 120 |
-
} else {
|
| 121 |
-
$model->setUpdateTime(now());
|
| 122 |
-
}
|
| 123 |
-
|
| 124 |
-
$model->save();
|
| 125 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('manufacturer')->__('Manufacturer was successfully saved'));
|
| 126 |
-
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
| 127 |
-
|
| 128 |
-
if ($this->getRequest()->getParam('back')) {
|
| 129 |
-
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
| 130 |
-
return;
|
| 131 |
-
}
|
| 132 |
-
$this->_redirect('*/*/');
|
| 133 |
-
return;
|
| 134 |
-
} catch (Exception $e) {
|
| 135 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 136 |
-
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
| 137 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
| 138 |
-
return;
|
| 139 |
-
}
|
| 140 |
-
}
|
| 141 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manufacturer')->__('Unable to find manufacturer to save'));
|
| 142 |
-
$this->_redirect('*/*/');
|
| 143 |
-
}
|
| 144 |
-
}
|
| 145 |
-
|
| 146 |
-
public function deleteAction() {
|
| 147 |
-
if( $this->getRequest()->getParam('id') > 0 ) {
|
| 148 |
-
try {
|
| 149 |
-
$model = Mage::getModel('manufacturer/manufacturer');
|
| 150 |
-
|
| 151 |
-
$model->setId($this->getRequest()->getParam('id'))
|
| 152 |
-
->delete();
|
| 153 |
-
|
| 154 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Manufacturer was successfully deleted'));
|
| 155 |
-
$this->_redirect('*/*/');
|
| 156 |
-
} catch (Exception $e) {
|
| 157 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 158 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
| 159 |
-
}
|
| 160 |
-
}
|
| 161 |
-
$this->_redirect('*/*/');
|
| 162 |
-
}
|
| 163 |
-
|
| 164 |
-
public function massDeleteAction() {
|
| 165 |
-
$manufacturerIds = $this->getRequest()->getParam('manufacturer');
|
| 166 |
-
if(!is_array($manufacturerIds)) {
|
| 167 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
| 168 |
-
} else {
|
| 169 |
-
try {
|
| 170 |
-
foreach ($manufacturerIds as $manufacturerId) {
|
| 171 |
-
$manufacturer = Mage::getModel('manufacturer/manufacturer')->load($manufacturerId);
|
| 172 |
-
$manufacturer->delete();
|
| 173 |
-
}
|
| 174 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(
|
| 175 |
-
Mage::helper('adminhtml')->__(
|
| 176 |
-
'Total of %d record(s) were successfully deleted', count($manufacturerIds)
|
| 177 |
-
)
|
| 178 |
-
);
|
| 179 |
-
} catch (Exception $e) {
|
| 180 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 181 |
-
}
|
| 182 |
-
}
|
| 183 |
-
$this->_redirect('*/*/index');
|
| 184 |
-
}
|
| 185 |
-
|
| 186 |
-
public function massStatusAction()
|
| 187 |
-
{
|
| 188 |
-
$manufacturerIds = $this->getRequest()->getParam('manufacturer');
|
| 189 |
-
if(!is_array($manufacturerIds)) {
|
| 190 |
-
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
| 191 |
-
} else {
|
| 192 |
-
try {
|
| 193 |
-
foreach ($manufacturerIds as $manufacturerId) {
|
| 194 |
-
$manufacturer = Mage::getSingleton('manufacturer/manufacturer')
|
| 195 |
-
->load($manufacturerId)
|
| 196 |
-
->setStatus($this->getRequest()->getParam('status'))
|
| 197 |
-
->setIsMassupdate(true)
|
| 198 |
-
->save();
|
| 199 |
-
}
|
| 200 |
-
$this->_getSession()->addSuccess(
|
| 201 |
-
$this->__('Total of %d record(s) were successfully updated', count($manufacturerIds))
|
| 202 |
-
);
|
| 203 |
-
} catch (Exception $e) {
|
| 204 |
-
$this->_getSession()->addError($e->getMessage());
|
| 205 |
-
}
|
| 206 |
-
}
|
| 207 |
-
$this->_redirect('*/*/index');
|
| 208 |
-
}
|
| 209 |
-
|
| 210 |
-
public function exportCsvAction()
|
| 211 |
-
{
|
| 212 |
-
$fileName = 'manufacturer.csv';
|
| 213 |
-
$content = $this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_grid')
|
| 214 |
-
->getCsv();
|
| 215 |
-
|
| 216 |
-
$this->_sendUploadResponse($fileName, $content);
|
| 217 |
-
}
|
| 218 |
-
|
| 219 |
-
public function exportXmlAction()
|
| 220 |
-
{
|
| 221 |
-
$fileName = 'manufacturer.xml';
|
| 222 |
-
$content = $this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_grid')
|
| 223 |
-
->getXml();
|
| 224 |
-
|
| 225 |
-
$this->_sendUploadResponse($fileName, $content);
|
| 226 |
-
}
|
| 227 |
-
|
| 228 |
-
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
| 229 |
-
{
|
| 230 |
-
$response = $this->getResponse();
|
| 231 |
-
$response->setHeader('HTTP/1.1 200 OK','');
|
| 232 |
-
$response->setHeader('Pragma', 'public', true);
|
| 233 |
-
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
| 234 |
-
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
| 235 |
-
$response->setHeader('Last-Modified', date('r'));
|
| 236 |
-
$response->setHeader('Accept-Ranges', 'bytes');
|
| 237 |
-
$response->setHeader('Content-Length', strlen($content));
|
| 238 |
-
$response->setHeader('Content-type', $contentType);
|
| 239 |
-
$response->setBody($content);
|
| 240 |
-
$response->sendResponse();
|
| 241 |
-
die;
|
| 242 |
-
}
|
| 243 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/controllers/IndexController.php
DELETED
|
@@ -1,47 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Bc_Manufacturer_IndexController extends Mage_Core_Controller_Front_Action
|
| 3 |
-
{
|
| 4 |
-
public function indexAction()
|
| 5 |
-
{
|
| 6 |
-
|
| 7 |
-
/*
|
| 8 |
-
* Load an object by id
|
| 9 |
-
* Request looking like:
|
| 10 |
-
* http://site.com/manufacturer?id=15
|
| 11 |
-
* or
|
| 12 |
-
* http://site.com/manufacturer/id/15
|
| 13 |
-
*/
|
| 14 |
-
/*
|
| 15 |
-
$manufacturer_id = $this->getRequest()->getParam('id');
|
| 16 |
-
|
| 17 |
-
if($manufacturer_id != null && $manufacturer_id != '') {
|
| 18 |
-
$manufacturer = Mage::getModel('manufacturer/manufacturer')->load($manufacturer_id)->getData();
|
| 19 |
-
} else {
|
| 20 |
-
$manufacturer = null;
|
| 21 |
-
}
|
| 22 |
-
*/
|
| 23 |
-
|
| 24 |
-
/*
|
| 25 |
-
* If no param we load a the last created item
|
| 26 |
-
*/
|
| 27 |
-
/*
|
| 28 |
-
if($manufacturer == null) {
|
| 29 |
-
$resource = Mage::getSingleton('core/resource');
|
| 30 |
-
$read= $resource->getConnection('core_read');
|
| 31 |
-
$manufacturerTable = $resource->getTableName('manufacturer');
|
| 32 |
-
|
| 33 |
-
$select = $read->select()
|
| 34 |
-
->from($manufacturerTable,array('manufacturer_id','title','content','status'))
|
| 35 |
-
->where('status',1)
|
| 36 |
-
->order('created_time DESC') ;
|
| 37 |
-
|
| 38 |
-
$manufacturer = $read->fetchRow($select);
|
| 39 |
-
}
|
| 40 |
-
Mage::register('manufacturer', $manufacturer);
|
| 41 |
-
*/
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
$this->loadLayout();
|
| 45 |
-
$this->renderLayout();
|
| 46 |
-
}
|
| 47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/etc/adminhtml.xml
DELETED
|
@@ -1,52 +0,0 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* @category Bc
|
| 5 |
-
* @package Bc_Font
|
| 6 |
-
* @author ModuleCreator
|
| 7 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 8 |
-
*/
|
| 9 |
-
-->
|
| 10 |
-
<config>
|
| 11 |
-
<menu>
|
| 12 |
-
<biztech module="manufacturer">
|
| 13 |
-
<children>
|
| 14 |
-
<logo module="manufacturer">
|
| 15 |
-
<title>Manage Manufacturer</title>
|
| 16 |
-
<sort_order>0</sort_order>
|
| 17 |
-
<action>manufacturer/adminhtml_manufacturer</action>
|
| 18 |
-
</logo>
|
| 19 |
-
</children>
|
| 20 |
-
</biztech>
|
| 21 |
-
</menu>
|
| 22 |
-
<acl>
|
| 23 |
-
<resources>
|
| 24 |
-
<all>
|
| 25 |
-
<title>Allow Everything</title>
|
| 26 |
-
</all>
|
| 27 |
-
<admin>
|
| 28 |
-
<children>
|
| 29 |
-
<biztech>
|
| 30 |
-
<title>Biztech</title>
|
| 31 |
-
<sort_order>10</sort_order>
|
| 32 |
-
<children>
|
| 33 |
-
<logo module="manufacturer" translate="title">
|
| 34 |
-
<title>Manage Manufacturer</title>
|
| 35 |
-
<sort_order>0</sort_order>
|
| 36 |
-
<action>manufacturer/adminhtml_manufacturer</action>
|
| 37 |
-
</logo>
|
| 38 |
-
</children>
|
| 39 |
-
</biztech>
|
| 40 |
-
</children>
|
| 41 |
-
</admin>
|
| 42 |
-
</resources>
|
| 43 |
-
</acl>
|
| 44 |
-
<layout>
|
| 45 |
-
<updates>
|
| 46 |
-
<manufacturer>
|
| 47 |
-
<file>manufacturer.xml</file>
|
| 48 |
-
</manufacturer>
|
| 49 |
-
</updates>
|
| 50 |
-
</layout>
|
| 51 |
-
|
| 52 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/etc/config.xml
DELETED
|
@@ -1,107 +0,0 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<config>
|
| 3 |
-
<modules>
|
| 4 |
-
<Bc_Manufacturer>
|
| 5 |
-
<version>1.1.4</version>
|
| 6 |
-
</Bc_Manufacturer>
|
| 7 |
-
</modules>
|
| 8 |
-
<frontend>
|
| 9 |
-
<routers>
|
| 10 |
-
<manufacturer>
|
| 11 |
-
<use>standard</use>
|
| 12 |
-
<args>
|
| 13 |
-
<module>Bc_Manufacturer</module>
|
| 14 |
-
<frontName>manufacturer</frontName>
|
| 15 |
-
</args>
|
| 16 |
-
</manufacturer>
|
| 17 |
-
</routers>
|
| 18 |
-
<layout>
|
| 19 |
-
<updates>
|
| 20 |
-
<manufacturer>
|
| 21 |
-
<file>manufacturer.xml</file>
|
| 22 |
-
</manufacturer>
|
| 23 |
-
</updates>
|
| 24 |
-
</layout>
|
| 25 |
-
</frontend>
|
| 26 |
-
<admin>
|
| 27 |
-
<routers>
|
| 28 |
-
<manufacturer>
|
| 29 |
-
<use>admin</use>
|
| 30 |
-
<args>
|
| 31 |
-
<module>Bc_Manufacturer</module>
|
| 32 |
-
<frontName>manufacturer</frontName>
|
| 33 |
-
</args>
|
| 34 |
-
</manufacturer>
|
| 35 |
-
</routers>
|
| 36 |
-
</admin>
|
| 37 |
-
<adminhtml>
|
| 38 |
-
<acl>
|
| 39 |
-
<resources>
|
| 40 |
-
<all>
|
| 41 |
-
<title>Allow Everything</title>
|
| 42 |
-
</all>
|
| 43 |
-
<admin>
|
| 44 |
-
<children>
|
| 45 |
-
<Bc_Manufacturer>
|
| 46 |
-
<title>Manufacturer Module</title>
|
| 47 |
-
<sort_order>10</sort_order>
|
| 48 |
-
</Bc_Manufacturer>
|
| 49 |
-
</children>
|
| 50 |
-
</admin>
|
| 51 |
-
</resources>
|
| 52 |
-
</acl>
|
| 53 |
-
<layout>
|
| 54 |
-
<updates>
|
| 55 |
-
<manufacturer>
|
| 56 |
-
<file>manufacturer.xml</file>
|
| 57 |
-
</manufacturer>
|
| 58 |
-
</updates>
|
| 59 |
-
</layout>
|
| 60 |
-
</adminhtml>
|
| 61 |
-
<global>
|
| 62 |
-
<models>
|
| 63 |
-
<manufacturer>
|
| 64 |
-
<class>Bc_Manufacturer_Model</class>
|
| 65 |
-
<resourceModel>manufacturer_mysql4</resourceModel>
|
| 66 |
-
</manufacturer>
|
| 67 |
-
<manufacturer_mysql4>
|
| 68 |
-
<class>Bc_Manufacturer_Model_Mysql4</class>
|
| 69 |
-
<entities>
|
| 70 |
-
<manufacturer>
|
| 71 |
-
<table>manufacturer</table>
|
| 72 |
-
</manufacturer>
|
| 73 |
-
</entities>
|
| 74 |
-
</manufacturer_mysql4>
|
| 75 |
-
</models>
|
| 76 |
-
<resources>
|
| 77 |
-
<manufacturer_setup>
|
| 78 |
-
<setup>
|
| 79 |
-
<module>Bc_Manufacturer</module>
|
| 80 |
-
</setup>
|
| 81 |
-
<connection>
|
| 82 |
-
<use>core_setup</use>
|
| 83 |
-
</connection>
|
| 84 |
-
</manufacturer_setup>
|
| 85 |
-
<manufacturer_write>
|
| 86 |
-
<connection>
|
| 87 |
-
<use>core_write</use>
|
| 88 |
-
</connection>
|
| 89 |
-
</manufacturer_write>
|
| 90 |
-
<manufacturer_read>
|
| 91 |
-
<connection>
|
| 92 |
-
<use>core_read</use>
|
| 93 |
-
</connection>
|
| 94 |
-
</manufacturer_read>
|
| 95 |
-
</resources>
|
| 96 |
-
<blocks>
|
| 97 |
-
<manufacturer>
|
| 98 |
-
<class>Bc_Manufacturer_Block</class>
|
| 99 |
-
</manufacturer>
|
| 100 |
-
</blocks>
|
| 101 |
-
<helpers>
|
| 102 |
-
<manufacturer>
|
| 103 |
-
<class>Bc_Manufacturer_Helper</class>
|
| 104 |
-
</manufacturer>
|
| 105 |
-
</helpers>
|
| 106 |
-
</global>
|
| 107 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Bc/Manufacturer/sql/manufacturer_setup/mysql4-install-0.1.0.php
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
$installer = $this;
|
| 4 |
-
|
| 5 |
-
$installer->startSetup();
|
| 6 |
-
|
| 7 |
-
$installer->run("
|
| 8 |
-
|
| 9 |
-
-- DROP TABLE IF EXISTS {$this->getTable('manufacturer')};
|
| 10 |
-
CREATE TABLE {$this->getTable('manufacturer')} (
|
| 11 |
-
`manufacturer_id` int(11) unsigned NOT NULL auto_increment,
|
| 12 |
-
`menufecturer_name` varchar(255) NOT NULL default '',
|
| 13 |
-
`filename` varchar(255) NOT NULL default '',
|
| 14 |
-
`content` text NOT NULL default '',
|
| 15 |
-
`status` smallint(6) NOT NULL default '0',
|
| 16 |
-
`created_time` datetime NULL,
|
| 17 |
-
`update_time` datetime NULL,
|
| 18 |
-
PRIMARY KEY (`manufacturer_id`)
|
| 19 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
| 20 |
-
|
| 21 |
-
");
|
| 22 |
-
|
| 23 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/manufacturer.xml
CHANGED
|
@@ -1,4 +1,26 @@
|
|
| 1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
<layout version="0.1.0">
|
| 3 |
<manufacturer_adminhtml_manufacturer_index>
|
| 4 |
<reference name="content">
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* Biztech Consultancy.
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
*
|
| 12 |
+
* DISCLAIMER
|
| 13 |
+
*
|
| 14 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 15 |
+
* versions in the future. If you wish to customize Magento for your
|
| 16 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
+
*
|
| 18 |
+
* @category Biztech Consultancy.
|
| 19 |
+
* @package Bc_Bcall
|
| 20 |
+
* @copyright Copyright (c) 2011 CODNITIVE Co. (http://www.biztechconsultancy.com)
|
| 21 |
+
* @license http://biztechconsultancy.com/licenses/license.txt Open Software License (OSL 3.0)
|
| 22 |
+
*/
|
| 23 |
+
-->
|
| 24 |
<layout version="0.1.0">
|
| 25 |
<manufacturer_adminhtml_manufacturer_index>
|
| 26 |
<reference name="content">
|
app/design/frontend/base/default/layout/manufacturer.xml
CHANGED
|
@@ -1,7 +1,37 @@
|
|
| 1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
<layout version="0.1.0">
|
| 3 |
<default>
|
|
|
|
|
|
|
|
|
|
| 4 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
<manufacturer_index_index>
|
| 6 |
<reference name="content">
|
| 7 |
<block type="manufacturer/manufacturer" name="manufacturer" template="manufacturer/manufacturer.phtml" />
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* Biztech Consultancy.
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
*
|
| 12 |
+
* DISCLAIMER
|
| 13 |
+
*
|
| 14 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 15 |
+
* versions in the future. If you wish to customize Magento for your
|
| 16 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
+
*
|
| 18 |
+
* @category Biztech Consultancy.
|
| 19 |
+
* @package Bc_Bcall
|
| 20 |
+
* @copyright Copyright (c) 2011 CODNITIVE Co. (http://www.biztechconsultancy.com)
|
| 21 |
+
* @license http://biztechconsultancy.com/licenses/license.txt Open Software License (OSL 3.0)
|
| 22 |
+
*/
|
| 23 |
+
-->
|
| 24 |
<layout version="0.1.0">
|
| 25 |
<default>
|
| 26 |
+
<reference name="top.links">
|
| 27 |
+
<action method="addLink" translate="label title" module="manufacturer" ifconfig="manufacturer/manufacturer_brand_list/manufacturer_list_enabled"><label>Manufacturers</label><url helper="manufacturer/getManufacturerUrl"/><title>Manufacturers</title><prepare/><urlParams/><position>20</position></action>
|
| 28 |
+
</reference>
|
| 29 |
</default>
|
| 30 |
+
<catalog_product_view>
|
| 31 |
+
<reference name="product.info">
|
| 32 |
+
<action method="setTemplate"><template>manufacturer/view.phtml</template></action>
|
| 33 |
+
</reference>
|
| 34 |
+
</catalog_product_view>
|
| 35 |
<manufacturer_index_index>
|
| 36 |
<reference name="content">
|
| 37 |
<block type="manufacturer/manufacturer" name="manufacturer" template="manufacturer/manufacturer.phtml" />
|
app/design/frontend/base/default/template/manufacturer/layer/filter.phtml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$layered_navigation_dimension=explode("x",Mage::getStoreConfig('manufacturer/manufacturer_general/layered_navigation_dimension'));
|
| 3 |
+
$width=30;
|
| 4 |
+
$height=30;
|
| 5 |
+
?>
|
| 6 |
+
<ol>
|
| 7 |
+
<?php
|
| 8 |
+
foreach ($this->getItems() as $_item):
|
| 9 |
+
$manufacturer_imge='';
|
| 10 |
+
?>
|
| 11 |
+
<li>
|
| 12 |
+
<?php
|
| 13 |
+
if (strtolower($this->getName())=='manufacturer'){
|
| 14 |
+
if(Mage::getStoreConfig("manufacturer/manufacturer_general/layered_navigation_enabled")==1){
|
| 15 |
+
$manufacturers=Mage::getModel('manufacturer/manufacturer')->getCollection()->addFieldToFilter('menufecturer_name',$_item->getValue())->addFieldToFilter('status',Array('eq'=>1))->load();
|
| 16 |
+
foreach ($manufacturers as $manufacturer){
|
| 17 |
+
$productModel = Mage::getModel('catalog/product');
|
| 18 |
+
$attr = $productModel->getResource()->getAttribute("manufacturer");
|
| 19 |
+
$manufacturer_name = $attr->getSource()->getOptionText($manufacturer->getMenufecturerName());
|
| 20 |
+
$manufacturer_imge=$manufacturer->getFilename();
|
| 21 |
+
}
|
| 22 |
+
if ($manufacturer_imge){
|
| 23 |
+
?>
|
| 24 |
+
<img src="<?php echo Mage::helper('manufacturer')->getManufacturerUrlFrontend($manufacturer_name,$manufacturer_imge,'small_thumb') ?>" alt="" class="manufacturer_image" title="<?php echo $manufacturer_name; ?>" />
|
| 25 |
+
<?php }
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
?>
|
| 29 |
+
<?php if ($_item->getCount() > 0): ?>
|
| 30 |
+
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a>
|
| 31 |
+
<?php else: echo $_item->getLabel() ?>
|
| 32 |
+
<?php endif; ?>
|
| 33 |
+
(<?php echo $_item->getCount() ?>)
|
| 34 |
+
</li>
|
| 35 |
+
<?php endforeach ?>
|
| 36 |
+
</ol>
|
app/design/frontend/base/default/template/manufacturer/manufacturer.phtml
CHANGED
|
@@ -1,88 +1,25 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
2) You can then just use the get(fieldname) to pull specific data from the table.
|
| 6 |
-
3) If you have a field named news_id, then it becomes getNewsId, etc.
|
| 7 |
-
*/
|
| 8 |
-
/*
|
| 9 |
-
$news = Mage::getModel('manufacturer/manufacturer')->load(15);
|
| 10 |
-
echo $news->getNewsId();
|
| 11 |
-
echo $news->getTitle();
|
| 12 |
-
echo $news->getContent();
|
| 13 |
-
echo $news->getStatus();
|
| 14 |
-
*/
|
| 15 |
-
|
| 16 |
-
/*
|
| 17 |
-
This shows an alternate way of loading datas from a record using the database the "Magento Way" (using blocks and controller).
|
| 18 |
-
Uncomment blocks in /app/code/local/Namespace/Module/controllers/IndexController.php if you want to use it.
|
| 19 |
-
|
| 20 |
-
*/
|
| 21 |
-
/*
|
| 22 |
-
$object = $this->getManufacturer();
|
| 23 |
-
echo 'id: '.$object['test_id'].'<br/>';
|
| 24 |
-
echo 'title: '.$object['title'].'<br/>';
|
| 25 |
-
echo 'content: '.$object['content'].'<br/>';
|
| 26 |
-
echo 'status: '.$object['status'].'<br/>';
|
| 27 |
-
*/
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
/*
|
| 31 |
-
This shows how to load multiple rows in a collection and save a change to them.
|
| 32 |
-
1) The setPageSize function will load only 5 records per page and you can set the current Page with the setCurPage function.
|
| 33 |
-
2) The $collection->walk('save') allows you to save everything in the collection after all changes have been made.
|
| 34 |
-
*/
|
| 35 |
-
/*
|
| 36 |
-
$i = 0;
|
| 37 |
-
|
| 38 |
-
$collection = Mage::getModel('manufacturer/manufacturer')->getCollection();
|
| 39 |
-
$collection->setPageSize(5);
|
| 40 |
-
$collection->setCurPage(2);
|
| 41 |
-
$size = $collection->getSize();
|
| 42 |
-
$cnt = count($collection);
|
| 43 |
-
foreach ($collection as $item) {
|
| 44 |
-
$i = $i+1;
|
| 45 |
-
$item->setTitle($i);
|
| 46 |
-
echo $item->getTitle();
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
$collection->walk('save');
|
| 50 |
-
*/
|
| 51 |
-
|
| 52 |
-
/*
|
| 53 |
-
This shows how to load a single record and save a change.
|
| 54 |
-
1) Note the setTitle, this corresponds to the table field name, title, and then you pass it the text to change.
|
| 55 |
-
2) Call the save() function only on a single record.
|
| 56 |
-
*/
|
| 57 |
-
/*
|
| 58 |
-
$object = Mage::getModel('manufacturer/manufacturer')->load(1);
|
| 59 |
-
$object->setTitle('This is a changed title');
|
| 60 |
-
$object->save();
|
| 61 |
-
*/
|
| 62 |
-
?>
|
| 63 |
-
|
| 64 |
-
<?php
|
| 65 |
-
$maufacturers = Mage::getModel('manufacturer/manufacturer')->getCollection()->addFieldToFilter('status',Array('eq'=>1));
|
| 66 |
-
$_columnCount=4;
|
| 67 |
-
$i=0;
|
| 68 |
?>
|
| 69 |
<div class="manufacturer-list">
|
| 70 |
-
<?php foreach($maufacturers as $manufacturer): ?>
|
| 71 |
-
<?php if(Mage::getModel('eav/entity_attribute_source_table')->setAttribute(Mage::getModel('eav/entity_attribute')->load(Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product',"manufacturer")))->getOptionText($manufacturer->getMenufecturerName())): ?>
|
| 72 |
-
<?php if ($i++%$_columnCount==0): ?>
|
| 73 |
-
<ul>
|
| 74 |
-
<?php endif; ?>
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
<?php if ($i%$_columnCount==0 && $i!=count($maufacturers)): ?>
|
| 84 |
-
</ul>
|
| 85 |
-
<?php endif; ?>
|
| 86 |
-
<?php endif; ?>
|
| 87 |
-
<?php endforeach; ?>
|
| 88 |
</div>
|
| 1 |
<?php
|
| 2 |
+
$maufacturers = Mage::getModel('manufacturer/manufacturer')->getCollection()->addFieldToFilter('status',Array('eq'=>1));
|
| 3 |
+
$_columnCount=4;
|
| 4 |
+
$i=0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
?>
|
| 6 |
<div class="manufacturer-list">
|
| 7 |
+
<?php foreach($maufacturers as $manufacturer): ?>
|
| 8 |
+
<?php if(Mage::getModel('eav/entity_attribute_source_table')->setAttribute(Mage::getModel('eav/entity_attribute')->load(Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product',"manufacturer")))->getOptionText($manufacturer->getMenufecturerName())): ?>
|
| 9 |
+
<?php if ($i++%$_columnCount==0): ?>
|
| 10 |
+
<ul>
|
| 11 |
+
<?php endif; ?>
|
| 12 |
+
<li>
|
| 13 |
+
<a href="<?php echo $this->getBaseUrl()."catalogsearch/advanced/result/?manufacturer[]=".$manufacturer->getMenufecturerName() ?>">
|
| 14 |
+
<?php echo $this->getLayout()->createBlock('core/template')->setmanufacturerimage($manufacturer->getFilename())->setListPageFlag(1)->setmenufacturername($manufacturer->getMenufecturerName())->setTemplate('manufacturer/manufacturer_resize.phtml')->toHtml(); ?>
|
| 15 |
+
</a>
|
| 16 |
+
<div class="manufacturer-name">
|
| 17 |
+
<?php echo Mage::getModel('eav/entity_attribute_source_table')->setAttribute(Mage::getModel('eav/entity_attribute')->load(Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product',"manufacturer")))->getOptionText($manufacturer->getMenufecturerName()) ?>
|
| 18 |
+
</div>
|
| 19 |
+
</li>
|
| 20 |
+
<?php if ($i%$_columnCount==0 && $i!=count($maufacturers)): ?>
|
| 21 |
+
</ul>
|
| 22 |
+
<?php endif; ?>
|
| 23 |
+
<?php endif; ?>
|
| 24 |
+
<?php endforeach; ?>
|
| 25 |
</div>
|
app/design/frontend/base/default/template/manufacturer/manufacturer_resize.phtml
CHANGED
|
@@ -1,25 +1,20 @@
|
|
| 1 |
<?php
|
| 2 |
-
$manufacturer_imge=$this->getmanufacturerimage();
|
| 3 |
-
$list_page_flag=$this->getListPageFlag();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
?>
|
| 5 |
-
<?php
|
| 6 |
-
$imageUrl = Mage::getBaseUrl('media')."Manufacturer/".$manufacturer_imge;
|
| 7 |
-
// path of the resized image to be saved
|
| 8 |
-
// here, the resized image is saved in media/resized folder
|
| 9 |
-
$imageResized = Mage::getBaseDir('media').DS."Manufacturer".DS."resized".DS.$manufacturer_imge;
|
| 10 |
-
$dirImg=Mage::getBaseDir().str_replace("/",DS,strstr($imageUrl,'/media'));
|
| 11 |
-
|
| 12 |
-
// resize image only if the image file exists and the resized image file doesn't exist
|
| 13 |
-
// the image is resized proportionally with the width/height 135px
|
| 14 |
-
if (!file_exists($imageResized) && file_exists($dirImg)) :
|
| 15 |
-
$imageObj = new Varien_Image($dirImg);
|
| 16 |
-
$imageObj->constrainOnly(false);
|
| 17 |
-
$imageObj->keepAspectRatio(TRUE);
|
| 18 |
-
$imageObj->keepFrame(false);
|
| 19 |
-
$imageObj->backgroundColor(array(255,255,255));
|
| 20 |
-
$imageObj->resize(229,91);
|
| 21 |
-
$imageObj->save($imageResized);
|
| 22 |
-
endif;
|
| 23 |
-
?>
|
| 24 |
-
<img src="<?php echo Mage::getBaseUrl('media').'Manufacturer/resized/'.$manufacturer_imge ?>" alt="" class="manufacturer_image" />
|
| 25 |
|
| 1 |
<?php
|
| 2 |
+
$manufacturer_imge=$this->getmanufacturerimage();
|
| 3 |
+
$list_page_flag=$this->getListPageFlag();
|
| 4 |
+
$manufacturer_id=$this->getmenufacturername();
|
| 5 |
+
if (!$list_page_flag){
|
| 6 |
+
$layered_navigation_dimension=explode("x",Mage::getStoreConfig('manufacturer/manufacturer_product_view/product_view_dimension'));
|
| 7 |
+
$folder_name="product_thumb";
|
| 8 |
+
}
|
| 9 |
+
else{
|
| 10 |
+
$layered_navigation_dimension=explode("x",Mage::getStoreConfig('manufacturer/manufacturer_brand_list/manufacturer_list_dimension'));
|
| 11 |
+
$folder_name="large_thumb";
|
| 12 |
+
}
|
| 13 |
+
$width=229;
|
| 14 |
+
$height=91;
|
| 15 |
+
$productModel = Mage::getModel('catalog/product');
|
| 16 |
+
$attr = $productModel->getResource()->getAttribute("manufacturer");
|
| 17 |
+
$manufacturer_name = $attr->getSource()->getOptionText($manufacturer_id);
|
| 18 |
?>
|
| 19 |
+
<img src="<?php echo Mage::helper('manufacturer')->getManufacturerUrlFrontend($manufacturer_name,$manufacturer_imge,$folder_name) ?>" alt="" class="manufacturer_image" title="<?php echo $manufacturer_name; ?>" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
app/design/frontend/base/default/template/manufacturer/product_manufacturer.phtml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
<?php
|
| 3 |
$product=$this->getProduct();
|
| 4 |
if(Mage::getModel('eav/entity_attribute_source_table')->setAttribute(Mage::getModel('eav/entity_attribute')->load(Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product',"manufacturer")))->getOptionText($product->getData('manufacturer'))):
|
|
@@ -9,7 +8,7 @@ if(Mage::getModel('eav/entity_attribute_source_table')->setAttribute(Mage::getMo
|
|
| 9 |
?>
|
| 10 |
<div class="manufacturer-img-box">
|
| 11 |
<a href="<?php echo $this->getBaseUrl()."catalogsearch/advanced/result/?manufacturer[]=".$manufacturer->getMenufecturerName() ?>">
|
| 12 |
-
<?php echo $this->getLayout()->createBlock('core/template')->setmanufacturerimage($manufacturer->getFilename())->setTemplate('manufacturer/manufacturer_resize.phtml')->toHtml(); ?>
|
| 13 |
</a>
|
| 14 |
</div>
|
| 15 |
<?php }
|
|
|
|
| 1 |
<?php
|
| 2 |
$product=$this->getProduct();
|
| 3 |
if(Mage::getModel('eav/entity_attribute_source_table')->setAttribute(Mage::getModel('eav/entity_attribute')->load(Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product',"manufacturer")))->getOptionText($product->getData('manufacturer'))):
|
| 8 |
?>
|
| 9 |
<div class="manufacturer-img-box">
|
| 10 |
<a href="<?php echo $this->getBaseUrl()."catalogsearch/advanced/result/?manufacturer[]=".$manufacturer->getMenufecturerName() ?>">
|
| 11 |
+
<?php echo $this->getLayout()->createBlock('core/template')->setmanufacturerimage($manufacturer->getFilename())->setmenufacturername($manufacturer->getMenufecturerName())->setTemplate('manufacturer/manufacturer_resize.phtml')->toHtml(); ?>
|
| 12 |
</a>
|
| 13 |
</div>
|
| 14 |
<?php }
|
app/design/frontend/base/default/template/manufacturer/view.phtml
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$_helper = $this->helper('catalog/output');
|
| 3 |
+
$_product = $this->getProduct();
|
| 4 |
+
?>
|
| 5 |
+
<script type="text/javascript">
|
| 6 |
+
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
|
| 7 |
+
</script>
|
| 8 |
+
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
|
| 9 |
+
<div class="product-view">
|
| 10 |
+
<div class="product-essential">
|
| 11 |
+
<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
|
| 12 |
+
<div class="no-display">
|
| 13 |
+
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
|
| 14 |
+
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
| 15 |
+
</div>
|
| 16 |
+
|
| 17 |
+
<div class="product-shop">
|
| 18 |
+
<div class="product-name">
|
| 19 |
+
<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
+
<?php if ($this->canEmailToFriend()): ?>
|
| 23 |
+
<p class="email-friend"><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a></p>
|
| 24 |
+
<?php endif; ?>
|
| 25 |
+
|
| 26 |
+
<?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
|
| 27 |
+
<?php echo $this->getChildHtml('alert_urls') ?>
|
| 28 |
+
<?php echo $this->getChildHtml('product_type_data') ?>
|
| 29 |
+
<?php echo $this->getTierPriceHtml() ?>
|
| 30 |
+
<?php echo $this->getChildHtml('extrahint') ?>
|
| 31 |
+
|
| 32 |
+
<?php if (!$this->hasOptions()):?>
|
| 33 |
+
<div class="add-to-box">
|
| 34 |
+
<?php if($_product->isSaleable()): ?>
|
| 35 |
+
<?php echo $this->getChildHtml('addtocart') ?>
|
| 36 |
+
<?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
|
| 37 |
+
<span class="or"><?php echo $this->__('OR') ?></span>
|
| 38 |
+
<?php endif; ?>
|
| 39 |
+
<?php endif; ?>
|
| 40 |
+
<?php echo $this->getChildHtml('addto') ?>
|
| 41 |
+
</div>
|
| 42 |
+
<?php echo $this->getChildHtml('extra_buttons') ?>
|
| 43 |
+
<?php else:?>
|
| 44 |
+
<?php echo $this->getChildHtml('addto') ?>
|
| 45 |
+
<?php endif; ?>
|
| 46 |
+
|
| 47 |
+
<?php if ($_product->getShortDescription()):?>
|
| 48 |
+
<div class="short-description">
|
| 49 |
+
<h2><?php echo $this->__('Quick Overview') ?></h2>
|
| 50 |
+
<div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
|
| 51 |
+
</div>
|
| 52 |
+
<?php endif;?>
|
| 53 |
+
|
| 54 |
+
<?php echo $this->getChildHtml('other');?>
|
| 55 |
+
|
| 56 |
+
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
| 57 |
+
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
|
| 58 |
+
<?php endif;?>
|
| 59 |
+
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<div class="product-img-box">
|
| 63 |
+
<?php echo $this->getChildHtml('media') ?>
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
<div class="clearer"></div>
|
| 67 |
+
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
| 68 |
+
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
|
| 69 |
+
<?php endif;?>
|
| 70 |
+
</form>
|
| 71 |
+
<script type="text/javascript">
|
| 72 |
+
//<![CDATA[
|
| 73 |
+
var productAddToCartForm = new VarienForm('product_addtocart_form');
|
| 74 |
+
productAddToCartForm.submit = function(button){
|
| 75 |
+
if (this.validator.validate()) {
|
| 76 |
+
this.form.submit();
|
| 77 |
+
if (button && button != 'undefined') {
|
| 78 |
+
button.disabled = true;
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
}.bind(productAddToCartForm);
|
| 82 |
+
//]]>
|
| 83 |
+
</script>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<div class="product-collateral">
|
| 87 |
+
<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
|
| 88 |
+
<div class="box-collateral <?php echo "box-{$alias}"?>">
|
| 89 |
+
<?php if ($title = $this->getChildData($alias, 'title')):?>
|
| 90 |
+
<h2><?php echo $this->escapeHtml($title); ?></h2>
|
| 91 |
+
<?php endif;?>
|
| 92 |
+
<?php echo $html; ?>
|
| 93 |
+
</div>
|
| 94 |
+
<?php endforeach;?>
|
| 95 |
+
<?php echo $this->getChildHtml('upsell_products') ?>
|
| 96 |
+
<?php echo $this->getChildHtml('product_additional_data') ?>
|
| 97 |
+
</div>
|
| 98 |
+
<?php
|
| 99 |
+
if (Mage::getConfig()->getModuleConfig('Bc_Manufacturer')->is('active', 'true')):
|
| 100 |
+
if(Mage::getStoreConfig("manufacturer/manufacturer_product_view/product_view_enabled")==1):
|
| 101 |
+
?>
|
| 102 |
+
<div id="div_manufacturers">
|
| 103 |
+
<?php
|
| 104 |
+
echo $this->getLayout()->createBlock('manufacturer/manufacturer')->setProduct($_product)->setTemplate('manufacturer/product_manufacturer.phtml')->toHtml();;
|
| 105 |
+
?>
|
| 106 |
+
</div>
|
| 107 |
+
<?php
|
| 108 |
+
endif;
|
| 109 |
+
endif;
|
| 110 |
+
?>
|
| 111 |
+
</div>
|
app/etc/modules/Bc_Bcall.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<!--
|
| 3 |
/**
|
| 4 |
-
*
|
| 5 |
*
|
| 6 |
* NOTICE OF LICENSE
|
| 7 |
*
|
|
@@ -15,11 +15,10 @@
|
|
| 15 |
* versions in the future. If you wish to customize Magento for your
|
| 16 |
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
*
|
| 18 |
-
* @category
|
| 19 |
-
* @package
|
| 20 |
-
* @
|
| 21 |
-
* @
|
| 22 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 23 |
*/
|
| 24 |
-->
|
| 25 |
<config>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<!--
|
| 3 |
/**
|
| 4 |
+
* Biztech Consultancy.
|
| 5 |
*
|
| 6 |
* NOTICE OF LICENSE
|
| 7 |
*
|
| 15 |
* versions in the future. If you wish to customize Magento for your
|
| 16 |
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
*
|
| 18 |
+
* @category Biztech Consultancy.
|
| 19 |
+
* @package Bc_Bcall
|
| 20 |
+
* @copyright Copyright (c) 2011 CODNITIVE Co. (http://www.biztechconsultancy.com)
|
| 21 |
+
* @license http://biztechconsultancy.com/licenses/license.txt Open Software License (OSL 3.0)
|
|
|
|
| 22 |
*/
|
| 23 |
-->
|
| 24 |
<config>
|
app/etc/modules/Bc_Manufacturer.xml
CHANGED
|
@@ -1,4 +1,26 @@
|
|
| 1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Bc_Manufacturer>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* Biztech Consultancy.
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
*
|
| 12 |
+
* DISCLAIMER
|
| 13 |
+
*
|
| 14 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 15 |
+
* versions in the future. If you wish to customize Magento for your
|
| 16 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
| 17 |
+
*
|
| 18 |
+
* @category Biztech Consultancy.
|
| 19 |
+
* @package Bc_Bcall
|
| 20 |
+
* @copyright Copyright (c) 2011 CODNITIVE Co. (http://www.biztechconsultancy.com)
|
| 21 |
+
* @license http://biztechconsultancy.com/licenses/license.txt Open Software License (OSL 3.0)
|
| 22 |
+
*/
|
| 23 |
+
-->
|
| 24 |
<config>
|
| 25 |
<modules>
|
| 26 |
<Bc_Manufacturer>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>manufacturer_brand_logo</name>
|
| 4 |
-
<version>1.1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -39,11 +39,13 @@ echo $this->getLayout()->createBlock('manufacturer/manufacturer')->setP
|
|
| 39 |

|
| 40 |
<p>
|
| 41 |
The magento extension also provides a block which displays the entire brand logos list in one page. You can use this code wherever you want the list to be displayed.</p></description>
|
| 42 |
-
<notes>- Bug Fixing
|
|
|
|
|
|
|
| 43 |
<authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
|
| 44 |
-
<date>
|
| 45 |
-
<time>
|
| 46 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Bc_Manufacturer.xml" hash="
|
| 47 |
<compatible/>
|
| 48 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 49 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>manufacturer_brand_logo</name>
|
| 4 |
+
<version>1.1.6</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
| 39 |

|
| 40 |
<p>
|
| 41 |
The magento extension also provides a block which displays the entire brand logos list in one page. You can use this code wherever you want the list to be displayed.</p></description>
|
| 42 |
+
<notes>- Bug Fixing & Enhancement
|
| 43 |
+
- Manufacturer visible link in header panel
|
| 44 |
+
- Image upload issue while uploading image having space in name (< Magento 1.5)</notes>
|
| 45 |
<authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
|
| 46 |
+
<date>2013-02-18</date>
|
| 47 |
+
<time>09:47:15</time>
|
| 48 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Bc_Manufacturer.xml" hash="37fc0d87d00706eb9dcc1894056e9f54"/><file name="Bc_Bcall.xml" hash="c9f36d47e0771f3188425b077f88a056"/></dir></target><target name="magelocal"><dir name="Bc"><file name="Manufacturer" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Bcall" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="manufacturer.xml" hash="31a6d6c23c7dee5ea05bffd534e12b28"/></dir><dir name="template"><dir name="manufacturer"><dir><dir name="layer"><file name="filter.phtml" hash="ff241d46dbf5e264e3f2eb20fd2a78b4"/></dir></dir><file name="manufacturer.phtml" hash="bb6e7cdf32e23dd2728ff39a13309bf9"/><file name="manufacturer_resize.phtml" hash="804b384f84e752076c7da37574ef9eca"/><file name="product_manufacturer.phtml" hash="4977a98fb29cf1ac13e73d5bdab1555a"/><file name="view.phtml" hash="93f753478fe6d4fce47d8ff5776bd670"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="manufacturer.xml" hash="93ac4fe6257227dfbdfcd69804f0458b"/></dir></dir></dir></dir></target></contents>
|
| 49 |
<compatible/>
|
| 50 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 51 |
</package>
|
