Version Notes
FIrst release of the extension.
Download this release
Release Info
Developer | Sitewards Magento Team |
Extension | sitewards_disabledproducts |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Sitewards/DisabledProducts/Helper/Data.php +43 -0
- app/code/community/Sitewards/DisabledProducts/Model/Resource/Eav/Mysql4/Setup.php +43 -0
- app/code/community/Sitewards/DisabledProducts/Model/System/Config/Source/Cms/Block.php +39 -0
- app/code/community/Sitewards/DisabledProducts/etc/adminhtml.xml +32 -0
- app/code/community/Sitewards/DisabledProducts/etc/config.xml +64 -0
- app/code/community/Sitewards/DisabledProducts/etc/system.xml +61 -0
- app/code/community/Sitewards/DisabledProducts/sql/sitewards_disabledproducts_setup/mysql4-install-0.1.0.php +4 -0
- app/design/frontend/base/default/layout/sitewards/disabledproducts.xml +16 -0
- app/design/frontend/base/default/template/sitewards/disabledproducts/catalog/product/addtocart.phtml +13 -0
- app/etc/modules/Sitewards_DisabledProducts.xml +14 -0
- app/locale/de_DE/Sitewards_DisabledProducts.csv +6 -0
- package.xml +133 -0
app/code/community/Sitewards/DisabledProducts/Helper/Data.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sitewards_DisabledProducts_Helper_Data
|
4 |
+
*
|
5 |
+
* A helper class for the DisabledProducts extension
|
6 |
+
* Returns the id of the cms block and checks if the product is disabled
|
7 |
+
*
|
8 |
+
* @category Sitewards
|
9 |
+
* @package Sitewards_DisabledProducts
|
10 |
+
* @copyright Copyright (c) 2012 Sitewards GmbH (http://www.sitewards.com/de/)
|
11 |
+
*/
|
12 |
+
class Sitewards_DisabledProducts_Helper_Data extends Mage_Core_Helper_Abstract {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Variable to hold if the extension is active
|
16 |
+
*/
|
17 |
+
private $bEnabledExtension = null;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Returns cms block for disabled products defined in the extension config
|
21 |
+
*
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
public function getDisabledProductsBlock() {
|
25 |
+
return Mage::getStoreConfig('sitewards_disabledproducts_config/sitewards_disabledproducts_general/disabled_product_block');
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Returns if the extension is enabled and the given product disabled
|
30 |
+
*
|
31 |
+
* @param Mage_Catalog_Model_Product $oProduct
|
32 |
+
* @return boolean
|
33 |
+
*/
|
34 |
+
public function isProductDisabled(Mage_Catalog_Model_Product $oProduct){
|
35 |
+
$this->bEnabledExtension = Mage::getStoreConfig('sitewards_disabledproducts_config/sitewards_disabledproducts_general/enable_ext');
|
36 |
+
if ( $this->bEnabledExtension == true ) {
|
37 |
+
$oProduct = Mage::getModel('catalog/product')->load($oProduct->getId());
|
38 |
+
return $oProduct->getIsDisabled();
|
39 |
+
} else {
|
40 |
+
return false;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
app/code/community/Sitewards/DisabledProducts/Model/Resource/Eav/Mysql4/Setup.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sitewards_DisabledProducts_Model_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* adds the disabled attribute to products
|
6 |
+
* @return array
|
7 |
+
*/
|
8 |
+
public function getDefaultEntities()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
'catalog_product' => array(
|
12 |
+
'entity_model' => 'catalog/product',
|
13 |
+
'attribute_model' => 'catalog/resource_eav_attribute',
|
14 |
+
'table' => 'catalog/product',
|
15 |
+
'additional_attribute_table' => 'catalog/eav_attribute',
|
16 |
+
'entity_attribute_collection' => 'catalog/product_attribute_collection',
|
17 |
+
'attributes' => array(
|
18 |
+
'is_disabled' => array(
|
19 |
+
'group' => 'Sitewards Disabled',
|
20 |
+
'label' => 'Is Disabled',
|
21 |
+
'type' => 'int',
|
22 |
+
'input' => 'boolean',
|
23 |
+
'default' => '0',
|
24 |
+
'class' => '',
|
25 |
+
'backend' => '',
|
26 |
+
'frontend' => '',
|
27 |
+
'source' => '',
|
28 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
|
29 |
+
'visible' => true,
|
30 |
+
'required' => false,
|
31 |
+
'user_defined' => false,
|
32 |
+
'searchable' => false,
|
33 |
+
'filterable' => false,
|
34 |
+
'comparable' => false,
|
35 |
+
'visible_on_front' => false,
|
36 |
+
'visible_in_advanced_search' => false,
|
37 |
+
'unique' => false
|
38 |
+
),
|
39 |
+
),
|
40 |
+
),
|
41 |
+
);
|
42 |
+
}
|
43 |
+
}
|
app/code/community/Sitewards/DisabledProducts/Model/System/Config/Source/Cms/Block.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sitewards_DisabledProducts_Model_System_Config_Source_Cms_Block
|
4 |
+
*
|
5 |
+
* Backend model for cms blocks dropdown in the configuration section
|
6 |
+
*
|
7 |
+
* @category Sitewards
|
8 |
+
* @package Sitewards_DisabledProducts
|
9 |
+
* @copyright Copyright (c) 2012 Sitewards GmbH (http://www.sitewards.com/de/)
|
10 |
+
*/
|
11 |
+
class Sitewards_DisabledProducts_Model_System_Config_Source_Cms_Block {
|
12 |
+
|
13 |
+
protected $_options;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Returns all cms blocks as an array of values (block ids) and labels (block names)
|
17 |
+
* used in the admin config to select a block to be displayed instead of add-to-cart button
|
18 |
+
*
|
19 |
+
* @return array
|
20 |
+
*/
|
21 |
+
public function toOptionArray()
|
22 |
+
{
|
23 |
+
if (!$this->_options) {
|
24 |
+
$aBlockOptionsArray = array();
|
25 |
+
$aBlocksCollection = Mage::getResourceModel('cms/block_collection')->load();
|
26 |
+
|
27 |
+
foreach($aBlocksCollection as $oBlock){
|
28 |
+
$aOption = array(
|
29 |
+
'value' => $oBlock->getIdentifier(),
|
30 |
+
'label' => $oBlock->getTitle()
|
31 |
+
);
|
32 |
+
$aBlockOptionsArray[] = $aOption;
|
33 |
+
}
|
34 |
+
$this->_options = $aBlockOptionsArray;
|
35 |
+
|
36 |
+
}
|
37 |
+
return $this->_options;
|
38 |
+
}
|
39 |
+
}
|
app/code/community/Sitewards/DisabledProducts/etc/adminhtml.xml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* The adminhtml config file of the Sitewards DisabledProducts extension
|
5 |
+
*
|
6 |
+
* @category Sitewards
|
7 |
+
* @package Sitewards_DisabledProducts
|
8 |
+
* @copyright Copyright (c) 2012 Sitewards GmbH (http://www.sitewards.com/de/)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<acl>
|
13 |
+
<resources>
|
14 |
+
<admin>
|
15 |
+
<children>
|
16 |
+
<system>
|
17 |
+
<children>
|
18 |
+
<config>
|
19 |
+
<children>
|
20 |
+
<sitewards_disabledproducts_config translate="title">
|
21 |
+
<title>Sitewards DisabledProducts - Configuration</title>
|
22 |
+
<sort_order>1000</sort_order>
|
23 |
+
</sitewards_disabledproducts_config>
|
24 |
+
</children>
|
25 |
+
</config>
|
26 |
+
</children>
|
27 |
+
</system>
|
28 |
+
</children>
|
29 |
+
</admin>
|
30 |
+
</resources>
|
31 |
+
</acl>
|
32 |
+
</config>
|
app/code/community/Sitewards/DisabledProducts/etc/config.xml
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Sitewards_DisabledProducts>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Sitewards_DisabledProducts>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<sitewards_disabledproducts>
|
11 |
+
<class>Sitewards_DisabledProducts_Model</class>
|
12 |
+
</sitewards_disabledproducts>
|
13 |
+
</models>
|
14 |
+
<blocks>
|
15 |
+
<sitewards_disabledproducts>
|
16 |
+
<class>Sitewards_DisabledProducts_Block</class>
|
17 |
+
</sitewards_disabledproducts>
|
18 |
+
</blocks>
|
19 |
+
<helpers>
|
20 |
+
<sitewards_disabledproducts>
|
21 |
+
<class>Sitewards_DisabledProducts_Helper</class>
|
22 |
+
</sitewards_disabledproducts>
|
23 |
+
</helpers>
|
24 |
+
<resources>
|
25 |
+
<sitewards_disabledproducts_setup>
|
26 |
+
<setup>
|
27 |
+
<module>Sitewards_DisabledProducts</module>
|
28 |
+
<class>Sitewards_DisabledProducts_Model_Resource_Eav_Mysql4_Setup</class>
|
29 |
+
</setup>
|
30 |
+
<connection>
|
31 |
+
<use>core_setup</use>
|
32 |
+
</connection>
|
33 |
+
</sitewards_disabledproducts_setup>
|
34 |
+
</resources>
|
35 |
+
</global>
|
36 |
+
<adminhtml>
|
37 |
+
<translate>
|
38 |
+
<modules>
|
39 |
+
<sitewards_disabledproducts>
|
40 |
+
<files>
|
41 |
+
<default>Sitewards_DisabledProducts.csv</default>
|
42 |
+
</files>
|
43 |
+
</sitewards_disabledproducts>
|
44 |
+
</modules>
|
45 |
+
</translate>
|
46 |
+
</adminhtml>
|
47 |
+
<default>
|
48 |
+
<disabled_product_config>
|
49 |
+
<disabled_product_general>
|
50 |
+
<disabled_product_text>This product is not avalible to buy</disabled_product_text>
|
51 |
+
<enable_ext>1</enable_ext>
|
52 |
+
</disabled_product_general>
|
53 |
+
</disabled_product_config>
|
54 |
+
</default>
|
55 |
+
<frontend>
|
56 |
+
<layout>
|
57 |
+
<updates>
|
58 |
+
<sitewards_disabledproducts>
|
59 |
+
<file>sitewards/disabledproducts.xml</file>
|
60 |
+
</sitewards_disabledproducts>
|
61 |
+
</updates>
|
62 |
+
</layout>
|
63 |
+
</frontend>
|
64 |
+
</config>
|
app/code/community/Sitewards/DisabledProducts/etc/system.xml
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* The system config file of the Sitewards DisabledProducts extension
|
5 |
+
*
|
6 |
+
* @category Sitewards
|
7 |
+
* @package Sitewards_DisabledProducts
|
8 |
+
* @copyright Copyright (c) 2012 Sitewards GmbH (http://www.sitewards.com/de/)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<tabs>
|
13 |
+
<sitewards_disabledproducts_tab translate="label" module="sitewards_disabledproducts">
|
14 |
+
<label>Sitewards Disabled Products</label>
|
15 |
+
<sort_order>1001</sort_order>
|
16 |
+
</sitewards_disabledproducts_tab>
|
17 |
+
</tabs>
|
18 |
+
|
19 |
+
<sections>
|
20 |
+
<sitewards_disabledproducts_config translate="label" module="sitewards_disabledproducts">
|
21 |
+
<label>Configuration</label>
|
22 |
+
<tab>sitewards_disabledproducts_tab</tab>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>1</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<groups>
|
29 |
+
<sitewards_disabledproducts_general translate="label">
|
30 |
+
<label>General Options</label>
|
31 |
+
<fronted_type>text</fronted_type>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
<fields>
|
37 |
+
<enable_ext translate="label">
|
38 |
+
<label>Enable Sitewards "Disabled Products" Extension</label>
|
39 |
+
<frontend_type>select</frontend_type>
|
40 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
41 |
+
<sort_order>10</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
</enable_ext>
|
46 |
+
<disabled_product_block translate="label comment">
|
47 |
+
<label>Replacement cms block</label>
|
48 |
+
<comment>This block will be shown instead of the "add to cart" button</comment>
|
49 |
+
<frontend_type>select</frontend_type>
|
50 |
+
<source_model>sitewards_disabledproducts/system_config_source_cms_block</source_model>
|
51 |
+
<sort_order>20</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
</disabled_product_block>
|
56 |
+
</fields>
|
57 |
+
</sitewards_disabledproducts_general>
|
58 |
+
</groups>
|
59 |
+
</sitewards_disabledproducts_config>
|
60 |
+
</sections>
|
61 |
+
</config>
|
app/code/community/Sitewards/DisabledProducts/sql/sitewards_disabledproducts_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->installEntities();
|
app/design/frontend/base/default/layout/sitewards/disabledproducts.xml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<layout>
|
2 |
+
<catalog_product_view>
|
3 |
+
<reference name="product.info.addtocart">
|
4 |
+
<action method="setTemplate">
|
5 |
+
<template>sitewards/disabledproducts/catalog/product/addtocart.phtml</template>
|
6 |
+
</action>
|
7 |
+
</reference>
|
8 |
+
</catalog_product_view>
|
9 |
+
<review_product_list>
|
10 |
+
<reference name="product.info.addtocart">
|
11 |
+
<action method="setTemplate">
|
12 |
+
<template>sitewards/disabledproducts/catalog/product/addtocart.phtml</template>
|
13 |
+
</action>
|
14 |
+
</reference>
|
15 |
+
</review_product_list>
|
16 |
+
</layout>
|
app/design/frontend/base/default/template/sitewards/disabledproducts/catalog/product/addtocart.phtml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $_product = $this->getProduct(); ?>
|
2 |
+
<?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($_product)): ?>
|
3 |
+
<?php
|
4 |
+
echo $this->setTemplate('catalog/product/view/addtocart.phtml')->toHtml();
|
5 |
+
?>
|
6 |
+
<?php else: ?>
|
7 |
+
<div class="add-to-cart">
|
8 |
+
<?php
|
9 |
+
$sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
|
10 |
+
echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
|
11 |
+
?>
|
12 |
+
</div>
|
13 |
+
<?php endif; ?>
|
app/etc/modules/Sitewards_DisabledProducts.xml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Sitewards_DisabledProducts>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<depends>
|
8 |
+
<Mage_Catalog />
|
9 |
+
<Mage_Cms />
|
10 |
+
<Mage_Adminhtml />
|
11 |
+
</depends>
|
12 |
+
</Sitewards_DisabledProducts>
|
13 |
+
</modules>
|
14 |
+
</config>
|
app/locale/de_DE/Sitewards_DisabledProducts.csv
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Configuration","Konfiguration"
|
2 |
+
"General Options","Allgemeine Optionen"
|
3 |
+
"Enable Sitewards ""Disabled Products"" Extension","Sitewards-Extension ""Disabled Products"" aktivieren"
|
4 |
+
"Replacement cms block","Ersatz-CMS-Block"
|
5 |
+
"This block will be shown instead of the ""add to cart"" button","Dieser Block wird statt des ""In den Warenkorb""-Buttons angezeigt"
|
6 |
+
"Is Disabled","Ist deaktiviert"
|
package.xml
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>sitewards_disabledproducts</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Extension to disable the add-to-cart button on products and to display a static cms block instead.</summary>
|
10 |
+
<description>Magento extension to disable the add-to-cart button on products and to display a static cms block instead.
|
11 |
+

|
12 |
+
Customization
|
13 |
+
-------------
|
14 |
+

|
15 |
+
* You can define the cms block to be displayed instead of the add-to-cart button
|
16 |
+
* You can set products as disabled in the products details
|
17 |
+

|
18 |
+
Installation instructions
|
19 |
+
-------------------------
|
20 |
+

|
21 |
+
1. Copy all files in the root of Magento directory.
|
22 |
+
2. Manually adjust following files by replacing all blocks with "-" by blocks with "+"
|
23 |
+
This is required, because the standard magento theme doesn't always use blocks for the add-to-cart button, but contains it directly in other template files
|
24 |
+

|
25 |
+
app\design\frontend\base\default\template\catalog\product\list.phtml
|
26 |
+
line 60 - 64
|
27 |
+
- <?php if($_product->isSaleable()): ?>
|
28 |
+
- <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
29 |
+
- <?php else: ?>
|
30 |
+
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
31 |
+
- <?php endif; ?>
|
32 |
+
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($_product)): ?>
|
33 |
+
+ <?php if($_product->isSaleable()): ?>
|
34 |
+
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
35 |
+
+ <?php else: ?>
|
36 |
+
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
37 |
+
+ <?php endif; ?>
|
38 |
+
+ <?php else: ?>
|
39 |
+
+ <?php
|
40 |
+
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
|
41 |
+
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
|
42 |
+
+ ?>
|
43 |
+
+ <?php endif; ?>
|
44 |
+

|
45 |
+
app\design\frontend\base\default\template\catalog\product\compare\list.phtml
|
46 |
+
line 67-71
|
47 |
+
- <?php if($_item->isSaleable()): ?>
|
48 |
+
- <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
49 |
+
- <?php else: ?>
|
50 |
+
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
51 |
+
- <?php endif; ?>
|
52 |
+
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($_item)): ?>
|
53 |
+
+ <?php if($_item->isSaleable()): ?>
|
54 |
+
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
55 |
+
+ <?php else: ?>
|
56 |
+
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
57 |
+
+ <?php endif; ?>
|
58 |
+
+ <?php else: ?>
|
59 |
+
+ <?php
|
60 |
+
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
|
61 |
+
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
|
62 |
+
+ ?>
|
63 |
+
+ <?php endif; ?>
|
64 |
+

|
65 |
+
app\design\frontend\base\default\template\catalog\product\compare\list.phtml
|
66 |
+
line 127-131
|
67 |
+
- <?php if($_item->isSaleable()): ?>
|
68 |
+
- <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
69 |
+
- <?php else: ?>
|
70 |
+
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
71 |
+
- <?php endif; ?>
|
72 |
+
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($_item)): ?>
|
73 |
+
+ <?php if($_item->isSaleable()): ?>
|
74 |
+
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
75 |
+
+ <?php else: ?>
|
76 |
+
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
77 |
+
+ <?php endif; ?>
|
78 |
+
+ <?php else: ?>
|
79 |
+
+ <?php
|
80 |
+
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
|
81 |
+
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
|
82 |
+
+ ?>
|
83 |
+
+ <?php endif; ?>
|
84 |
+

|
85 |
+
app\design\frontend\base\default\template\wishlist\item\column\cart.phtml
|
86 |
+
line 34-47
|
87 |
+
- <div class="add-to-cart-alt">
|
88 |
+
- <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?>
|
89 |
+
- <input type="text" class="input-text qty validate-not-negative-number" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" />
|
90 |
+
- <?php endif; ?>
|
91 |
+
- <?php if ($product->isSaleable()): ?>
|
92 |
+
- <button type="button" title="<?php echo $this->__('Add to Cart') ?>" onclick="addWItemToCart(<?php echo $item->getId()?>);" class="button btn-cart"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
93 |
+
- <?php else: ?>
|
94 |
+
- <?php if ($product->getIsSalable()): ?>
|
95 |
+
- <p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
|
96 |
+
- <?php else: ?>
|
97 |
+
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
98 |
+
- <?php endif; ?>
|
99 |
+
- <?php endif; ?>
|
100 |
+
- </div>
|
101 |
+
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($product)): ?>
|
102 |
+
+ <div class="add-to-cart-alt">
|
103 |
+
+ <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?>
|
104 |
+
+ <input type="text" class="input-text qty validate-not-negative-number" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" />
|
105 |
+
+ <?php endif; ?>
|
106 |
+
+ <?php if ($product->isSaleable()): ?>
|
107 |
+
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" onclick="addWItemToCart(<?php echo $item->getId()?>);" class="button btn-cart"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
108 |
+
+ <?php else: ?>
|
109 |
+
+ <?php if ($product->getIsSalable()): ?>
|
110 |
+
+ <p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
|
111 |
+
+ <?php else: ?>
|
112 |
+
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
113 |
+
+ <?php endif; ?>
|
114 |
+
+ <?php endif; ?>
|
115 |
+
+ </div>
|
116 |
+
+ <?php else: ?>
|
117 |
+
+ <div class="add-to-cart-alt">
|
118 |
+
+ <?php
|
119 |
+
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
|
120 |
+
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
|
121 |
+
+ ?>
|
122 |
+
+ </div>
|
123 |
+
+ <?php endif; ?>
|
124 |
+

