How can we add custom input field after position in bundle items in bundle product?Create a sortable and...
In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were added to the source directory?
Use two 8s and two 3s to make the number 24
Does a phylactery of a lich have to be a box?
What is the purpose of easy combat scenarios that don't need resource expenditure?
use of 4/2 chord more compelling than root position?
Why avoid shared user accounts?
How can a school be getting an epidemic of whooping cough if most of the students are vaccinated?
Should I reinstall Linux when changing the laptop's CPU?
How much mayhem could I cause as a sentient fish?
Can a person refuse a presidential pardon?
kill -0 <PID> は何をするのでしょうか?
A curious equality of integrals involving the prime counting function?
Why is working on the same position for more than 15 years not a red flag?
How to make ice magic work from a scientific point of view?
Cookies - Should the toggles be on?
Citing paywalled articles accessed via illegal web sharing
Increment each digit in a number to form a new number
Is it a fallacy if someone claims they need an explanation for every word of your argument to the point where they don't understand common terms?
Has any human ever had the choice to leave Earth permanently?
How should I handle players who ignore the session zero agreement?
How can my powered armor quickly replace its ceramic plates?
Odd 74HCT1G125 behaviour
Cat is tipping over bed-side lamps during the night
Gear reduction on large turbofans
How can we add custom input field after position in bundle items in bundle product?
Create a sortable and filterable custom attribute to stand-alone entityBundle product with custom optionsHow can I convert simple product to bundle product programmaticallySQL Error While Adding Bundled ItemsNew input type Bundle ItemsHow to add custom input field on product page in 1.9.2?Magento add another custom dropdown field in bundle items of bundle productMagento bundle product not saving after upgradeMagento2 add new field in bundle item (in option selection)Magento 2.2.5: Add, Update and Delete existing products Custom Options
Following is my extension
app/code/local/Locker/Bundleoption/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Locker_Bundleoption>
<version>0.1.0</version>
</Locker_Bundleoption>
</modules>
<global>
<blocks>
<bundle>
<rewrite>
<adminhtml_catalog_product_edit_tab_bundle_option>Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option</adminhtml_catalog_product_edit_tab_bundle_option>
</rewrite>
</bundle>
</blocks>
<models>
<bundleoption>
<class>Locker_Bundleoption_Model</class>
<resourceModel>bundleoption_mysql4</resourceModel>
</bundleoption>
<bundleoption_mysql4>
<class>Locker_Bundleoption_Model_Mysql4</class>
<entities>
<bundleqty>
<table>catalog_product_bundle_option_bundleqty</table>
</bundleqty>
</entities>
</bundleoption_mysql4>
</models>
<resources>
<bundleoption_setup>
<setup>
<module>Locker_Bundleoption</module>
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</bundleoption_setup>
<bundleoption_write>
<connection>
<use>core_write</use>
</connection>
</bundleoption_write>
<bundleoption_read>
<connection>
<use>core_read</use>
</connection>
</bundleoption_read>
</resources>
</global>
<adminhtml>
<events>
<catalog_product_save_commit_after>
<observers>
<custom_field_observer>
<type>singleton</type>
<class>Locker_Bundleoption_Model_Observer</class>
<method>SaveDropdownAfterProductSave</method>
</custom_field_observer>
</observers>
</catalog_product_save_commit_after>
</events>
</adminhtml>
here is my block file in admin
app/code/local/Locker/Bundleoption/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php
<?php
class Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option extends Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option
{
public function getOptions()
{
if (!$this->_options) {
$this->getProduct()->getTypeInstance(true)->setStoreFilter($this->getProduct()->getStoreId(),
$this->getProduct());
$optionCollection = $this->getProduct()->getTypeInstance(true)->getOptionsCollection($this->getProduct());
$selectionCollection = $this->getProduct()->getTypeInstance(true)->getSelectionsCollection(
$this->getProduct()->getTypeInstance(true)->getOptionsIds($this->getProduct()),
$this->getProduct()
);
$this->_options = $optionCollection->appendSelections($selectionCollection);
/*echo "<pre>";
print_r($this->_options); die;*/
$storeId = $this->getProduct()->getData('store_id');
foreach ($this->_options as $option) {
//gets each option's id
$option_id = $option->getData('option_id');
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($option_id, "option_id");
if ($optionFixed->getId() != "") {
$id = (int)$optionFixed->getId();
$bundleqty = $optionFixed->getBundleqty();
//adds our new datas to option
$option->addData(array('fixedbundle_id'=> $id, 'bundleqty' => $bundleqty, 'is_new'=> 'no'));
} else {
$option->addData(array('fixedbundle_id'=> '', 'bundleqty' => '', 'is_new'=> 'yes'));
}
}
if ($this->getCanReadPrice() === false) {
foreach ($this->_options as $option) {
if ($option->getSelections()) {
foreach ($option->getSelections() as $selection) {
$selection->setCanReadPrice($this->getCanReadPrice());
$selection->setCanEditPrice($this->getCanEditPrice());
}
}
}
}
}
return $this->_options;
}
}
Here is the sql file
app/code/local/Locker/Bundleoption/sql/bundleoption_setup/mysql4-install-0.1.0.php
<?php //echo "string"; die;
$installer=$this;
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('bundleoption/bundleqty')};
CREATE TABLE {$this->getTable('bundleoption/bundleqty')} (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`store_id` int(11) NOT NULL default '0',
`option_id` int(11) NOT NULL,
`bundleqty` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$installer->endSetup();
Here are my model files
File 1 : app/code/local/Locker/Bundleoption/Model/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('yourmodule/fixedbundle');
}
}
File 2 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('bundleoption/bundleqty', 'id');
}
}
File 3 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty/Collection.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
protected function _construct(){
$this->_init('bundleoption/bundleqty');
}
}
File 4 : app/code/local/Locker/Bundleoption/Model/Observer.php
<?php
class Locker_Bundleoption_Model_Observer extends Mage_Core_Model_Abstract
{
public function SaveDropdownAfterProductSave($observer)
{
$product = Mage::registry('product');
if (Mage::registry('catalog_product_save_commit_after' . $product->getId())) {
return;
}
Mage::register('catalog_product_save_commit_after' . $product->getId(), true);
$model = Mage::getModel('bundleoption/bundleqty');
$optionCollection = $product->getTypeInstance(TRUE)->getOptionsCollection($product);
$bundleOptions = $product->getBundleOptionsData();
if (!empty($bundleOptions)) {
$storeId = (int)$product->getData('store_id');
foreach ($bundleOptions as $option) {
$optionId = (int)$option['option_id'];
$id = (int)$option['id'];
$isDeleted = (int)$option['delete'];
//use to set option_id for new options in our module
if ($optionId <= 0 || $optionId == "" || is_null($optionId)) {
foreach ($optionCollection as $new) {
if($new['type'] == $option['type'] && ( $new['title'] == $option['title'] || $new['default_title'] == $option['title'] )){
$optionId = $new['option_id'];
}
}
}
$data = array(
'option_id' => $optionId,
'store_id' => $storeId,
'bundleqty' => $option['bundleqty']
);
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($optionId, "option_id");
// id exist means already there is an entry in custom table
try {
if ($isDeleted == 1) {
$model->setId($id)->delete();
} else {
if ($optionFixed->getId() != ""){
$model->load($id);
$model->addData($data);
$model->setId($id)->save();
} else {
$model->setData($data);
$insertId = $model->save()->getId();
}
}
} catch (Exception $e) {
Mage::logException($e);
}
}
}
return $this;
}
}
Here is my phtml file changes
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml
<script type="text/javascript">
optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="option-box"> ' +
'<input id="fixedbundle_id" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][id]" value="{{id}}" />'+
'<input id="is_new" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][is_new]" value="{{is_new}}" />'+
'<div class="option-title"> ' +
'<label for="<?php echo $this->getFieldName() ?>[{{index}}][title]"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Default Title')) ?> <span class="required">*</span></label>' +
<?php if ($this->isDefaultStore()): ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
<?php else: ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
<?php endif; ?>
'<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
'</div>' +
'<table class="option-header" cellpadding="0" cellspacing="0">' +
'<thead>' +
'<tr>' +
<?php if (!$this->isDefaultStore()): ?>
'<th class="opt-title"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Store View Title')) ?> <span class="required">*</span></th>' +
<?php endif; ?>
'<th class="opt-type"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Input Type')) ?></th>' +
'<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Is Required')) ?></th>' +
'<th class="opt-order"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Position')) ?></th>' +
'<th class="opt-order bundleqty-assigned"><?php echo Mage::helper('bundle')->__('Bundle Quantity') ?></th>' +
'<th> </th>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{index}}][option_id]" value="{{option_id}}">' +
'<input type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][delete]" value="" class="delete">' +
<?php if (!$this->isDefaultStore()): ?>
'<td><input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title_store" value="{{title}}"></td>' +
<?php endif; ?>
'<td><?php echo $this->getTypeSelectHtml() ?></td>' +
'<td><?php echo $this->getRequireSelectHtml() ?></td>' +
'<td><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][position]" value="{{position}}"></td>' +
'<td class="bundleqty-assigned"><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][bundleqty]" value="{{bundleqty}}"></td>' +
'<td> <?php echo $this->jsQuoteEscape($this->getAddSelectionButtonHtml()) ?></td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'<div id="<?php echo $this->getFieldId() ?>_search_{{index}}">' +
'</div>' +
'</div>';
</script>
magento-1.9 event-observer custom-options bundle-product
add a comment |
Following is my extension
app/code/local/Locker/Bundleoption/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Locker_Bundleoption>
<version>0.1.0</version>
</Locker_Bundleoption>
</modules>
<global>
<blocks>
<bundle>
<rewrite>
<adminhtml_catalog_product_edit_tab_bundle_option>Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option</adminhtml_catalog_product_edit_tab_bundle_option>
</rewrite>
</bundle>
</blocks>
<models>
<bundleoption>
<class>Locker_Bundleoption_Model</class>
<resourceModel>bundleoption_mysql4</resourceModel>
</bundleoption>
<bundleoption_mysql4>
<class>Locker_Bundleoption_Model_Mysql4</class>
<entities>
<bundleqty>
<table>catalog_product_bundle_option_bundleqty</table>
</bundleqty>
</entities>
</bundleoption_mysql4>
</models>
<resources>
<bundleoption_setup>
<setup>
<module>Locker_Bundleoption</module>
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</bundleoption_setup>
<bundleoption_write>
<connection>
<use>core_write</use>
</connection>
</bundleoption_write>
<bundleoption_read>
<connection>
<use>core_read</use>
</connection>
</bundleoption_read>
</resources>
</global>
<adminhtml>
<events>
<catalog_product_save_commit_after>
<observers>
<custom_field_observer>
<type>singleton</type>
<class>Locker_Bundleoption_Model_Observer</class>
<method>SaveDropdownAfterProductSave</method>
</custom_field_observer>
</observers>
</catalog_product_save_commit_after>
</events>
</adminhtml>
here is my block file in admin
app/code/local/Locker/Bundleoption/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php
<?php
class Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option extends Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option
{
public function getOptions()
{
if (!$this->_options) {
$this->getProduct()->getTypeInstance(true)->setStoreFilter($this->getProduct()->getStoreId(),
$this->getProduct());
$optionCollection = $this->getProduct()->getTypeInstance(true)->getOptionsCollection($this->getProduct());
$selectionCollection = $this->getProduct()->getTypeInstance(true)->getSelectionsCollection(
$this->getProduct()->getTypeInstance(true)->getOptionsIds($this->getProduct()),
$this->getProduct()
);
$this->_options = $optionCollection->appendSelections($selectionCollection);
/*echo "<pre>";
print_r($this->_options); die;*/
$storeId = $this->getProduct()->getData('store_id');
foreach ($this->_options as $option) {
//gets each option's id
$option_id = $option->getData('option_id');
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($option_id, "option_id");
if ($optionFixed->getId() != "") {
$id = (int)$optionFixed->getId();
$bundleqty = $optionFixed->getBundleqty();
//adds our new datas to option
$option->addData(array('fixedbundle_id'=> $id, 'bundleqty' => $bundleqty, 'is_new'=> 'no'));
} else {
$option->addData(array('fixedbundle_id'=> '', 'bundleqty' => '', 'is_new'=> 'yes'));
}
}
if ($this->getCanReadPrice() === false) {
foreach ($this->_options as $option) {
if ($option->getSelections()) {
foreach ($option->getSelections() as $selection) {
$selection->setCanReadPrice($this->getCanReadPrice());
$selection->setCanEditPrice($this->getCanEditPrice());
}
}
}
}
}
return $this->_options;
}
}
Here is the sql file
app/code/local/Locker/Bundleoption/sql/bundleoption_setup/mysql4-install-0.1.0.php
<?php //echo "string"; die;
$installer=$this;
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('bundleoption/bundleqty')};
CREATE TABLE {$this->getTable('bundleoption/bundleqty')} (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`store_id` int(11) NOT NULL default '0',
`option_id` int(11) NOT NULL,
`bundleqty` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$installer->endSetup();
Here are my model files
File 1 : app/code/local/Locker/Bundleoption/Model/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('yourmodule/fixedbundle');
}
}
File 2 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('bundleoption/bundleqty', 'id');
}
}
File 3 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty/Collection.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
protected function _construct(){
$this->_init('bundleoption/bundleqty');
}
}
File 4 : app/code/local/Locker/Bundleoption/Model/Observer.php
<?php
class Locker_Bundleoption_Model_Observer extends Mage_Core_Model_Abstract
{
public function SaveDropdownAfterProductSave($observer)
{
$product = Mage::registry('product');
if (Mage::registry('catalog_product_save_commit_after' . $product->getId())) {
return;
}
Mage::register('catalog_product_save_commit_after' . $product->getId(), true);
$model = Mage::getModel('bundleoption/bundleqty');
$optionCollection = $product->getTypeInstance(TRUE)->getOptionsCollection($product);
$bundleOptions = $product->getBundleOptionsData();
if (!empty($bundleOptions)) {
$storeId = (int)$product->getData('store_id');
foreach ($bundleOptions as $option) {
$optionId = (int)$option['option_id'];
$id = (int)$option['id'];
$isDeleted = (int)$option['delete'];
//use to set option_id for new options in our module
if ($optionId <= 0 || $optionId == "" || is_null($optionId)) {
foreach ($optionCollection as $new) {
if($new['type'] == $option['type'] && ( $new['title'] == $option['title'] || $new['default_title'] == $option['title'] )){
$optionId = $new['option_id'];
}
}
}
$data = array(
'option_id' => $optionId,
'store_id' => $storeId,
'bundleqty' => $option['bundleqty']
);
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($optionId, "option_id");
// id exist means already there is an entry in custom table
try {
if ($isDeleted == 1) {
$model->setId($id)->delete();
} else {
if ($optionFixed->getId() != ""){
$model->load($id);
$model->addData($data);
$model->setId($id)->save();
} else {
$model->setData($data);
$insertId = $model->save()->getId();
}
}
} catch (Exception $e) {
Mage::logException($e);
}
}
}
return $this;
}
}
Here is my phtml file changes
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml
<script type="text/javascript">
optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="option-box"> ' +
'<input id="fixedbundle_id" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][id]" value="{{id}}" />'+
'<input id="is_new" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][is_new]" value="{{is_new}}" />'+
'<div class="option-title"> ' +
'<label for="<?php echo $this->getFieldName() ?>[{{index}}][title]"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Default Title')) ?> <span class="required">*</span></label>' +
<?php if ($this->isDefaultStore()): ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
<?php else: ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
<?php endif; ?>
'<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
'</div>' +
'<table class="option-header" cellpadding="0" cellspacing="0">' +
'<thead>' +
'<tr>' +
<?php if (!$this->isDefaultStore()): ?>
'<th class="opt-title"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Store View Title')) ?> <span class="required">*</span></th>' +
<?php endif; ?>
'<th class="opt-type"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Input Type')) ?></th>' +
'<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Is Required')) ?></th>' +
'<th class="opt-order"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Position')) ?></th>' +
'<th class="opt-order bundleqty-assigned"><?php echo Mage::helper('bundle')->__('Bundle Quantity') ?></th>' +
'<th> </th>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{index}}][option_id]" value="{{option_id}}">' +
'<input type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][delete]" value="" class="delete">' +
<?php if (!$this->isDefaultStore()): ?>
'<td><input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title_store" value="{{title}}"></td>' +
<?php endif; ?>
'<td><?php echo $this->getTypeSelectHtml() ?></td>' +
'<td><?php echo $this->getRequireSelectHtml() ?></td>' +
'<td><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][position]" value="{{position}}"></td>' +
'<td class="bundleqty-assigned"><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][bundleqty]" value="{{bundleqty}}"></td>' +
'<td> <?php echo $this->jsQuoteEscape($this->getAddSelectionButtonHtml()) ?></td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'<div id="<?php echo $this->getFieldId() ?>_search_{{index}}">' +
'</div>' +
'</div>';
</script>
magento-1.9 event-observer custom-options bundle-product
add a comment |
Following is my extension
app/code/local/Locker/Bundleoption/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Locker_Bundleoption>
<version>0.1.0</version>
</Locker_Bundleoption>
</modules>
<global>
<blocks>
<bundle>
<rewrite>
<adminhtml_catalog_product_edit_tab_bundle_option>Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option</adminhtml_catalog_product_edit_tab_bundle_option>
</rewrite>
</bundle>
</blocks>
<models>
<bundleoption>
<class>Locker_Bundleoption_Model</class>
<resourceModel>bundleoption_mysql4</resourceModel>
</bundleoption>
<bundleoption_mysql4>
<class>Locker_Bundleoption_Model_Mysql4</class>
<entities>
<bundleqty>
<table>catalog_product_bundle_option_bundleqty</table>
</bundleqty>
</entities>
</bundleoption_mysql4>
</models>
<resources>
<bundleoption_setup>
<setup>
<module>Locker_Bundleoption</module>
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</bundleoption_setup>
<bundleoption_write>
<connection>
<use>core_write</use>
</connection>
</bundleoption_write>
<bundleoption_read>
<connection>
<use>core_read</use>
</connection>
</bundleoption_read>
</resources>
</global>
<adminhtml>
<events>
<catalog_product_save_commit_after>
<observers>
<custom_field_observer>
<type>singleton</type>
<class>Locker_Bundleoption_Model_Observer</class>
<method>SaveDropdownAfterProductSave</method>
</custom_field_observer>
</observers>
</catalog_product_save_commit_after>
</events>
</adminhtml>
here is my block file in admin
app/code/local/Locker/Bundleoption/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php
<?php
class Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option extends Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option
{
public function getOptions()
{
if (!$this->_options) {
$this->getProduct()->getTypeInstance(true)->setStoreFilter($this->getProduct()->getStoreId(),
$this->getProduct());
$optionCollection = $this->getProduct()->getTypeInstance(true)->getOptionsCollection($this->getProduct());
$selectionCollection = $this->getProduct()->getTypeInstance(true)->getSelectionsCollection(
$this->getProduct()->getTypeInstance(true)->getOptionsIds($this->getProduct()),
$this->getProduct()
);
$this->_options = $optionCollection->appendSelections($selectionCollection);
/*echo "<pre>";
print_r($this->_options); die;*/
$storeId = $this->getProduct()->getData('store_id');
foreach ($this->_options as $option) {
//gets each option's id
$option_id = $option->getData('option_id');
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($option_id, "option_id");
if ($optionFixed->getId() != "") {
$id = (int)$optionFixed->getId();
$bundleqty = $optionFixed->getBundleqty();
//adds our new datas to option
$option->addData(array('fixedbundle_id'=> $id, 'bundleqty' => $bundleqty, 'is_new'=> 'no'));
} else {
$option->addData(array('fixedbundle_id'=> '', 'bundleqty' => '', 'is_new'=> 'yes'));
}
}
if ($this->getCanReadPrice() === false) {
foreach ($this->_options as $option) {
if ($option->getSelections()) {
foreach ($option->getSelections() as $selection) {
$selection->setCanReadPrice($this->getCanReadPrice());
$selection->setCanEditPrice($this->getCanEditPrice());
}
}
}
}
}
return $this->_options;
}
}
Here is the sql file
app/code/local/Locker/Bundleoption/sql/bundleoption_setup/mysql4-install-0.1.0.php
<?php //echo "string"; die;
$installer=$this;
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('bundleoption/bundleqty')};
CREATE TABLE {$this->getTable('bundleoption/bundleqty')} (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`store_id` int(11) NOT NULL default '0',
`option_id` int(11) NOT NULL,
`bundleqty` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$installer->endSetup();
Here are my model files
File 1 : app/code/local/Locker/Bundleoption/Model/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('yourmodule/fixedbundle');
}
}
File 2 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('bundleoption/bundleqty', 'id');
}
}
File 3 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty/Collection.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
protected function _construct(){
$this->_init('bundleoption/bundleqty');
}
}
File 4 : app/code/local/Locker/Bundleoption/Model/Observer.php
<?php
class Locker_Bundleoption_Model_Observer extends Mage_Core_Model_Abstract
{
public function SaveDropdownAfterProductSave($observer)
{
$product = Mage::registry('product');
if (Mage::registry('catalog_product_save_commit_after' . $product->getId())) {
return;
}
Mage::register('catalog_product_save_commit_after' . $product->getId(), true);
$model = Mage::getModel('bundleoption/bundleqty');
$optionCollection = $product->getTypeInstance(TRUE)->getOptionsCollection($product);
$bundleOptions = $product->getBundleOptionsData();
if (!empty($bundleOptions)) {
$storeId = (int)$product->getData('store_id');
foreach ($bundleOptions as $option) {
$optionId = (int)$option['option_id'];
$id = (int)$option['id'];
$isDeleted = (int)$option['delete'];
//use to set option_id for new options in our module
if ($optionId <= 0 || $optionId == "" || is_null($optionId)) {
foreach ($optionCollection as $new) {
if($new['type'] == $option['type'] && ( $new['title'] == $option['title'] || $new['default_title'] == $option['title'] )){
$optionId = $new['option_id'];
}
}
}
$data = array(
'option_id' => $optionId,
'store_id' => $storeId,
'bundleqty' => $option['bundleqty']
);
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($optionId, "option_id");
// id exist means already there is an entry in custom table
try {
if ($isDeleted == 1) {
$model->setId($id)->delete();
} else {
if ($optionFixed->getId() != ""){
$model->load($id);
$model->addData($data);
$model->setId($id)->save();
} else {
$model->setData($data);
$insertId = $model->save()->getId();
}
}
} catch (Exception $e) {
Mage::logException($e);
}
}
}
return $this;
}
}
Here is my phtml file changes
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml
<script type="text/javascript">
optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="option-box"> ' +
'<input id="fixedbundle_id" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][id]" value="{{id}}" />'+
'<input id="is_new" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][is_new]" value="{{is_new}}" />'+
'<div class="option-title"> ' +
'<label for="<?php echo $this->getFieldName() ?>[{{index}}][title]"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Default Title')) ?> <span class="required">*</span></label>' +
<?php if ($this->isDefaultStore()): ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
<?php else: ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
<?php endif; ?>
'<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
'</div>' +
'<table class="option-header" cellpadding="0" cellspacing="0">' +
'<thead>' +
'<tr>' +
<?php if (!$this->isDefaultStore()): ?>
'<th class="opt-title"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Store View Title')) ?> <span class="required">*</span></th>' +
<?php endif; ?>
'<th class="opt-type"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Input Type')) ?></th>' +
'<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Is Required')) ?></th>' +
'<th class="opt-order"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Position')) ?></th>' +
'<th class="opt-order bundleqty-assigned"><?php echo Mage::helper('bundle')->__('Bundle Quantity') ?></th>' +
'<th> </th>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{index}}][option_id]" value="{{option_id}}">' +
'<input type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][delete]" value="" class="delete">' +
<?php if (!$this->isDefaultStore()): ?>
'<td><input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title_store" value="{{title}}"></td>' +
<?php endif; ?>
'<td><?php echo $this->getTypeSelectHtml() ?></td>' +
'<td><?php echo $this->getRequireSelectHtml() ?></td>' +
'<td><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][position]" value="{{position}}"></td>' +
'<td class="bundleqty-assigned"><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][bundleqty]" value="{{bundleqty}}"></td>' +
'<td> <?php echo $this->jsQuoteEscape($this->getAddSelectionButtonHtml()) ?></td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'<div id="<?php echo $this->getFieldId() ?>_search_{{index}}">' +
'</div>' +
'</div>';
</script>
magento-1.9 event-observer custom-options bundle-product
Following is my extension
app/code/local/Locker/Bundleoption/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Locker_Bundleoption>
<version>0.1.0</version>
</Locker_Bundleoption>
</modules>
<global>
<blocks>
<bundle>
<rewrite>
<adminhtml_catalog_product_edit_tab_bundle_option>Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option</adminhtml_catalog_product_edit_tab_bundle_option>
</rewrite>
</bundle>
</blocks>
<models>
<bundleoption>
<class>Locker_Bundleoption_Model</class>
<resourceModel>bundleoption_mysql4</resourceModel>
</bundleoption>
<bundleoption_mysql4>
<class>Locker_Bundleoption_Model_Mysql4</class>
<entities>
<bundleqty>
<table>catalog_product_bundle_option_bundleqty</table>
</bundleqty>
</entities>
</bundleoption_mysql4>
</models>
<resources>
<bundleoption_setup>
<setup>
<module>Locker_Bundleoption</module>
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</bundleoption_setup>
<bundleoption_write>
<connection>
<use>core_write</use>
</connection>
</bundleoption_write>
<bundleoption_read>
<connection>
<use>core_read</use>
</connection>
</bundleoption_read>
</resources>
</global>
<adminhtml>
<events>
<catalog_product_save_commit_after>
<observers>
<custom_field_observer>
<type>singleton</type>
<class>Locker_Bundleoption_Model_Observer</class>
<method>SaveDropdownAfterProductSave</method>
</custom_field_observer>
</observers>
</catalog_product_save_commit_after>
</events>
</adminhtml>
here is my block file in admin
app/code/local/Locker/Bundleoption/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php
<?php
class Locker_Bundleoption_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option extends Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option
{
public function getOptions()
{
if (!$this->_options) {
$this->getProduct()->getTypeInstance(true)->setStoreFilter($this->getProduct()->getStoreId(),
$this->getProduct());
$optionCollection = $this->getProduct()->getTypeInstance(true)->getOptionsCollection($this->getProduct());
$selectionCollection = $this->getProduct()->getTypeInstance(true)->getSelectionsCollection(
$this->getProduct()->getTypeInstance(true)->getOptionsIds($this->getProduct()),
$this->getProduct()
);
$this->_options = $optionCollection->appendSelections($selectionCollection);
/*echo "<pre>";
print_r($this->_options); die;*/
$storeId = $this->getProduct()->getData('store_id');
foreach ($this->_options as $option) {
//gets each option's id
$option_id = $option->getData('option_id');
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($option_id, "option_id");
if ($optionFixed->getId() != "") {
$id = (int)$optionFixed->getId();
$bundleqty = $optionFixed->getBundleqty();
//adds our new datas to option
$option->addData(array('fixedbundle_id'=> $id, 'bundleqty' => $bundleqty, 'is_new'=> 'no'));
} else {
$option->addData(array('fixedbundle_id'=> '', 'bundleqty' => '', 'is_new'=> 'yes'));
}
}
if ($this->getCanReadPrice() === false) {
foreach ($this->_options as $option) {
if ($option->getSelections()) {
foreach ($option->getSelections() as $selection) {
$selection->setCanReadPrice($this->getCanReadPrice());
$selection->setCanEditPrice($this->getCanEditPrice());
}
}
}
}
}
return $this->_options;
}
}
Here is the sql file
app/code/local/Locker/Bundleoption/sql/bundleoption_setup/mysql4-install-0.1.0.php
<?php //echo "string"; die;
$installer=$this;
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('bundleoption/bundleqty')};
CREATE TABLE {$this->getTable('bundleoption/bundleqty')} (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`store_id` int(11) NOT NULL default '0',
`option_id` int(11) NOT NULL,
`bundleqty` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$installer->endSetup();
Here are my model files
File 1 : app/code/local/Locker/Bundleoption/Model/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('yourmodule/fixedbundle');
}
}
File 2 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty extends Mage_Core_Model_Abstract {
public function _construct()
{
$this->_init('bundleoption/bundleqty', 'id');
}
}
File 3 : app/code/local/Locker/Bundleoption/Model/Mysql4/Bundleqty/Collection.php
<?php
class Locker_Bundleoption_Model_Mysql4_Bundleqty_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
protected function _construct(){
$this->_init('bundleoption/bundleqty');
}
}
File 4 : app/code/local/Locker/Bundleoption/Model/Observer.php
<?php
class Locker_Bundleoption_Model_Observer extends Mage_Core_Model_Abstract
{
public function SaveDropdownAfterProductSave($observer)
{
$product = Mage::registry('product');
if (Mage::registry('catalog_product_save_commit_after' . $product->getId())) {
return;
}
Mage::register('catalog_product_save_commit_after' . $product->getId(), true);
$model = Mage::getModel('bundleoption/bundleqty');
$optionCollection = $product->getTypeInstance(TRUE)->getOptionsCollection($product);
$bundleOptions = $product->getBundleOptionsData();
if (!empty($bundleOptions)) {
$storeId = (int)$product->getData('store_id');
foreach ($bundleOptions as $option) {
$optionId = (int)$option['option_id'];
$id = (int)$option['id'];
$isDeleted = (int)$option['delete'];
//use to set option_id for new options in our module
if ($optionId <= 0 || $optionId == "" || is_null($optionId)) {
foreach ($optionCollection as $new) {
if($new['type'] == $option['type'] && ( $new['title'] == $option['title'] || $new['default_title'] == $option['title'] )){
$optionId = $new['option_id'];
}
}
}
$data = array(
'option_id' => $optionId,
'store_id' => $storeId,
'bundleqty' => $option['bundleqty']
);
$optionFixed = Mage::getModel('bundleoption/bundleqty')->load($optionId, "option_id");
// id exist means already there is an entry in custom table
try {
if ($isDeleted == 1) {
$model->setId($id)->delete();
} else {
if ($optionFixed->getId() != ""){
$model->load($id);
$model->addData($data);
$model->setId($id)->save();
} else {
$model->setData($data);
$insertId = $model->save()->getId();
}
}
} catch (Exception $e) {
Mage::logException($e);
}
}
}
return $this;
}
}
Here is my phtml file changes
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml
<script type="text/javascript">
optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="option-box"> ' +
'<input id="fixedbundle_id" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][id]" value="{{id}}" />'+
'<input id="is_new" type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][is_new]" value="{{is_new}}" />'+
'<div class="option-title"> ' +
'<label for="<?php echo $this->getFieldName() ?>[{{index}}][title]"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Default Title')) ?> <span class="required">*</span></label>' +
<?php if ($this->isDefaultStore()): ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
<?php else: ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
<?php endif; ?>
'<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
'</div>' +
'<table class="option-header" cellpadding="0" cellspacing="0">' +
'<thead>' +
'<tr>' +
<?php if (!$this->isDefaultStore()): ?>
'<th class="opt-title"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Store View Title')) ?> <span class="required">*</span></th>' +
<?php endif; ?>
'<th class="opt-type"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Input Type')) ?></th>' +
'<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Is Required')) ?></th>' +
'<th class="opt-order"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Position')) ?></th>' +
'<th class="opt-order bundleqty-assigned"><?php echo Mage::helper('bundle')->__('Bundle Quantity') ?></th>' +
'<th> </th>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{index}}][option_id]" value="{{option_id}}">' +
'<input type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][delete]" value="" class="delete">' +
<?php if (!$this->isDefaultStore()): ?>
'<td><input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title_store" value="{{title}}"></td>' +
<?php endif; ?>
'<td><?php echo $this->getTypeSelectHtml() ?></td>' +
'<td><?php echo $this->getRequireSelectHtml() ?></td>' +
'<td><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][position]" value="{{position}}"></td>' +
'<td class="bundleqty-assigned"><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][bundleqty]" value="{{bundleqty}}"></td>' +
'<td> <?php echo $this->jsQuoteEscape($this->getAddSelectionButtonHtml()) ?></td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'<div id="<?php echo $this->getFieldId() ?>_search_{{index}}">' +
'</div>' +
'</div>';
</script>
magento-1.9 event-observer custom-options bundle-product
magento-1.9 event-observer custom-options bundle-product
edited 45 mins ago
Teja Bhagavan Kollepara
2,96341847
2,96341847
asked May 30 '18 at 14:19
Joey ParamJoey Param
11
11
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f228090%2fhow-can-we-add-custom-input-field-after-position-in-bundle-items-in-bundle-produ%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f228090%2fhow-can-we-add-custom-input-field-after-position-in-bundle-items-in-bundle-produ%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown