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

Mark attribute combinations as unavailable #2909

Closed
vucetica opened this issue Mar 9, 2018 · 13 comments
Closed

Mark attribute combinations as unavailable #2909

vucetica opened this issue Mar 9, 2018 · 13 comments

Comments

@vucetica
Copy link

vucetica commented Mar 9, 2018

nopCommerce version: 4.0

Expected behavior: When the user selects an attribute value, attribute values for available attribute combinations should be differentiated from the ones that are not available. Screenshot from amazon is attached (page https://smile.amazon.com/Blue-Cache-Desktop-Drive-WD10EZEX/dp/B013HNYVCE):

untitled

Actual behavior: User has to click on many combinations to figure out which one is in stock.

Steps to reproduce the problem: Open a product page for a product whose inventory is managed through attribute combinations, having some of the combinations unavailable or out of stock.

Suggested solution

Server side

  1. shoppingcart/productdetails_attributechange action should receive one more parameter: selected_product_attribute_id, which is the id of the attribute that user clicked on.
  2. if shoppingcart/productdetails_attributechange action receives selected_product_attribute_id it should return one more property:
    ...
    accepted_attribute_values: [
    {
    attribute_id: 1981,
    accepted_value_ids: [123, 123],
    unaccepted_value_ids: [222]
    },
    {
    attribute_id: 1981,
    accepted_value_ids: [127, 128],
    unaccepted_value_ids: []
    }
    ]
    ...

This result will be built using these rules:
2.1. Find all product attribute combinations that are valid for the selected value of selected_product_attribute_id.
2.2. For each attribute in the product, buld a return object with these properties:
attribute_id - id of that attribute
accepted_value_ids - go through all attribute values and pick those that appear in acceptable combinations
unaccepted_value_ids - the opposite from accepted_value_ids

Client side

When shoppingcart/productdetails_attributechange is completed, for all attribute values remove css classes "accepted" and "unaccepted". For all attribute values in the accepted_value_ids list, add "accepted" css class, for the ones in unaccepted_value_ids add "unaccepted" css class.

@vucetica
Copy link
Author

@AndreiMaz, I would like to implement this solution as proposed. Is that ok?

@Araujovski
Copy link

nopCommerce version: 4.0

Expected behavior: When the user selects an attribute value, attribute values for available attribute combinations should be differentiated from the ones that are not available. Screenshot from amazon is attached (page https://smile.amazon.com/Blue-Cache-Desktop-Drive-WD10EZEX/dp/B013HNYVCE):

untitled

Actual behavior: User has to click on many combinations to figure out which one is in stock.

Steps to reproduce the problem: Open a product page for a product whose inventory is managed through attribute combinations, having some of the combinations unavailable or out of stock.

Suggested solution

Server side

  1. shoppingcart/productdetails_attributechange action should receive one more parameter: selected_product_attribute_id, which is the id of the attribute that user clicked on.
  2. if shoppingcart/productdetails_attributechange action receives selected_product_attribute_id it should return one more property:
    ...
    accepted_attribute_values: [
    {
    attribute_id: 1981,
    accepted_value_ids: [123, 123],
    unaccepted_value_ids: [222]
    },
    {
    attribute_id: 1981,
    accepted_value_ids: [127, 128],
    unaccepted_value_ids: []
    }
    ]
    ...

This result will be built using these rules:
2.1. Find all product attribute combinations that are valid for the selected value of selected_product_attribute_id.
2.2. For each attribute in the product, buld a return object with these properties:
attribute_id - id of that attribute
accepted_value_ids - go through all attribute values and pick those that appear in acceptable combinations
unaccepted_value_ids - the opposite from accepted_value_ids

Client side

When shoppingcart/productdetails_attributechange is completed, for all attribute values remove css classes "accepted" and "unaccepted". For all attribute values in the accepted_value_ids list, add "accepted" css class, for the ones in unaccepted_value_ids add "unaccepted" css class.

Hi Vucetica,

I don't understand.
Can you help me? Please.

Best Regards,
Araujovski.

@vucetica
Copy link
Author

Hi @Araujovski.

Can you clarify? Which part you don't understand?

@Araujovski
Copy link

Araujovski commented Dec 20, 2019 via email

@vucetica
Copy link
Author

@Araujovski , I didn't implement this in the end (and not working on nopcommerce stuff these days). Guys from nopcommerce marked it as onhold/won't do. I see that it is active now, and I'm not sure if someone from the nopcommerce team is working on it.

@Araujovski
Copy link

Araujovski commented Dec 20, 2019 via email

@vucetica
Copy link
Author

Sorry, not on the project anymore.

@Araujovski
Copy link

Araujovski commented Dec 20, 2019 via email

@vucetica
Copy link
Author

@Araujovski , I really don't understand the question. What do you mean by "what you can call client side controller values"? Can you give me an example?

@Araujovski
Copy link

Araujovski commented Dec 20, 2019 via email

@vucetica
Copy link
Author

I'm sorry, I can't help you with that.

@Araujovski
Copy link

Araujovski commented Dec 20, 2019 via email

@holydk
Copy link
Contributor

holydk commented Feb 21, 2021

Closed #2909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants