Version Notes
The release version
Download this release
Release Info
Developer | Commercers |
Extension | Commercers_ShowQtyDecimal |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Commercers/ShowQtyDecimal/Block/Adminhtml/Catalog/Product/Edit/Tab/Inventory.php +20 -0
- app/code/local/Commercers/ShowQtyDecimal/Helper/Data.php +10 -0
- app/code/local/Commercers/ShowQtyDecimal/etc/adminhtml.xml +28 -0
- app/code/local/Commercers/ShowQtyDecimal/etc/config.xml +62 -0
- app/code/local/Commercers/ShowQtyDecimal/etc/system.xml +39 -0
- app/design/adminhtml/default/default/layout/commercers/showqtydecimal.xml +0 -0
- app/design/adminhtml/default/default/template/catalog/product/tab/inventory-custom.phtml +254 -0
- app/etc/modules/Commercers_ShowQtyDecimal.xml +10 -0
- app/locale/de_DE/Commercers_showQtyDecimal.csv +1 -0
- package.xml +18 -0
app/code/local/Commercers/ShowQtyDecimal/Block/Adminhtml/Catalog/Product/Edit/Tab/Inventory.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: LEHUNG
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Commercers_ShowQtyDecimal_Block_Adminhtml_Catalog_Product_Edit_Tab_Inventory extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Inventory
|
8 |
+
{
|
9 |
+
const XML_PATH_ENABLE = 'commercers_showQtyDecimal/general/enabled';
|
10 |
+
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
parent::__construct();
|
14 |
+
$this->setTemplate('catalog/product/tab/inventory-custom.phtml');
|
15 |
+
}
|
16 |
+
|
17 |
+
protected function isShowQtyDecimal() {
|
18 |
+
return Mage::getStoreConfig(self::XML_PATH_ENABLE);
|
19 |
+
}
|
20 |
+
}
|
app/code/local/Commercers/ShowQtyDecimal/Helper/Data.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: LEHUNG
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Commercers_ShowQtyDecimal_Helper_Data extends Mage_Core_Helper_Data
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
app/code/local/Commercers/ShowQtyDecimal/etc/adminhtml.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<all>
|
6 |
+
<title>Allow everything</title>
|
7 |
+
</all>
|
8 |
+
<admin>
|
9 |
+
<children>
|
10 |
+
<system>
|
11 |
+
<children>
|
12 |
+
<config>
|
13 |
+
<children>
|
14 |
+
<!-- This is name of the section created by us -->
|
15 |
+
<commercers_showQtyDecimal translate="title" module="commercers_showQtyDecimal">
|
16 |
+
<!-- Title as shown in User->Roles->Permissions Window -->
|
17 |
+
<title>Show Qty Uses Decimals</title>
|
18 |
+
<sort_order>1</sort_order>
|
19 |
+
</commercers_showQtyDecimal>
|
20 |
+
</children>
|
21 |
+
</config>
|
22 |
+
</children>
|
23 |
+
</system>
|
24 |
+
</children>
|
25 |
+
</admin>
|
26 |
+
</resources>
|
27 |
+
</acl>
|
28 |
+
</config>
|
app/code/local/Commercers/ShowQtyDecimal/etc/config.xml
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Commercers_ShowQtyDecimal>
|
5 |
+
<version>1.0.1</version>
|
6 |
+
</Commercers_ShowQtyDecimal>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<helpers>
|
11 |
+
<commercers_showQtyDecimal>
|
12 |
+
<class>Commercers_ShowQtyDecimal_Helper</class>
|
13 |
+
</commercers_showQtyDecimal>
|
14 |
+
</helpers>
|
15 |
+
<blocks>
|
16 |
+
<adminhtml>
|
17 |
+
<rewrite>
|
18 |
+
<catalog_product_edit_tab_inventory>Commercers_ShowQtyDecimal_Block_Adminhtml_Catalog_Product_Edit_Tab_Inventory</catalog_product_edit_tab_inventory>
|
19 |
+
</rewrite>
|
20 |
+
</adminhtml>
|
21 |
+
</blocks>
|
22 |
+
</global>
|
23 |
+
|
24 |
+
<admin>
|
25 |
+
<routers>
|
26 |
+
<commercers_showQtyDecimal>
|
27 |
+
<use>admin</use>
|
28 |
+
<args>
|
29 |
+
<module>Commercers_ShowQtyDecimal</module>
|
30 |
+
<frontName>showqtydecimal</frontName>
|
31 |
+
</args>
|
32 |
+
</commercers_showQtyDecimal>
|
33 |
+
</routers>
|
34 |
+
</admin>
|
35 |
+
|
36 |
+
<adminhtml>
|
37 |
+
<layout>
|
38 |
+
<updates>
|
39 |
+
<commercers_showQtyDecimal>
|
40 |
+
<file>commercers/showqtydecimal.xml</file>
|
41 |
+
</commercers_showQtyDecimal>
|
42 |
+
</updates>
|
43 |
+
</layout>
|
44 |
+
<translate>
|
45 |
+
<modules>
|
46 |
+
<commercers_showQtyDecimal>
|
47 |
+
<files>
|
48 |
+
<default>Commercers_showQtyDecimal.csv</default>
|
49 |
+
</files>
|
50 |
+
</commercers_showQtyDecimal>
|
51 |
+
</modules>
|
52 |
+
</translate>
|
53 |
+
</adminhtml>
|
54 |
+
|
55 |
+
<default>
|
56 |
+
<commercers_massorderprocessing>
|
57 |
+
<general>
|
58 |
+
<enabled>1</enabled>
|
59 |
+
</general>
|
60 |
+
</commercers_massorderprocessing>
|
61 |
+
</default>
|
62 |
+
</config>
|
app/code/local/Commercers/ShowQtyDecimal/etc/system.xml
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<commercers translate="label" module="commercers_showQtyDecimal">
|
5 |
+
<label>Commercers</label>
|
6 |
+
</commercers>
|
7 |
+
</tabs>
|
8 |
+
<sections>
|
9 |
+
<commercers_showQtyDecimal translate="label" module="commercers_showQtyDecimal">
|
10 |
+
<class>separator-top</class>
|
11 |
+
<label>Show Qty Uses Decimals</label>
|
12 |
+
<tab>commercers</tab>
|
13 |
+
<sort_order>130</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<general translate="label">
|
19 |
+
<label>General</label>
|
20 |
+
<sort_order>1</sort_order>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<show_in_website>0</show_in_website>
|
23 |
+
<show_in_store>0</show_in_store>
|
24 |
+
<fields>
|
25 |
+
<enabled translate="label comment">
|
26 |
+
<label>Enabled</label>
|
27 |
+
<frontend_type>select</frontend_type>
|
28 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
29 |
+
<sort_order>1</sort_order>
|
30 |
+
<show_in_default>1</show_in_default>
|
31 |
+
<show_in_website>1</show_in_website>
|
32 |
+
<show_in_store>1</show_in_store>
|
33 |
+
</enabled>
|
34 |
+
</fields>
|
35 |
+
</general>
|
36 |
+
</groups>
|
37 |
+
</commercers_showQtyDecimal>
|
38 |
+
</sections>
|
39 |
+
</config>
|
app/design/adminhtml/default/default/layout/commercers/showqtydecimal.xml
ADDED
File without changes
|
app/design/adminhtml/default/default/template/catalog/product/tab/inventory-custom.phtml
ADDED
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$versionMagento = Mage::getVersionInfo();
|
3 |
+
$isVirtual = false;
|
4 |
+
if($versionMagento['minor'] >= 7) {
|
5 |
+
$isVirtual = true;
|
6 |
+
}
|
7 |
+
?>
|
8 |
+
<?php if ($this->isReadonly()):?>
|
9 |
+
<?php $_readonly = ' disabled="disabled" ';?>
|
10 |
+
<?php else: ?>
|
11 |
+
<?php $_readonly = '';?>
|
12 |
+
<?php endif; ?>
|
13 |
+
<div class="entry-edit">
|
14 |
+
<div class="entry-edit-head">
|
15 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Inventory') ?></h4>
|
16 |
+
</div>
|
17 |
+
<fieldset>
|
18 |
+
|
19 |
+
<legend><?php echo Mage::helper('catalog')->__('Inventory') ?></legend>
|
20 |
+
<table cellspacing="0" class="form-list" id="table_cataloginventory">
|
21 |
+
<tr>
|
22 |
+
<td class="label"><label for="inventory_manage_stock"><?php echo Mage::helper('catalog')->__('Manage Stock') ?></label></td>
|
23 |
+
<td class="value"><select id="inventory_manage_stock" name="<?php echo $this->getFieldSuffix() ?>[stock_data][manage_stock]" class="select" <?php echo $_readonly;?>>
|
24 |
+
<option value="1"><?php echo Mage::helper('catalog')->__('Yes') ?></option>
|
25 |
+
<option value="0"<?php if ($this->getConfigFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('No') ?></option>
|
26 |
+
</select>
|
27 |
+
<input type="hidden" id="inventory_manage_stock_default" value="<?php echo $this->getDefaultConfigValue('manage_stock'); ?>" />
|
28 |
+
|
29 |
+
<?php $_checked = ($this->getFieldValue('use_config_manage_stock') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
30 |
+
<input type="checkbox" id="inventory_use_config_manage_stock" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_manage_stock]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?>/>
|
31 |
+
<label for="inventory_use_config_manage_stock" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
32 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_manage_stock'), $('inventory_use_config_manage_stock').parentNode);</script><?php endif; ?></td>
|
33 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
34 |
+
</tr>
|
35 |
+
|
36 |
+
<?php if(!$this->getProduct()->isComposite()): ?>
|
37 |
+
<tr>
|
38 |
+
<td class="label"><label for="inventory_qty"><?php echo Mage::helper('catalog')->__('Qty') ?><span class="required">*</span></label></td>
|
39 |
+
<td class="value">
|
40 |
+
<?php if (!$_readonly):?>
|
41 |
+
<input type="hidden" id="original_inventory_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][original_inventory_qty]" value="<?php echo $this->getFieldValue('qty')*1 ?>"/>
|
42 |
+
<?php endif;?>
|
43 |
+
<input type="text" class="input-text required-entry validate-number" id="inventory_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][qty]" value="<?php echo $this->getFieldValue('qty')*1 ?>" <?php echo $_readonly;?>/>
|
44 |
+
</td>
|
45 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
46 |
+
</tr>
|
47 |
+
|
48 |
+
<tr>
|
49 |
+
<td class="label"><label for="inventory_min_qty"><?php echo Mage::helper('catalog')->__('Qty for Item\'s Status to Become Out of Stock') ?></label></td>
|
50 |
+
<td class="value"><input type="text" class="input-text validate-number" id="inventory_min_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][min_qty]" value="<?php echo $this->getFieldValue('min_qty')*1 ?>" <?php echo $_readonly;?>/>
|
51 |
+
|
52 |
+
<?php $_checked = ($this->getFieldValue('use_config_min_qty') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
53 |
+
<input type="checkbox" id="inventory_use_config_min_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_min_qty]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" <?php echo $_readonly;?> />
|
54 |
+
<label for="inventory_use_config_min_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
55 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_min_qty'), $('inventory_use_config_min_qty').parentNode);</script><?php endif; ?></td>
|
56 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
57 |
+
</tr>
|
58 |
+
|
59 |
+
<tr>
|
60 |
+
<td class="label"><label for="inventory_min_sale_qty"><?php echo Mage::helper('catalog')->__('Minimum Qty Allowed in Shopping Cart') ?></label></td>
|
61 |
+
<td class="value"><input type="text" class="input-text validate-number" id="inventory_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][min_sale_qty]" value="<?php echo $this->getFieldValue('min_sale_qty')*1 ?>" <?php echo $_readonly;?>/>
|
62 |
+
|
63 |
+
<?php $_checked = ($this->getFieldValue('use_config_min_sale_qty') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
64 |
+
<input type="checkbox" id="inventory_use_config_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_min_sale_qty]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?> />
|
65 |
+
<label for="inventory_use_config_min_sale_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
66 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_min_sale_qty'), $('inventory_use_config_min_sale_qty').parentNode);</script><?php endif; ?></td>
|
67 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
68 |
+
</tr>
|
69 |
+
|
70 |
+
<tr>
|
71 |
+
<td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Maximum Qty Allowed in Shopping Cart') ?></label></td>
|
72 |
+
<td class="value"><input type="text" class="input-text validate-number" id="inventory_max_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][max_sale_qty]" value="<?php echo $this->getFieldValue('max_sale_qty')*1 ?>" <?php echo $_readonly;?> />
|
73 |
+
|
74 |
+
<?php $_checked = ($this->getFieldValue('use_config_max_sale_qty') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
75 |
+
<input type="checkbox" id="inventory_use_config_max_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_max_sale_qty]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?> />
|
76 |
+
<label for="inventory_use_config_max_sale_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
77 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_max_sale_qty'), $('inventory_use_config_max_sale_qty').parentNode);</script><?php endif; ?></td>
|
78 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
<?php if($this->canUseQtyDecimals()): ?>
|
82 |
+
<tr>
|
83 |
+
<td class="label"><label for="inventory_is_qty_decimal"><?php echo Mage::helper('catalog')->__('Qty Uses Decimals') ?></label></td>
|
84 |
+
<td class="value"><select id="inventory_is_qty_decimal" name="<?php echo $this->getFieldSuffix() ?>[stock_data][is_qty_decimal]" class="select" <?php echo $_readonly;?>>
|
85 |
+
<option value="0"><?php echo Mage::helper('catalog')->__('No') ?></option>
|
86 |
+
<option value="1"<?php if($this->getFieldValue('is_qty_decimal')==1): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('Yes') ?></option>
|
87 |
+
</select>
|
88 |
+
</td>
|
89 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
90 |
+
</tr>
|
91 |
+
|
92 |
+
<?php if($isVirtual): ?>
|
93 |
+
<?php if (!$this->isVirtual()) : ?>
|
94 |
+
<tr>
|
95 |
+
<td class="label"><label for="inventory_is_decimal_divided"><?php echo Mage::helper('catalog')->__('Can be Divided into Multiple Boxes for Shipping') ?></label></td>
|
96 |
+
<td class="value"><select id="inventory_is_decimal_divided" name="<?php echo $this->getFieldSuffix() ?>[stock_data][is_decimal_divided]" class="select" <?php echo $_readonly;?>>
|
97 |
+
<option value="0"><?php echo Mage::helper('catalog')->__('No') ?></option>
|
98 |
+
<option value="1"<?php if($this->getFieldValue('is_decimal_divided') == 1): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('Yes') ?></option>
|
99 |
+
</select>
|
100 |
+
</td>
|
101 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
102 |
+
</tr>
|
103 |
+
<?php endif; ?>
|
104 |
+
<?php endif; ?>
|
105 |
+
|
106 |
+
<?php endif; ?>
|
107 |
+
|
108 |
+
<tr>
|
109 |
+
<td class="label"><label for="inventory_backorders"><?php echo Mage::helper('catalog')->__('Backorders') ?></label></td>
|
110 |
+
<td class="value"><select id="inventory_backorders" name="<?php echo $this->getFieldSuffix() ?>[stock_data][backorders]" class="select" <?php echo $_readonly;?>>
|
111 |
+
<?php foreach ($this->getBackordersOption() as $option): ?>
|
112 |
+
<?php $_selected = ($option['value'] == $this->getFieldValue('backorders')) ? 'selected="selected"' : '' ?>
|
113 |
+
<option value="<?php echo $option['value'] ?>" <?php echo $_selected ?>><?php echo $option['label'] ?></option>
|
114 |
+
<?php endforeach; ?>
|
115 |
+
</select>
|
116 |
+
|
117 |
+
<?php $_checked = ($this->getFieldValue('use_config_backorders') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
118 |
+
<input type="checkbox" id="inventory_use_config_backorders" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_backorders]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?> />
|
119 |
+
<label for="inventory_use_config_backorders" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
120 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_backorders'), $('inventory_use_config_backorders').parentNode);</script><?php endif; ?></td>
|
121 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
122 |
+
</tr>
|
123 |
+
<tr>
|
124 |
+
<td class="label"><label for="inventory_notify_stock_qty"><?php echo Mage::helper('catalog')->__('Notify for Quantity Below') ?></label></td>
|
125 |
+
<td class="value"><input type="text" class="input-text validate-number" id="inventory_notify_stock_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][notify_stock_qty]" value="<?php echo $this->getFieldValue('notify_stock_qty')*1 ?>" <?php echo $_readonly;?>/>
|
126 |
+
|
127 |
+
<?php $_checked = ($this->getFieldValue('use_config_notify_stock_qty') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
128 |
+
<input type="checkbox" id="inventory_use_config_notify_stock_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_notify_stock_qty]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?>/>
|
129 |
+
<label for="inventory_use_config_notify_stock_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
130 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_notify_stock_qty'), $('inventory_use_config_notify_stock_qty').parentNode);</script><?php endif; ?></td>
|
131 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
132 |
+
</tr>
|
133 |
+
<?php endif; ?>
|
134 |
+
<tr>
|
135 |
+
<td class="label"><label for="inventory_enable_qty_increments"><?php echo Mage::helper('catalog')->__('Enable Qty Increments') ?></label></td>
|
136 |
+
<td class="value"><select id="inventory_enable_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[stock_data][enable_qty_increments]" class="select" <?php echo $_readonly;?>>
|
137 |
+
<option value="1"><?php echo Mage::helper('catalog')->__('Yes') ?></option>
|
138 |
+
<option value="0"<?php if ($this->getConfigFieldValue('enable_qty_increments') == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('No') ?></option>
|
139 |
+
</select>
|
140 |
+
<input type="hidden" id="inventory_enable_qty_increments_default" value="<?php echo $this->getDefaultConfigValue('enable_qty_increments'); ?>" />
|
141 |
+
|
142 |
+
<?php $_checked = ($this->getFieldValue('use_config_enable_qty_increments') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
143 |
+
<input type="checkbox" id="inventory_use_config_enable_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_enable_qty_increments]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?>/>
|
144 |
+
<label for="inventory_use_config_enable_qty_increments" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
145 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_enable_qty_increments'), $('inventory_use_config_enable_qty_increments').parentNode);</script><?php endif; ?></td>
|
146 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
147 |
+
</tr>
|
148 |
+
<tr>
|
149 |
+
<td class="label"><label for="inventory_qty_increments"><?php echo Mage::helper('catalog')->__('Qty Increments') ?></label></td>
|
150 |
+
<td class="value">
|
151 |
+
<input type="text" class="input-text validate-digits" id="inventory_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[stock_data][qty_increments]" value="<?php echo $this->getFieldValue('qty_increments')*1 ?>" <?php echo $_readonly;?>/>
|
152 |
+
<?php $_checked = ($this->getFieldValue('use_config_qty_increments') || $this->IsNew()) ? 'checked="checked"' : '' ?>
|
153 |
+
<input type="checkbox" id="inventory_use_config_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_qty_increments]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?>/>
|
154 |
+
<label for="inventory_use_config_qty_increments" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
|
155 |
+
<?php if (!$this->isReadonly()):?><script type="text/javascript">toggleValueElements($('inventory_use_config_qty_increments'), $('inventory_use_config_qty_increments').parentNode);</script><?php endif; ?></td>
|
156 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
157 |
+
</tr>
|
158 |
+
<tr>
|
159 |
+
<td class="label"><label for="inventory_stock_availability"><?php echo Mage::helper('catalog')->__('Stock Availability') ?></label></td>
|
160 |
+
<td class="value"><select id="inventory_stock_availability" name="<?php echo $this->getFieldSuffix() ?>[stock_data][is_in_stock]" class="select" <?php echo $_readonly;?>>
|
161 |
+
<?php foreach ($this->getStockOption() as $option): ?>
|
162 |
+
<?php $_selected = ($option['value'] == $this->getFieldValue('is_in_stock')) ? 'selected="selected"' : '' ?>
|
163 |
+
<option value="<?php echo $option['value'] ?>" <?php echo $_selected ?>><?php echo $option['label'] ?></option>
|
164 |
+
<?php endforeach; ?>
|
165 |
+
</select>
|
166 |
+
</td>
|
167 |
+
<td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
|
168 |
+
</tr>
|
169 |
+
</table>
|
170 |
+
</fieldset>
|
171 |
+
</div>
|
172 |
+
<script type="text/javascript">
|
173 |
+
//<![CDATA[
|
174 |
+
function changeManageStockOption()
|
175 |
+
{
|
176 |
+
var manageStock = $('inventory_use_config_manage_stock').checked
|
177 |
+
? $('inventory_manage_stock_default').value
|
178 |
+
: $('inventory_manage_stock').value;
|
179 |
+
var catalogInventoryNotManageStockFields = {
|
180 |
+
inventory_min_sale_qty: true,
|
181 |
+
inventory_max_sale_qty: true,
|
182 |
+
<?php if($this->isShowQtyDecimal()): ?>
|
183 |
+
inventory_is_qty_decimal: true,
|
184 |
+
inventory_is_decimal_divided: true,
|
185 |
+
<?php endif; ?>
|
186 |
+
inventory_enable_qty_increments : true,
|
187 |
+
inventory_qty_increments: true
|
188 |
+
};
|
189 |
+
|
190 |
+
$$('#table_cataloginventory tr').each(function(el) {
|
191 |
+
if (el == $('inventory_manage_stock').up(1)) {
|
192 |
+
return;
|
193 |
+
}
|
194 |
+
|
195 |
+
for (field in catalogInventoryNotManageStockFields) {
|
196 |
+
if ($(field) && ($(field).up(1) == el)) {
|
197 |
+
return;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
el[manageStock == 1 ? 'show' : 'hide']();
|
202 |
+
});
|
203 |
+
|
204 |
+
return true;
|
205 |
+
}
|
206 |
+
|
207 |
+
function applyEnableQtyIncrements() {
|
208 |
+
var enableQtyIncrements = $('inventory_use_config_enable_qty_increments').checked
|
209 |
+
? $('inventory_enable_qty_increments_default').value
|
210 |
+
: $('inventory_enable_qty_increments').value;
|
211 |
+
|
212 |
+
$('inventory_qty_increments').up('tr')[enableQtyIncrements == 1 ? 'show' : 'hide']();
|
213 |
+
}
|
214 |
+
|
215 |
+
function applyEnableDecimalDivided() {
|
216 |
+
<?php if($isVirtual): ?>
|
217 |
+
<?php if (!$this->isVirtual()) : ?>
|
218 |
+
$('inventory_is_decimal_divided').up('tr').hide();
|
219 |
+
<?php endif; ?>
|
220 |
+
<?php endif; ?>
|
221 |
+
$('inventory_qty_increments').removeClassName('validate-digits').removeClassName('validate-number');
|
222 |
+
$('inventory_min_sale_qty').removeClassName('validate-digits').removeClassName('validate-number');
|
223 |
+
if ($('inventory_is_qty_decimal').value == 1<?php if(!$this->isShowQtyDecimal()): ?> && $('inventory_manage_stock').value == 1<?php endif; ?>) {
|
224 |
+
<?php if($isVirtual): ?>
|
225 |
+
<?php if (!$this->isVirtual()) : ?>
|
226 |
+
$('inventory_is_decimal_divided').up('tr').show();
|
227 |
+
<?php endif; ?>
|
228 |
+
<?php endif; ?>
|
229 |
+
$('inventory_qty_increments').addClassName('validate-number');
|
230 |
+
$('inventory_min_sale_qty').addClassName('validate-number');
|
231 |
+
} else {
|
232 |
+
$('inventory_qty_increments').addClassName('validate-digits');
|
233 |
+
$('inventory_min_sale_qty').addClassName('validate-digits');
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
Event.observe(window, 'load', function() {
|
238 |
+
if ($('inventory_manage_stock') && $('inventory_use_config_manage_stock')) {
|
239 |
+
Event.observe($('inventory_manage_stock'), 'change', changeManageStockOption);
|
240 |
+
Event.observe($('inventory_use_config_manage_stock'), 'change', changeManageStockOption);
|
241 |
+
changeManageStockOption();
|
242 |
+
}
|
243 |
+
if ($('inventory_enable_qty_increments') && $('inventory_use_config_enable_qty_increments')) {
|
244 |
+
Event.observe($('inventory_enable_qty_increments'), 'change', applyEnableQtyIncrements);
|
245 |
+
Event.observe($('inventory_use_config_enable_qty_increments'), 'change', applyEnableQtyIncrements);
|
246 |
+
applyEnableQtyIncrements();
|
247 |
+
}
|
248 |
+
if ($('inventory_is_qty_decimal') && $('inventory_qty_increments') && $('inventory_min_sale_qty')) {
|
249 |
+
Event.observe($('inventory_is_qty_decimal'), 'change', applyEnableDecimalDivided);
|
250 |
+
applyEnableDecimalDivided();
|
251 |
+
}
|
252 |
+
});
|
253 |
+
//]]>
|
254 |
+
</script>
|
app/etc/modules/Commercers_ShowQtyDecimal.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Commercers_ShowQtyDecimal>
|
5 |
+
<active>true</active>
|
6 |
+
<version>1.0.1</version>
|
7 |
+
<codePool>local</codePool>
|
8 |
+
</Commercers_ShowQtyDecimal>
|
9 |
+
</modules>
|
10 |
+
</config>
|
app/locale/de_DE/Commercers_showQtyDecimal.csv
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Show Qty Uses Decimals,Dezimalstellen nutzen
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Commercers_ShowQtyDecimal</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>GLP 3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>The extension to show Qty Uses Decimals</summary>
|
10 |
+
<description>The extension to show Qty Uses Decimals</description>
|
11 |
+
<notes>The release version</notes>
|
12 |
+
<authors><author><name>Commercers</name><user>commercers</user><email>info@commercers.com</email></author></authors>
|
13 |
+
<date>2015-05-08</date>
|
14 |
+
<time>14:02:20</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Commercers"><dir name="ShowQtyDecimal"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Inventory.php" hash="b7a9517e062354070901c33048ec9124"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="42b2266d18c20e001f32c6577b29196a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ef7675fb20360a4a2095cf258e7e8c33"/><file name="config.xml" hash="014c23c484dba0b547561a66ecfda566"/><file name="system.xml" hash="da5521fa9dfe52e4a281a37b8820fc55"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="commercers"><file name="showqtydecimal.xml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir><dir name="template"><dir name="catalog"><dir name="product"><dir name="tab"><file name="inventory-custom.phtml" hash="def5184b178c5876699c75d3223d66ed"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Commercers_ShowQtyDecimal.xml" hash="5b0dbedbb42a6f8ca00d5558415d562b"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Commercers_showQtyDecimal.csv" hash="587d29ee2e627da2edb9e7ebaf9cf232"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|