-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
119 lines (109 loc) · 7.14 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
DisabledProducts
===============
Magento extension to disable the add-to-cart button on products and to display a static cms block instead.
Customization
-------------
* You can define the cms block to be displayed instead of the add-to-cart button
* You can set products as disabled in the products details
Installation instructions
-------------------------
1. Copy all files in the root of Magento directory.
2. Manually adjust following files by replacing all blocks with "-" by blocks with "+"
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
app\design\frontend\base\default\template\catalog\product\list.phtml
line 60 - 64
- <?php if($_product->isSaleable()): ?>
- <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>
- <?php else: ?>
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
- <?php endif; ?>
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($_product)): ?>
+ <?php if($_product->isSaleable()): ?>
+ <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>
+ <?php else: ?>
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
+ <?php endif; ?>
+ <?php else: ?>
+ <?php
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
+ ?>
+ <?php endif; ?>
app\design\frontend\base\default\template\catalog\product\compare\list.phtml
line 67-71
- <?php if($_item->isSaleable()): ?>
- <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>
- <?php else: ?>
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
- <?php endif; ?>
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($_item)): ?>
+ <?php if($_item->isSaleable()): ?>
+ <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>
+ <?php else: ?>
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
+ <?php endif; ?>
+ <?php else: ?>
+ <?php
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
+ ?>
+ <?php endif; ?>
app\design\frontend\base\default\template\catalog\product\compare\list.phtml
line 127-131
- <?php if($_item->isSaleable()): ?>
- <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>
- <?php else: ?>
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
- <?php endif; ?>
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($_item)): ?>
+ <?php if($_item->isSaleable()): ?>
+ <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>
+ <?php else: ?>
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
+ <?php endif; ?>
+ <?php else: ?>
+ <?php
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
+ ?>
+ <?php endif; ?>
app\design\frontend\base\default\template\wishlist\item\column\cart.phtml
line 34-47
- <div class="add-to-cart-alt">
- <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?>
- <input type="text" class="input-text qty validate-not-negative-number" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" />
- <?php endif; ?>
- <?php if ($product->isSaleable()): ?>
- <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>
- <?php else: ?>
- <?php if ($product->getIsSalable()): ?>
- <p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
- <?php else: ?>
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
- <?php endif; ?>
- <?php endif; ?>
- </div>
+ <?php if (!Mage::helper('sitewards_disabledproducts')->isProductDisabled($product)): ?>
+ <div class="add-to-cart-alt">
+ <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?>
+ <input type="text" class="input-text qty validate-not-negative-number" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" />
+ <?php endif; ?>
+ <?php if ($product->isSaleable()): ?>
+ <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>
+ <?php else: ?>
+ <?php if ($product->getIsSalable()): ?>
+ <p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
+ <?php else: ?>
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
+ <?php endif; ?>
+ <?php endif; ?>
+ </div>
+ <?php else: ?>
+ <div class="add-to-cart-alt">
+ <?php
+ $sBlockId = Mage::helper('sitewards_disabledproducts')->getDisabledProductsBlock();
+ echo $this->getLayout()->createBlock('cms/block')->setBlockId($sBlockId)->toHtml();
+ ?>
+ </div>
+ <?php endif; ?>
contact: http://www.sitewards.com