Can't see “alert_urls” block template
In my project, what I did is copied all the layouts and template files of base/default
to my new theme folder default/efk
.
After that, I made many changes in some layout and template files as needed.
My project is somewhat different from the default magento. In my project, I have configurable products in which each consists of 3 types of simple products.
Now, if any of the single simple product is out of stock, then I need to show "Sign up to get notified when this product is back in stock" as shown in default magento.
When I did some research I figured it out that this link is coming from the phtml line
<?php echo $this->getChildHtml('alert_urls') ?>
I added the same line in my project in template/catalog/product/view.phtml
, but I can't see the "Sign up to get notified when this product is back in stock".
PS: The reference of the block "alert_urls" are not changed. They are same as they are in default magento but in my theme folder instead.
EDIT:
The flow as I understand magento is as follows:
layout/catalog.xml (the block location)
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
//some other blocks
layout/productalert.xml (the block reference location)
<layout version="0.1.0">
<catalog_product_view>
<reference name="content">
<reference name="product.info">
<reference name="alert.urls">
<block type="productalert/product_view" name="productalert.price" as="productalert_price" template="productalert/product/view.phtml">
<action method="preparePriceAlertData"/>
<action method="setHtmlClass"><value>alert-price link-price-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up for price alert</value></action>
</block>
<block type="productalert/product_view" name="productalert.stock" as="productalert_stock" template="productalert/product/view.phtml">
<action method="prepareStockAlertData"/>
<action method="setHtmlClass"><value>alert-stock link-stock-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up to get notified when this product is back in stock</value></action>
</block>
</reference>
</reference>
</reference>
</catalog_product_view>
</layout>
productalert/product/view.phtml (the block's template -- Stock)
<?php /* @var $this Mage_ProductAlert_Block_Product_View */?>
<h1>Hello</h1>
<p class="<?php echo $this->getHtmlClass() ?>">
<a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>" title="<?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?>"><?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?></a>
</p>
Here is the screenshot:
magento-1.8 alert
bumped to the homepage by Community♦ 29 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
In my project, what I did is copied all the layouts and template files of base/default
to my new theme folder default/efk
.
After that, I made many changes in some layout and template files as needed.
My project is somewhat different from the default magento. In my project, I have configurable products in which each consists of 3 types of simple products.
Now, if any of the single simple product is out of stock, then I need to show "Sign up to get notified when this product is back in stock" as shown in default magento.
When I did some research I figured it out that this link is coming from the phtml line
<?php echo $this->getChildHtml('alert_urls') ?>
I added the same line in my project in template/catalog/product/view.phtml
, but I can't see the "Sign up to get notified when this product is back in stock".
PS: The reference of the block "alert_urls" are not changed. They are same as they are in default magento but in my theme folder instead.
EDIT:
The flow as I understand magento is as follows:
layout/catalog.xml (the block location)
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
//some other blocks
layout/productalert.xml (the block reference location)
<layout version="0.1.0">
<catalog_product_view>
<reference name="content">
<reference name="product.info">
<reference name="alert.urls">
<block type="productalert/product_view" name="productalert.price" as="productalert_price" template="productalert/product/view.phtml">
<action method="preparePriceAlertData"/>
<action method="setHtmlClass"><value>alert-price link-price-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up for price alert</value></action>
</block>
<block type="productalert/product_view" name="productalert.stock" as="productalert_stock" template="productalert/product/view.phtml">
<action method="prepareStockAlertData"/>
<action method="setHtmlClass"><value>alert-stock link-stock-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up to get notified when this product is back in stock</value></action>
</block>
</reference>
</reference>
</reference>
</catalog_product_view>
</layout>
productalert/product/view.phtml (the block's template -- Stock)
<?php /* @var $this Mage_ProductAlert_Block_Product_View */?>
<h1>Hello</h1>
<p class="<?php echo $this->getHtmlClass() ?>">
<a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>" title="<?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?>"><?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?></a>
</p>
Here is the screenshot:
magento-1.8 alert
bumped to the homepage by Community♦ 29 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
In my project, what I did is copied all the layouts and template files of base/default
to my new theme folder default/efk
.
After that, I made many changes in some layout and template files as needed.
My project is somewhat different from the default magento. In my project, I have configurable products in which each consists of 3 types of simple products.
Now, if any of the single simple product is out of stock, then I need to show "Sign up to get notified when this product is back in stock" as shown in default magento.
When I did some research I figured it out that this link is coming from the phtml line
<?php echo $this->getChildHtml('alert_urls') ?>
I added the same line in my project in template/catalog/product/view.phtml
, but I can't see the "Sign up to get notified when this product is back in stock".
PS: The reference of the block "alert_urls" are not changed. They are same as they are in default magento but in my theme folder instead.
EDIT:
The flow as I understand magento is as follows:
layout/catalog.xml (the block location)
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
//some other blocks
layout/productalert.xml (the block reference location)
<layout version="0.1.0">
<catalog_product_view>
<reference name="content">
<reference name="product.info">
<reference name="alert.urls">
<block type="productalert/product_view" name="productalert.price" as="productalert_price" template="productalert/product/view.phtml">
<action method="preparePriceAlertData"/>
<action method="setHtmlClass"><value>alert-price link-price-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up for price alert</value></action>
</block>
<block type="productalert/product_view" name="productalert.stock" as="productalert_stock" template="productalert/product/view.phtml">
<action method="prepareStockAlertData"/>
<action method="setHtmlClass"><value>alert-stock link-stock-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up to get notified when this product is back in stock</value></action>
</block>
</reference>
</reference>
</reference>
</catalog_product_view>
</layout>
productalert/product/view.phtml (the block's template -- Stock)
<?php /* @var $this Mage_ProductAlert_Block_Product_View */?>
<h1>Hello</h1>
<p class="<?php echo $this->getHtmlClass() ?>">
<a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>" title="<?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?>"><?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?></a>
</p>
Here is the screenshot:
magento-1.8 alert
In my project, what I did is copied all the layouts and template files of base/default
to my new theme folder default/efk
.
After that, I made many changes in some layout and template files as needed.
My project is somewhat different from the default magento. In my project, I have configurable products in which each consists of 3 types of simple products.
Now, if any of the single simple product is out of stock, then I need to show "Sign up to get notified when this product is back in stock" as shown in default magento.
When I did some research I figured it out that this link is coming from the phtml line
<?php echo $this->getChildHtml('alert_urls') ?>
I added the same line in my project in template/catalog/product/view.phtml
, but I can't see the "Sign up to get notified when this product is back in stock".
PS: The reference of the block "alert_urls" are not changed. They are same as they are in default magento but in my theme folder instead.
EDIT:
The flow as I understand magento is as follows:
layout/catalog.xml (the block location)
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
//some other blocks
layout/productalert.xml (the block reference location)
<layout version="0.1.0">
<catalog_product_view>
<reference name="content">
<reference name="product.info">
<reference name="alert.urls">
<block type="productalert/product_view" name="productalert.price" as="productalert_price" template="productalert/product/view.phtml">
<action method="preparePriceAlertData"/>
<action method="setHtmlClass"><value>alert-price link-price-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up for price alert</value></action>
</block>
<block type="productalert/product_view" name="productalert.stock" as="productalert_stock" template="productalert/product/view.phtml">
<action method="prepareStockAlertData"/>
<action method="setHtmlClass"><value>alert-stock link-stock-alert</value></action>
<action method="setSignupLabel" translate="value"><value>Sign up to get notified when this product is back in stock</value></action>
</block>
</reference>
</reference>
</reference>
</catalog_product_view>
</layout>
productalert/product/view.phtml (the block's template -- Stock)
<?php /* @var $this Mage_ProductAlert_Block_Product_View */?>
<h1>Hello</h1>
<p class="<?php echo $this->getHtmlClass() ?>">
<a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>" title="<?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?>"><?php echo $this->escapeHtml($this->__($this->getSignupLabel())); ?></a>
</p>
Here is the screenshot:
magento-1.8 alert
magento-1.8 alert
edited Nov 20 '13 at 11:00
Mr_Green
asked Nov 20 '13 at 10:18
Mr_GreenMr_Green
1,04342648
1,04342648
bumped to the homepage by Community♦ 29 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 29 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Please ensure system configuration from admin in enable
System > Configuration > Catalog > Allow Alert When Product Comes Back in Stock - Yes
add a comment |
If you still have this issue, even if you ENABLED the option Allow Alert When Product Comes Back in Stock from the admin panel and everything is right with your template and layout files, then check the block Mage_ProductAlert_Block_Product_View and the method prepareStockAlertData() whether if it get's inside the following if block.
if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW)
|| !$this->_product || $this->_product->isAvailable()
) {
$this->setTemplate('');
return;
}
If its get inside this then either the product is still in stock and available for purchase (in case of back orders) or no product instance or you might not have enabled this in the admin panel. Either of these three might be the reason its not showing up in your product page !
Hope this helps !
add a comment |
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%2f10989%2fcant-see-alert-urls-block-template%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please ensure system configuration from admin in enable
System > Configuration > Catalog > Allow Alert When Product Comes Back in Stock - Yes
add a comment |
Please ensure system configuration from admin in enable
System > Configuration > Catalog > Allow Alert When Product Comes Back in Stock - Yes
add a comment |
Please ensure system configuration from admin in enable
System > Configuration > Catalog > Allow Alert When Product Comes Back in Stock - Yes
Please ensure system configuration from admin in enable
System > Configuration > Catalog > Allow Alert When Product Comes Back in Stock - Yes
answered Apr 26 '14 at 6:05
ShivamShivam
1055
1055
add a comment |
add a comment |
If you still have this issue, even if you ENABLED the option Allow Alert When Product Comes Back in Stock from the admin panel and everything is right with your template and layout files, then check the block Mage_ProductAlert_Block_Product_View and the method prepareStockAlertData() whether if it get's inside the following if block.
if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW)
|| !$this->_product || $this->_product->isAvailable()
) {
$this->setTemplate('');
return;
}
If its get inside this then either the product is still in stock and available for purchase (in case of back orders) or no product instance or you might not have enabled this in the admin panel. Either of these three might be the reason its not showing up in your product page !
Hope this helps !
add a comment |
If you still have this issue, even if you ENABLED the option Allow Alert When Product Comes Back in Stock from the admin panel and everything is right with your template and layout files, then check the block Mage_ProductAlert_Block_Product_View and the method prepareStockAlertData() whether if it get's inside the following if block.
if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW)
|| !$this->_product || $this->_product->isAvailable()
) {
$this->setTemplate('');
return;
}
If its get inside this then either the product is still in stock and available for purchase (in case of back orders) or no product instance or you might not have enabled this in the admin panel. Either of these three might be the reason its not showing up in your product page !
Hope this helps !
add a comment |
If you still have this issue, even if you ENABLED the option Allow Alert When Product Comes Back in Stock from the admin panel and everything is right with your template and layout files, then check the block Mage_ProductAlert_Block_Product_View and the method prepareStockAlertData() whether if it get's inside the following if block.
if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW)
|| !$this->_product || $this->_product->isAvailable()
) {
$this->setTemplate('');
return;
}
If its get inside this then either the product is still in stock and available for purchase (in case of back orders) or no product instance or you might not have enabled this in the admin panel. Either of these three might be the reason its not showing up in your product page !
Hope this helps !
If you still have this issue, even if you ENABLED the option Allow Alert When Product Comes Back in Stock from the admin panel and everything is right with your template and layout files, then check the block Mage_ProductAlert_Block_Product_View and the method prepareStockAlertData() whether if it get's inside the following if block.
if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW)
|| !$this->_product || $this->_product->isAvailable()
) {
$this->setTemplate('');
return;
}
If its get inside this then either the product is still in stock and available for purchase (in case of back orders) or no product instance or you might not have enabled this in the admin panel. Either of these three might be the reason its not showing up in your product page !
Hope this helps !
answered Oct 9 '14 at 15:36
HaijeromeHaijerome
1,0561119
1,0561119
add a comment |
add a comment |
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%2f10989%2fcant-see-alert-urls-block-template%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