262
Views
3
Comments
Solved
I wanna assign variable for each list
Question

I wanna do something like this, but what I'm missing is how I should assign the size after choosing it, as the user should choose a size and Qty and add it to cart.

I created a block with gallery list to list the items, but when it came the choosing the size I don't know how to implement it, I wanna assign a variable for each list:


and Here's the data I have:

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Abeer,

As per the ERD - Each Product record can have association with multiple Product Attribute records (i.e. 1-M Relationship type)

i.e. In the stock, a cloth with multiple size are available


Solution:

1) Encapsulate the Size Dropdown inside a block i.e. let's call it ProductSize

2) Define an input parameter (i.e. InputProductId) to the ProductSize block and pass the ProductId as input parameter value

3) Within the ProductSize block scope, define an aggregate with 

Source: ProductAttribute Entity

Filter condition: ProductAttribute.ProductId = InputProductId

4) Map the Aggregate Output list to Size Dropdown

5) On the selection of Size trigger an event and pass the selected size value from ProductSize block to the parent screen


If you are facing any challenges in implementation, if possible please share the .oml file..


Hope this helps you!


Regards,

Benjith Sam

2022-07-21 14-07-25
Abeer elAssal
 
MVP

Benjith Sam wrote:

Hi Abeer,

As per the ERD - Each Product record can have association with multiple Product Attribute records (i.e. 1-M Relationship type)

i.e. In the stock, a cloth with multiple size are available


Solution:

1) Encapsulate the Size Dropdown inside a block i.e. let's call it ProductSize

2) Define an input parameter (i.e. InputProductId) to the ProductSize block and pass the ProductId as input parameter value

3) Within the ProductSize block scope, define an aggregate with 

Source: ProductAttribute Entity

Filter condition: ProductAttribute.ProductId = InputProductId

4) Map the Aggregate Output list to Size Dropdown

5) On the selection of Size trigger an event and pass the selected size value from ProductSize block to the parent screen


If you are facing any challenges in implementation, if possible please share the .oml file..


Hope this helps you!


Regards,

Benjith Sam

 

 Thanks a lot for your reply, that solves my problem!

2021-03-18 21-03-15
Benjith Sam
 
MVP

Abeer ElAssal wrote:

Thanks a lot for your reply, that solves my problem!

You are most welcome, Abeer :)

Glad I could be of help :)


Regards,

Benjith Sam

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.