Stock availability status on Configurable simple products
On a Configurable product, the following gets displayed if the Configurable product has stock /is saleable. However, when one of the items in the dropdown of Simple products is actually out of stock the following is not correct.
<?php if ($this->displayProductStockStatus()): ?>
<?php if($_product->isSaleable()): ?>
<p class="availability in-of-stock">Availability: <span><?php echo $this->__('In stock') ?></span></p>
<?php else : ?>
<?php endif; ?>
<?php endif; ?>
What i'm trying to do is get that In stock text to change to out of stock when the out of stock product is selected. I wondered if anyone else has tried fixing this magento bug before?
configurable-product out-of-stock stock-status
bumped to the homepage by Community♦ yesterday
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 |
On a Configurable product, the following gets displayed if the Configurable product has stock /is saleable. However, when one of the items in the dropdown of Simple products is actually out of stock the following is not correct.
<?php if ($this->displayProductStockStatus()): ?>
<?php if($_product->isSaleable()): ?>
<p class="availability in-of-stock">Availability: <span><?php echo $this->__('In stock') ?></span></p>
<?php else : ?>
<?php endif; ?>
<?php endif; ?>
What i'm trying to do is get that In stock text to change to out of stock when the out of stock product is selected. I wondered if anyone else has tried fixing this magento bug before?
configurable-product out-of-stock stock-status
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Do you mean dynamically, e.g. using Javascript?
– Robbie Averill
Mar 10 '16 at 20:41
add a comment |
On a Configurable product, the following gets displayed if the Configurable product has stock /is saleable. However, when one of the items in the dropdown of Simple products is actually out of stock the following is not correct.
<?php if ($this->displayProductStockStatus()): ?>
<?php if($_product->isSaleable()): ?>
<p class="availability in-of-stock">Availability: <span><?php echo $this->__('In stock') ?></span></p>
<?php else : ?>
<?php endif; ?>
<?php endif; ?>
What i'm trying to do is get that In stock text to change to out of stock when the out of stock product is selected. I wondered if anyone else has tried fixing this magento bug before?
configurable-product out-of-stock stock-status
On a Configurable product, the following gets displayed if the Configurable product has stock /is saleable. However, when one of the items in the dropdown of Simple products is actually out of stock the following is not correct.
<?php if ($this->displayProductStockStatus()): ?>
<?php if($_product->isSaleable()): ?>
<p class="availability in-of-stock">Availability: <span><?php echo $this->__('In stock') ?></span></p>
<?php else : ?>
<?php endif; ?>
<?php endif; ?>
What i'm trying to do is get that In stock text to change to out of stock when the out of stock product is selected. I wondered if anyone else has tried fixing this magento bug before?
configurable-product out-of-stock stock-status
configurable-product out-of-stock stock-status
asked Mar 10 '16 at 20:15
doubleplusgood
83316
83316
bumped to the homepage by Community♦ yesterday
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♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Do you mean dynamically, e.g. using Javascript?
– Robbie Averill
Mar 10 '16 at 20:41
add a comment |
Do you mean dynamically, e.g. using Javascript?
– Robbie Averill
Mar 10 '16 at 20:41
Do you mean dynamically, e.g. using Javascript?
– Robbie Averill
Mar 10 '16 at 20:41
Do you mean dynamically, e.g. using Javascript?
– Robbie Averill
Mar 10 '16 at 20:41
add a comment |
1 Answer
1
active
oldest
votes
As doubleplusgood suggested, this functionality is controlled by Javascript and not PHP. In a default 1.9.3 install running RWD as the theme, when you click on a configurable product's simple product option swatch that is in stock, you get this result:
When you select a swatch for a product that is out of stock, you get this:
So while the code you posted is for a check against the stock of the product, it does not control the status for the a configurable product that has some simples with and without stock. The logic that controls that functionality (disabling the add to cart button and changing the 'out of stock' text) is in this file:
rwd/default/js/configurableswatches/swatches-product.js
So given that information I would take two guesses to what might be causing your issue.
You have some kind of javascript error, the file is not loading correctly or you are using a custom template that doesn't have the correct class name for the HTML element that the javascript is targeting.
You have a setting in the admin that allows for products that are out of stock to still be sold (system-> config-> catalog-> inventory). Check these settings as they can override what the theme might be doing.
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%2f105695%2fstock-availability-status-on-configurable-simple-products%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As doubleplusgood suggested, this functionality is controlled by Javascript and not PHP. In a default 1.9.3 install running RWD as the theme, when you click on a configurable product's simple product option swatch that is in stock, you get this result:
When you select a swatch for a product that is out of stock, you get this:
So while the code you posted is for a check against the stock of the product, it does not control the status for the a configurable product that has some simples with and without stock. The logic that controls that functionality (disabling the add to cart button and changing the 'out of stock' text) is in this file:
rwd/default/js/configurableswatches/swatches-product.js
So given that information I would take two guesses to what might be causing your issue.
You have some kind of javascript error, the file is not loading correctly or you are using a custom template that doesn't have the correct class name for the HTML element that the javascript is targeting.
You have a setting in the admin that allows for products that are out of stock to still be sold (system-> config-> catalog-> inventory). Check these settings as they can override what the theme might be doing.
add a comment |
As doubleplusgood suggested, this functionality is controlled by Javascript and not PHP. In a default 1.9.3 install running RWD as the theme, when you click on a configurable product's simple product option swatch that is in stock, you get this result:
When you select a swatch for a product that is out of stock, you get this:
So while the code you posted is for a check against the stock of the product, it does not control the status for the a configurable product that has some simples with and without stock. The logic that controls that functionality (disabling the add to cart button and changing the 'out of stock' text) is in this file:
rwd/default/js/configurableswatches/swatches-product.js
So given that information I would take two guesses to what might be causing your issue.
You have some kind of javascript error, the file is not loading correctly or you are using a custom template that doesn't have the correct class name for the HTML element that the javascript is targeting.
You have a setting in the admin that allows for products that are out of stock to still be sold (system-> config-> catalog-> inventory). Check these settings as they can override what the theme might be doing.
add a comment |
As doubleplusgood suggested, this functionality is controlled by Javascript and not PHP. In a default 1.9.3 install running RWD as the theme, when you click on a configurable product's simple product option swatch that is in stock, you get this result:
When you select a swatch for a product that is out of stock, you get this:
So while the code you posted is for a check against the stock of the product, it does not control the status for the a configurable product that has some simples with and without stock. The logic that controls that functionality (disabling the add to cart button and changing the 'out of stock' text) is in this file:
rwd/default/js/configurableswatches/swatches-product.js
So given that information I would take two guesses to what might be causing your issue.
You have some kind of javascript error, the file is not loading correctly or you are using a custom template that doesn't have the correct class name for the HTML element that the javascript is targeting.
You have a setting in the admin that allows for products that are out of stock to still be sold (system-> config-> catalog-> inventory). Check these settings as they can override what the theme might be doing.
As doubleplusgood suggested, this functionality is controlled by Javascript and not PHP. In a default 1.9.3 install running RWD as the theme, when you click on a configurable product's simple product option swatch that is in stock, you get this result:
When you select a swatch for a product that is out of stock, you get this:
So while the code you posted is for a check against the stock of the product, it does not control the status for the a configurable product that has some simples with and without stock. The logic that controls that functionality (disabling the add to cart button and changing the 'out of stock' text) is in this file:
rwd/default/js/configurableswatches/swatches-product.js
So given that information I would take two guesses to what might be causing your issue.
You have some kind of javascript error, the file is not loading correctly or you are using a custom template that doesn't have the correct class name for the HTML element that the javascript is targeting.
You have a setting in the admin that allows for products that are out of stock to still be sold (system-> config-> catalog-> inventory). Check these settings as they can override what the theme might be doing.
answered Feb 4 '17 at 3:48
circlesix
2,68921446
2,68921446
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f105695%2fstock-availability-status-on-configurable-simple-products%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
Do you mean dynamically, e.g. using Javascript?
– Robbie Averill
Mar 10 '16 at 20:41