Version Notes
This is 2.0.1 version with quantity dropdown for all product types.
Download this release
Release Info
Developer | Keshav |
Extension | Sourav_QuantityDropdown |
Version | 2.0.1 |
Comparing to | |
See all releases |
Code changes from version 2.0.0 to 2.0.1
- app/code/local/Sourav/QuantityDropdown/Block/View.php +5 -4
- app/code/local/Sourav/QuantityDropdown/etc/config.xml +1 -1
- app/code/local/Sourav/QuantityDropdown/sql/sourav_quantitydropdown_setup/upgrade-2.0.0-2.0.1.php +62 -0
- app/design/adminhtml/default/default/template/sourav_quantitydropdown/about.phtml +5 -5
- app/design/frontend/base/default/layout/sourav_quantitydropdown.xml +17 -5
- app/design/frontend/base/default/template/sourav_quantitydropdown/checkout/cart/item/default.phtml +306 -0
- app/design/frontend/base/default/template/sourav_quantitydropdown/product_view_addtocart.phtml +3 -0
- package.xml +6 -6
app/code/local/Sourav/QuantityDropdown/Block/View.php
CHANGED
@@ -11,10 +11,10 @@ class Sourav_QuantityDropdown_Block_View extends Mage_Catalog_Block_Product_View
|
|
11 |
|
12 |
function hasSimpleQuantity() {
|
13 |
$product = $this->getProduct();
|
14 |
-
$enableForProduct=$product->getResource()->getAttribute('
|
15 |
|
16 |
|
17 |
-
$hasValue=intval($product->
|
18 |
if($enableForProduct=="Yes" && $hasValue>0){
|
19 |
return true;
|
20 |
}else{
|
@@ -28,8 +28,9 @@ class Sourav_QuantityDropdown_Block_View extends Mage_Catalog_Block_Product_View
|
|
28 |
{
|
29 |
$product = $this->getProduct();
|
30 |
|
31 |
-
$QuantityOptions=$product->getResource()->getAttribute('
|
32 |
-
|
|
|
33 |
}
|
34 |
|
35 |
}
|
11 |
|
12 |
function hasSimpleQuantity() {
|
13 |
$product = $this->getProduct();
|
14 |
+
$enableForProduct=$product->getResource()->getAttribute('dream_quantity_enable')->getFrontend()->getValue($product);
|
15 |
|
16 |
|
17 |
+
$hasValue=intval($product->getDreamQuantityOption()) ;
|
18 |
if($enableForProduct=="Yes" && $hasValue>0){
|
19 |
return true;
|
20 |
}else{
|
28 |
{
|
29 |
$product = $this->getProduct();
|
30 |
|
31 |
+
$QuantityOptions=$product->getResource()->getAttribute('dream_quantity_option')->getFrontend()->getValue($product);
|
32 |
+
$QuantityOptions = rtrim($QuantityOptions, ',');
|
33 |
+
return $optionsArray = explode(",",$QuantityOptions);
|
34 |
}
|
35 |
|
36 |
}
|
app/code/local/Sourav/QuantityDropdown/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Sourav_QuantityDropdown>
|
5 |
-
<version>2.0.
|
6 |
</Sourav_QuantityDropdown>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Sourav_QuantityDropdown>
|
5 |
+
<version>2.0.1</version>
|
6 |
</Sourav_QuantityDropdown>
|
7 |
</modules>
|
8 |
<global>
|
app/code/local/Sourav/QuantityDropdown/sql/sourav_quantitydropdown_setup/upgrade-2.0.0-2.0.1.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
|
8 |
+
//$installer->removeAttribute('catalog_product','simple_quantity_enable');
|
9 |
+
//$installer->removeAttribute('catalog_product','simple_quantity');
|
10 |
+
|
11 |
+
|
12 |
+
$enableOption=array(
|
13 |
+
'group' => 'Product Quantity DropDown',
|
14 |
+
'type' => 'int',
|
15 |
+
'label' => 'Enable Dropdown Quantity Option',
|
16 |
+
'input' => 'boolean',
|
17 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
|
18 |
+
'visible' => true,
|
19 |
+
'source' => 'eav/entity_attribute_source_boolean',
|
20 |
+
'required' => false,
|
21 |
+
'searchable' => false,
|
22 |
+
'filterable' => false,
|
23 |
+
'comparable' => false,
|
24 |
+
'visible_on_front' =>true,
|
25 |
+
'unique' => false,
|
26 |
+
'apply_to' => '',
|
27 |
+
|
28 |
+
);
|
29 |
+
|
30 |
+
$installer->addAttribute('catalog_product','dream_quantity_enable',$enableOption);
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
$data=array(
|
39 |
+
'group' => 'Product Quantity DropDown',
|
40 |
+
'type' => 'varchar',
|
41 |
+
'label' => 'Product Quantity Options',
|
42 |
+
'input' => 'text',
|
43 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
|
44 |
+
'visible' => true,
|
45 |
+
'required' => false,
|
46 |
+
'searchable' => false,
|
47 |
+
'filterable' => false,
|
48 |
+
'comparable' => false,
|
49 |
+
'visible_on_front' =>true,
|
50 |
+
'unique' => false,
|
51 |
+
'apply_to' => '',
|
52 |
+
);
|
53 |
+
|
54 |
+
$installer->addAttribute('catalog_product','dream_quantity_option',$data);
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
|
62 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/template/sourav_quantitydropdown/about.phtml
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
<div class="dreamgnto-about-logo">
|
2 |
|
3 |
-
|
4 |
|
5 |
</div>
|
6 |
|
7 |
<div class="dreamgnto-about-info">
|
8 |
-
My name is
|
9 |
</br>
|
10 |
Email:keshavmage@gmail.com
|
11 |
</br>
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
|
16 |
|
17 |
</div>
|
1 |
<div class="dreamgnto-about-logo">
|
2 |
|
3 |
+
<img src="<?php echo $this->getSkinUrl('sourav_quantitydropdown/images/logo.jpg') ?>">
|
4 |
|
5 |
</div>
|
6 |
|
7 |
<div class="dreamgnto-about-info">
|
8 |
+
My name is Keshav Mage. I love magento.I have 3+ experience in magento customization.
|
9 |
</br>
|
10 |
Email:keshavmage@gmail.com
|
11 |
</br>
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
|
16 |
|
17 |
</div>
|
app/design/frontend/base/default/layout/sourav_quantitydropdown.xml
CHANGED
@@ -9,12 +9,24 @@
|
|
9 |
</default>
|
10 |
|
11 |
|
12 |
-
<
|
13 |
-
|
14 |
-
|
15 |
<action method="setTemplate"><template>sourav_quantitydropdown/product_view_addtocart.phtml</template></action>
|
16 |
</reference>
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
</layout>
|
9 |
</default>
|
10 |
|
11 |
|
12 |
+
<catalog_product_view translate="label">
|
13 |
+
|
14 |
+
<reference name="product.info.addtocart">
|
15 |
<action method="setTemplate"><template>sourav_quantitydropdown/product_view_addtocart.phtml</template></action>
|
16 |
</reference>
|
17 |
+
|
18 |
+
</catalog_product_view>
|
19 |
+
|
20 |
+
<checkout_cart_index>
|
21 |
+
<reference name="checkout.cart">
|
22 |
+
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>sourav_quantitydropdown/checkout/cart/item/default.phtml</template></action>
|
23 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>sourav_quantitydropdown/checkout/cart/item/default.phtml</template></action>
|
24 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>sourav_quantitydropdown/checkout/cart/item/default.phtml</template></action>
|
25 |
+
|
26 |
+
</reference>
|
27 |
+
|
28 |
+
</checkout_cart_index>
|
29 |
+
|
30 |
+
|
31 |
|
32 |
</layout>
|
app/design/frontend/base/default/template/sourav_quantitydropdown/checkout/cart/item/default.phtml
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$_item = $this->getItem();
|
3 |
+
$isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
|
4 |
+
$canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
|
5 |
+
|
6 |
+
$product =$_item->getProduct();
|
7 |
+
|
8 |
+
|
9 |
+
$proObj=Mage::getModel('catalog/product')->load($product->getId());
|
10 |
+
$enbleModule=Mage::helper('sourav_quantitydropdown')->isEnabled();
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
$enableForProduct=$proObj->getResource()->getAttribute('dream_quantity_enable')->getFrontend()->getValue($proObj);
|
17 |
+
|
18 |
+
|
19 |
+
$quantityRestriction=false;
|
20 |
+
|
21 |
+
$hasValue=intval($proObj->getDreamQuantityOption()) ;
|
22 |
+
if($enableForProduct=="Yes" && $hasValue>0){
|
23 |
+
$quantityRestriction=true;
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
$QuantityOptions=$proObj->getResource()->getAttribute('dream_quantity_option')->getFrontend()->getValue($proObj);
|
28 |
+
$QuantityOptions = rtrim($QuantityOptions, ',');
|
29 |
+
$optionsArray = explode(",",$QuantityOptions);
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
?>
|
34 |
+
<tr>
|
35 |
+
<td><?php if ($this->hasProductUrl()):?><a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image"><?php endif;?><img src="<?php echo $this->getProductThumbnail()->resize(75); ?>" width="75" height="75" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /><?php if ($this->hasProductUrl()):?></a><?php endif;?></td>
|
36 |
+
<td>
|
37 |
+
<h2 class="product-name">
|
38 |
+
<?php if ($this->hasProductUrl()):?>
|
39 |
+
<a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a>
|
40 |
+
<?php else: ?>
|
41 |
+
<?php echo $this->escapeHtml($this->getProductName()) ?>
|
42 |
+
<?php endif; ?>
|
43 |
+
</h2>
|
44 |
+
<?php if ($_options = $this->getOptionList()):?>
|
45 |
+
<dl class="item-options">
|
46 |
+
<?php foreach ($_options as $_option) : ?>
|
47 |
+
<?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
|
48 |
+
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
|
49 |
+
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
|
50 |
+
<?php if (isset($_formatedOptionValue['full_view'])): ?>
|
51 |
+
<div class="truncated_full_value">
|
52 |
+
<dl class="item-options">
|
53 |
+
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
|
54 |
+
<dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
|
55 |
+
</dl>
|
56 |
+
</div>
|
57 |
+
<?php endif; ?>
|
58 |
+
</dd>
|
59 |
+
<?php endforeach; ?>
|
60 |
+
</dl>
|
61 |
+
<?php endif;?>
|
62 |
+
<?php if ($messages = $this->getMessages()): ?>
|
63 |
+
<?php foreach ($messages as $message): ?>
|
64 |
+
<p class="item-msg <?php echo $message['type'] ?>">* <?php echo $this->escapeHtml($message['text']) ?></p>
|
65 |
+
<?php endforeach; ?>
|
66 |
+
<?php endif; ?>
|
67 |
+
<?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
|
68 |
+
<?php if ($addInfoBlock): ?>
|
69 |
+
<?php echo $addInfoBlock->setItem($_item)->toHtml() ?>
|
70 |
+
<?php endif;?>
|
71 |
+
</td>
|
72 |
+
<td class="a-center">
|
73 |
+
<?php if ($isVisibleProduct): ?>
|
74 |
+
<a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo $this->__('Edit item parameters') ?>"><?php echo $this->__('Edit') ?></a>
|
75 |
+
<?php endif ?>
|
76 |
+
</td>
|
77 |
+
<?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
|
78 |
+
<td class="a-center">
|
79 |
+
<?php if ($isVisibleProduct): ?>
|
80 |
+
<a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move'); ?></a>
|
81 |
+
<?php endif ?>
|
82 |
+
</td>
|
83 |
+
<?php endif ?>
|
84 |
+
|
85 |
+
<?php if ($canApplyMsrp): ?>
|
86 |
+
<td class="a-right"<?php if ($this->helper('tax')->displayCartBothPrices()): ?> colspan="2"<?php endif; ?>>
|
87 |
+
<span class="cart-price">
|
88 |
+
<span class="cart-msrp-unit"><?php echo $this->__('See price before order confirmation.'); ?></span>
|
89 |
+
<?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
|
90 |
+
<a id="<?php echo $helpLinkId ?>" href="#" class="map-help-link"><?php echo $this->__("What's this?"); ?></a>
|
91 |
+
<script type="text/javascript">
|
92 |
+
Catalog.Map.addHelpLink($('<?php echo $helpLinkId ?>'), "<?php echo $this->__("What's this?") ?>");
|
93 |
+
</script>
|
94 |
+
</span>
|
95 |
+
</td>
|
96 |
+
<?php else: ?>
|
97 |
+
|
98 |
+
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
99 |
+
<td class="a-right">
|
100 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
101 |
+
<span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
102 |
+
<?php else: ?>
|
103 |
+
<span class="cart-price">
|
104 |
+
<?php endif; ?>
|
105 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
106 |
+
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
|
107 |
+
<?php else: ?>
|
108 |
+
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
|
109 |
+
<?php endif; ?>
|
110 |
+
|
111 |
+
</span>
|
112 |
+
|
113 |
+
|
114 |
+
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
115 |
+
|
116 |
+
<div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
117 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
118 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
119 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
|
120 |
+
<?php endforeach; ?>
|
121 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
122 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
123 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
|
124 |
+
<?php endforeach; ?>
|
125 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
126 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
127 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
|
128 |
+
<?php endforeach; ?>
|
129 |
+
<?php endif; ?>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
133 |
+
<div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
134 |
+
<span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
|
135 |
+
</div>
|
136 |
+
<?php endif; ?>
|
137 |
+
<?php endif; ?>
|
138 |
+
</td>
|
139 |
+
<?php endif; ?>
|
140 |
+
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
141 |
+
<td>
|
142 |
+
<?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
|
143 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
144 |
+
<span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
145 |
+
<?php else: ?>
|
146 |
+
<span class="cart-price">
|
147 |
+
<?php endif; ?>
|
148 |
+
|
149 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
150 |
+
<?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
|
151 |
+
<?php else: ?>
|
152 |
+
<?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
|
153 |
+
<?php endif; ?>
|
154 |
+
|
155 |
+
</span>
|
156 |
+
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
157 |
+
|
158 |
+
<div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
159 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
160 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
161 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
|
162 |
+
<?php endforeach; ?>
|
163 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
164 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
165 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
|
166 |
+
<?php endforeach; ?>
|
167 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
168 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
169 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
|
170 |
+
<?php endforeach; ?>
|
171 |
+
<?php endif; ?>
|
172 |
+
</div>
|
173 |
+
|
174 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
175 |
+
<div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
176 |
+
<span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
|
177 |
+
</div>
|
178 |
+
<?php endif; ?>
|
179 |
+
<?php endif; ?>
|
180 |
+
</td>
|
181 |
+
<?php endif; ?>
|
182 |
+
<?php endif; ?>
|
183 |
+
<td class="a-center">
|
184 |
+
<?php
|
185 |
+
|
186 |
+
if($enbleModule && $quantityRestriction){
|
187 |
+
|
188 |
+
|
189 |
+
$arrayQuantity=$optionsArray;
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
?>
|
194 |
+
<select name="cart[<?php echo $_item->getId() ?>][qty]" class="required-entry" id="qty">
|
195 |
+
|
196 |
+
<?php
|
197 |
+
foreach($arrayQuantity as $optionValue){
|
198 |
+
if($this->getQty()==$optionValue){
|
199 |
+
?>
|
200 |
+
<option value="<?php echo $optionValue;?>" selected="selected"><?php echo $optionValue;?></option>
|
201 |
+
<?php }else{?>
|
202 |
+
<option value="<?php echo $optionValue;?>"><?php echo $optionValue;?></option>
|
203 |
+
|
204 |
+
<?php }}?>
|
205 |
+
|
206 |
+
</select>
|
207 |
+
|
208 |
+
<?php }else{?>
|
209 |
+
<input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" title="<?php echo $this->__('Qty') ?>" class="input-text qty" maxlength="12" />
|
210 |
+
<?php }?>
|
211 |
+
</td>
|
212 |
+
<?php if (($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
|
213 |
+
<td class="a-right">
|
214 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
215 |
+
<span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
216 |
+
<?php else: ?>
|
217 |
+
<span class="cart-price">
|
218 |
+
<?php endif; ?>
|
219 |
+
|
220 |
+
<?php if ($canApplyMsrp): ?>
|
221 |
+
<span class="cart-msrp-subtotal">--</span>
|
222 |
+
<?php else: ?>
|
223 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
224 |
+
<?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
|
225 |
+
<?php else: ?>
|
226 |
+
<?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
|
227 |
+
<?php endif; ?>
|
228 |
+
<?php endif; ?>
|
229 |
+
|
230 |
+
</span>
|
231 |
+
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
232 |
+
|
233 |
+
<div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
234 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
235 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
236 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
|
237 |
+
<?php endforeach; ?>
|
238 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
239 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
240 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
|
241 |
+
<?php endforeach; ?>
|
242 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
243 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
244 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
|
245 |
+
<?php endforeach; ?>
|
246 |
+
<?php endif; ?>
|
247 |
+
</div>
|
248 |
+
|
249 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
250 |
+
<div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
251 |
+
<span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
|
252 |
+
</div>
|
253 |
+
<?php endif; ?>
|
254 |
+
<?php endif; ?>
|
255 |
+
</td>
|
256 |
+
<?php endif; ?>
|
257 |
+
<?php if (($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
|
258 |
+
<td>
|
259 |
+
<?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
|
260 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
261 |
+
<span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
262 |
+
<?php else: ?>
|
263 |
+
<span class="cart-price">
|
264 |
+
<?php endif; ?>
|
265 |
+
|
266 |
+
<?php if ($canApplyMsrp): ?>
|
267 |
+
<span class="cart-msrp-subtotal">--</span>
|
268 |
+
<?php else: ?>
|
269 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
270 |
+
<?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
|
271 |
+
<?php else: ?>
|
272 |
+
<?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
|
273 |
+
<?php endif; ?>
|
274 |
+
<?php endif; ?>
|
275 |
+
|
276 |
+
</span>
|
277 |
+
|
278 |
+
|
279 |
+
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
280 |
+
|
281 |
+
<div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
282 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
283 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
284 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
|
285 |
+
<?php endforeach; ?>
|
286 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
287 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
288 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
|
289 |
+
<?php endforeach; ?>
|
290 |
+
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
291 |
+
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
292 |
+
<span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
|
293 |
+
<?php endforeach; ?>
|
294 |
+
<?php endif; ?>
|
295 |
+
</div>
|
296 |
+
|
297 |
+
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
298 |
+
<div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
299 |
+
<span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
|
300 |
+
</div>
|
301 |
+
<?php endif; ?>
|
302 |
+
<?php endif; ?>
|
303 |
+
</td>
|
304 |
+
<?php endif; ?>
|
305 |
+
<td class="a-center"><a href="<?php echo $this->getDeleteUrl()?>" title="<?php echo $this->__('Remove item')?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove item')?></a></td>
|
306 |
+
</tr>
|
app/design/frontend/base/default/template/sourav_quantitydropdown/product_view_addtocart.phtml
CHANGED
@@ -14,6 +14,9 @@ $_product = $this->getProduct();
|
|
14 |
if($enbleModule && $this->hasSimpleQuantity()){
|
15 |
|
16 |
$arrayQuantity=$this->getQuantityOptions();
|
|
|
|
|
|
|
17 |
|
18 |
?>
|
19 |
|
14 |
if($enbleModule && $this->hasSimpleQuantity()){
|
15 |
|
16 |
$arrayQuantity=$this->getQuantityOptions();
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
|
21 |
?>
|
22 |
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sourav_QuantityDropdown</name>
|
4 |
-
<version>2.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension allow to restrict the quantity of product. This extension enable you restrict the quantity at product page.Frontend user will choose the quantity from dropdown options.</summary>
|
10 |
<description>This extension allow to restrict the quantity of product. This extension enable you restrict the quantity at product page.Frontend user will choose the quantity from dropdown options.</description>
|
11 |
-
<notes>This is
|
12 |
-
<authors><author><name>Keshav</name><user>
|
13 |
-
<date>2015-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Sourav"><dir name="QuantityDropdown"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><file name="About.php" hash="42847779b6d8bfda865492d0bb877acc"/></dir></dir></dir></dir></dir><file name="View.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sourav_QuantityDropdown</name>
|
4 |
+
<version>2.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension allow to restrict the quantity of product. This extension enable you restrict the quantity at product page.Frontend user will choose the quantity from dropdown options.</summary>
|
10 |
<description>This extension allow to restrict the quantity of product. This extension enable you restrict the quantity at product page.Frontend user will choose the quantity from dropdown options.</description>
|
11 |
+
<notes>This is 2.0.1 version with quantity dropdown for all product types.</notes>
|
12 |
+
<authors><author><name>Keshav</name><user>Keshav</user><email>keshavmage@gmail.com</email></author></authors>
|
13 |
+
<date>2015-10-08</date>
|
14 |
+
<time>14:38:59</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Sourav"><dir name="QuantityDropdown"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><file name="About.php" hash="42847779b6d8bfda865492d0bb877acc"/></dir></dir></dir></dir></dir><file name="View.php" hash="504f1b54f2843ed2c7d44c12b165a037"/></dir><dir name="Helper"><file name="Data.php" hash="b676d718da302772d0af10e9340f5a07"/></dir><dir name="Model"><file name="Observer.php" hash="45c826b34a1fc546f8ae1d2e32a20875"/></dir><dir name="controllers"><file name="IndexController.php" hash="a0257c8f1fe492aa71b65299ce808979"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e88a9180a7ae0d982bbd6104606323c4"/><file name="config.xml" hash="a05225768b73f7e551d122524212cab1"/><file name="system.xml" hash="c3064b71f11f2c140367313394a2947a"/></dir><dir name="sql"><dir name="sourav_quantitydropdown_setup"><file name="mysql4-install-1.0.0.php" hash="19f149a14a9d76c5c085147ef40f57ab"/><file name="upgrade-1.0.0-2.0.0.php" hash="6a4ad7929d9b171246d3774379356445"/><file name="upgrade-2.0.0-2.0.1.php" hash="27081e72846affa341d95c2bd168ebce"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sourav_QuantityDropdown.xml" hash="932766620320cbac7ae50f10ef1f4bec"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="sourav_quantitydropdown.xml" hash="e6436c7ba61bfc954a24b927ff1036ee"/></dir><dir name="template"><dir name="sourav_quantitydropdown"><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="b1e1cdc1c36ec02f5cca4a5e3c988759"/></dir></dir></dir><file name="product_view_addtocart.phtml" hash="eda28054630a3aa25f6e1c0f95e774fc"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sourav_quantitydropdown.xml" hash="98ed78d65fd75d28f74b6821989a9310"/></dir><dir name="template"><dir name="sourav_quantitydropdown"><file name="about.phtml" hash="c97c1933368e5121a5d5517e2f7386b6"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="sourav_quantitydropdown"><file name="style.css" hash="8187baa9523186f94251b33b1da23fb3"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="sourav_quantitydropdown"><dir name="css"><file name="style.css" hash="30190908d2faedbf6faa31e763fde94c"/></dir><dir name="images"><file name="kinex_logo.png" hash="2c162e43a8781a725ec74b51c8375596"/><file name="logo.jpg" hash="5868d1cd6c21ce6f4c23eccbd3d8682f"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|