How to show OUT OF STOCK in dropdown (Product Attribute Value Combinations) 3.2

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
This seems that is going to give me headaches. Let's see what I get
7 years ago
Hi there,

It does not seem to work, and the tables they are talking about in the fix for this, is not even there anymore, bear in mind the fix above was in 2014.

Somebody made a boo boo here. Because it definitely is not working in 3.8.

Regards

Nic
7 years ago
Me too,

it definitely is not working in the version 3.8 I have.

And mine is still a clean site with no third party changes.

Regards

Nic
7 years ago
I have a much easier and elegant solutions for this issue. I am using 3.8 :)
No DB changes, few lines of code changes and CSS additions

Solution is to Change drop-down to radio-button list from product attributes, so no default selection.
Then use CSS to show the items as buttons in boxes instead of the default radio buttons

This also needs a simple bug fix.
https://github.com/nopSolutions/nopCommerce/issues/1991

If you all are still struggling with this issue, I will document the changes required here.
7 years ago
[email protected] wrote:
I have a much easier and elegant solutions for this issue. I am using 3.8 :)
No DB changes, few lines of code changes and CSS additions

Solution is to Change drop-down to radio-button list from product attributes, so no default selection.
Then use CSS to show the items as buttons in boxes instead of the default radio buttons

This also needs a simple bug fix.
https://github.com/nopSolutions/nopCommerce/issues/1991

If you all are still struggling with this issue, I will document the changes required here.


I am not able to understand your solution, would you please show me the code to be changed?
7 years ago
Give me a day... will do the write-up here... Its 3:13am here... :)
7 years ago
This is how it looks


https://img42.com/zmbHk
7 years ago
::Solution with very minimal changes::

For explanation I am taking the scenario of a Shirt with different sizes.
Sizes are listed as Product Attributes and inventory tracking done using Product Attribute combinations.

Main issue with drop-down is that, you need an element as default.
If Small is the first element and that is selected by default which has no stock, default product availability shows as 'no stock'... Also conditional enabling, disabling becomes difficult and not very visible. Drop-down also needs an extra click to see.

Here is my solution...

Steps below
1. Change the drop-down to radio button list from Product Attributes
2. This would show the attribute Sizes as a list of radio buttons (vertical)
3. Using CSS, style the radio buttons to be horizontal and to act like a button

This makes sure, there is no default selection.
Now there is a small bug, which shows Availability as "In Stock" even if no attribute combination has stock.
https://github.com/nopSolutions/nopCommerce/issues/1991

Suggested solution for the bug is also mentioned.


Now if we can get quantity when the radio button list is created (_ProductAttributes.cshtml)... we can do either of the following
1. Don't create the specific radio button since stock is not there
2. Disable radio button using disabled='disabled' property (MVC hack)

The Quantity in the model available on _ProductAttributes.cshtml always shows Zero.

Here is the radio button list styling to play around... thanks to jsfiddle :)
https://jsfiddle.net/sukeshak/7bLzzo24/

This is how it looks on the sample website
https://img42.com/zmbHk

Hope it helps... Any questions welcome!
7 years ago
[email protected] wrote:
::Solution with very minimal changes::

For explanation I am taking the scenario of a Shirt with different sizes.
Sizes are listed as Product Attributes and inventory tracking done using Product Attribute combinations.

Main issue with drop-down is that, you need an element as default.
If Small is the first element and that is selected by default which has no stock, default product availability shows as 'no stock'... Also conditional enabling, disabling becomes difficult and not very visible. Drop-down also needs an extra click to see.

Here is my solution...

Steps below
1. Change the drop-down to radio button list from Product Attributes
2. This would show the attribute Sizes as a list of radio buttons (vertical)
3. Using CSS, style the radio buttons to be horizontal and to act like a button

This makes sure, there is no default selection.
Now there is a small bug, which shows Availability as "In Stock" even if no attribute combination has stock.
https://github.com/nopSolutions/nopCommerce/issues/1991

Suggested solution for the bug is also mentioned.


Now if we can get quantity when the radio button list is created (_ProductAttributes.cshtml)... we can do either of the following
1. Don't create the specific radio button since stock is not there
2. Disable radio button using disabled='disabled' property (MVC hack)

The Quantity in the model available on _ProductAttributes.cshtml always shows Zero.

Here is the radio button list styling to play around... thanks to jsfiddle :)
https://jsfiddle.net/sukeshak/7bLzzo24/

This is how it looks on the sample website
https://img42.com/zmbHk

Hope it helps... Any questions welcome!


We have been talking in a situation when we have more than one attribute; for example "Color" & "Size", your case only have one attribute.
7 years ago
Hi, i really like this solution, we had the same problem.
I really have no idea on how to disable the button or remove the item from the list
.
Can you please tell me how i can set the button = disabled if the stock == 0 ?

Kind Regards,
jaco
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.