Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked display of product alerts #3303

Closed
wants to merge 11 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ protected function _prepareLayout()

if ($alertPriceAllow) {
$accordion->addItem('price', [
'title' => Mage::helper('adminhtml')->__('Price alert subscription was saved.'),
'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts_price')->toHtml() . '<br />',
'title' => Mage::helper('adminhtml')->__('Product price alert'),
luigifab marked this conversation as resolved.
Show resolved Hide resolved
'content' => '<div class="entry-edit"><div class="fieldset fieldset-wide">' . $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts_price')->toHtml() . '</div></div>',
'open' => true
]);
}
if ($alertStockAllow) {
$accordion->addItem('stock', [
'title' => Mage::helper('adminhtml')->__('Stock notification was saved.'),
'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts_stock'),
'title' => Mage::helper('adminhtml')->__('Product stock alert'),
luigifab marked this conversation as resolved.
Show resolved Hide resolved
'content' => '<div class="entry-edit"><div class="fieldset fieldset-wide">' . $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts_stock')->toHtml() . '</div></div>',
'open' => true
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct()
$this->setDefaultDir('desc');
$this->setUseAjax(true);
$this->setFilterVisibility(false);
$this->setEmptyText(Mage::helper('catalog')->__('There are no customers for this alert'));
$this->setEmptyText(Mage::helper('catalog')->__('There are no customers for this alert.'));
fballiano marked this conversation as resolved.
Show resolved Hide resolved
}

protected function _prepareCollection()
Expand Down
57 changes: 36 additions & 21 deletions app/code/core/Mage/ProductAlert/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,52 +25,67 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<allow_price translate="label">
<label>Allow Alert When Product Price Changes</label>
<email_identity translate="label">
<label>Alert Email Sender</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<source_model>adminhtml/system_config_source_email_identity</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</allow_price>
<allow_stock translate="label">
<label>Allow Alert When Product Comes Back in Stock</label>
</email_identity>
<head_price>
luigifab marked this conversation as resolved.
Show resolved Hide resolved
fballiano marked this conversation as resolved.
Show resolved Hide resolved
<label>Product price alert</label>
luigifab marked this conversation as resolved.
Show resolved Hide resolved
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</head_price>
<allow_price translate="label">
<label>Enabled</label>
luigifab marked this conversation as resolved.
Show resolved Hide resolved
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>3</sort_order>
<sort_order>11</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</allow_stock>

<show_in_store>1</show_in_store>
</allow_price>
<email_price_template translate="label">
<label>Price Alert Email Template</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>2</sort_order>
<sort_order>12</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</email_price_template>
<email_stock_template translate="label">
<label>Stock Alert Email Template</label>
<head_stock>
luigifab marked this conversation as resolved.
Show resolved Hide resolved
fballiano marked this conversation as resolved.
Show resolved Hide resolved
<label>Product stock alert</label>
luigifab marked this conversation as resolved.
Show resolved Hide resolved
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</head_stock>
<allow_stock translate="label">
<label>Enabled</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>4</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>21</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</email_stock_template>
<email_identity translate="label">
<label>Alert Email Sender</label>
</allow_stock>
<email_stock_template translate="label">
<label>Stock Alert Email Template</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_identity</source_model>
<sort_order>5</sort_order>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>22</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</email_identity>
</email_stock_template>
</fields>
</productalert>
<productalert_cron translate="label" module="productalert">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
* Template for block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts
*/
?>

<div id="alert_messages_block"><?php echo $this->getMessageHtml() ?></div>
<div>
<h4 class="icon-head head-edit-form"><?php echo Mage::helper('productalert')->__('Product Alerts') ?></h4>
</div>
<div class="clear"></div>
<?php echo $this->getAccordionHtml() ?>
2 changes: 0 additions & 2 deletions app/locale/en_US/Mage_Adminhtml.csv
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,6 @@
"Preview","Preview"
"Preview Template","Preview Template"
"Price","Price"
"Price alert subscription was saved.","Price alert subscription was saved."
"Price:","Price:"
"Processed <strong>%s%% %s/%d</strong> records","Processed <strong>%s%% %s/%d</strong> records"
"Processing","Processing"
Expand Down Expand Up @@ -982,7 +981,6 @@
"Status","Status"
"Status:","Status:"
"Stock Quantity:","Stock Quantity:"
"Stock notification was saved.","Stock notification was saved."
"Store","Store"
"Store View","Store View"
"Store:","Store:"
Expand Down
1 change: 0 additions & 1 deletion app/locale/en_US/Mage_Catalog.csv
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
"The search was deleted.","The search was deleted."
"The text is too long","The text is too long"
"There are no %s available.","There are no %s available."
"There are no customers for this alert","There are no customers for this alert"
"There are no customers for this alert.","There are no customers for this alert."
"There are no products matching the selection.","There are no products matching the selection."
"There was an error while request processing.","There was an error while request processing."
Expand Down
2 changes: 0 additions & 2 deletions app/locale/en_US/Mage_ProductAlert.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"Alert Email Sender","Alert Email Sender"
"Alert subscription has been saved.","Alert subscription has been saved."
"Allow Alert When Product Comes Back in Stock","Allow Alert When Product Comes Back in Stock"
"Allow Alert When Product Price Changes","Allow Alert When Product Price Changes"
"Click here not to receive alerts for this product","Click here not to receive alerts for this product"
"Error Email Recipient","Error Email Recipient"
"Error Email Sender","Error Email Sender"
Expand Down