I have built my ampscript code for one to many relationship but every time i am only getting first row for my lookup data extension as i have one customer id in my first data extension and based on this id i have 3 products records related to this customers id, So i try to populate all 3 records from lookup data extension i am getting only first row repeated record. Please review my below code
<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse;
}
table, td, th {
border: 1px solid black;
}
</style>
</head>
<body>
<h2>Wish List Items</h2>
<table>
<tr>
<th>Product Name</th>
<th>Product Code</th>
<th>Product Quantity</th>
</tr>
<tr>
%%[
var @ids,@count,@prodctid,@acount
set @ids = AttributeValue("Id")
set @acount = RowCount(LookupRows('WishList__c','Id',@ids))
set @count = RowCount(LookupRows('Wish_List_Item__c','Wish_List__c',@ids))
FOR @i = 1 to @acount DO ]%%
%%[FOR @j = 1 to @count DO
set @prodctid = Lookup("Wish_List_Item__c","Id","Wish_List__c",@ids)
]%%
<td>%%=Lookup("Wish_List_Item__c","Name","Id",@prodctid)=%%</td>
<td>%%=Lookup("Wish_List_Item__c","Product_Code__c","Id",@prodctid)=%%</td>
<td>%%=Lookup("Wish_List_Item__c","Product_Quantity__c","Id",@prodctid)=%%</td>
</tr>
%%[next @j
]%%
%%[
next @i ]%%
</table>