|
125 |
+
contact: http://www.sitewards.com</description>
|
126 |
+
<notes>FIrst release of the extension.</notes>
|
127 |
+
<authors><author><name>Sitewards Magento Team</name><user>sitewards</user><email>magento@sitewards.com</email></author></authors>
|
128 |
+
<date>2013-02-06</date>
|
129 |
+
<time>10:22:10</time>
|
130 |
+
<contents><target name="magecommunity"><dir name="Sitewards"><dir name="DisabledProducts"><dir name="Helper"><file name="Data.php" hash="302491d171637f882ac9f5126a1a95d1"/></dir><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="0fe90fe89e042e56f8fe60972d6409e8"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Cms"><file name="Block.php" hash="af40acf0688f4471be2a0cb1878cc7a4"/></dir></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d98117511961c714288ded79e3f19769"/><file name="config.xml" hash="201c724b1c4a3242b42ba4b42a531653"/><file name="system.xml" hash="c1379df86a31ee9d570772062f8c81f4"/></dir><dir name="sql"><dir name="sitewards_disabledproducts_setup"><file name="mysql4-install-0.1.0.php" hash="2df441a6f1f7a7be6734c0e9105fda17"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sitewards_DisabledProducts.xml" hash="700a3b6a5d74b3b66531ca90bfab874c"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Sitewards_DisabledProducts.csv" hash="6190d8e2ad571e8bdeacde9c0aae9efd"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="sitewards"><file name="disabledproducts.xml" hash="b47a1dfc4b1bb9b3f2ff1ef4be472eea"/></dir></dir><dir name="template"><dir name="sitewards"><dir name="disabledproducts"><dir name="catalog"><dir name="product"><file name="addtocart.phtml" hash="ff2aa2106d8eff05ae0fb87244eb657d"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
131 |
+
<compatible/>
|
132 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
133 |
+
</package>
|