Related Products Urgent......


hello,
      
i have problem regarding related products.

by getrelatedproducts method 9 collumns coming  properties.

like displayname, cy_list_price, cy_list_class, description........

but want image_filename property of related product. image of product.

i using code getting related products.

 

protected override void onload(eventargs e)
    {
      
 base.onload(e);

       
catalogcontext context = commercecontext.current.catalogsystem;
       
string strproductname = httpcontext.current.request["productid"];
       
product = context.getproduct("amazingcatalog", strproductname);
       
dataset rldproducts = product.relatedproducts;
       
datatable relatedproducts = rldproducts.tables[0];
       
        if (!ispostback)
        {
            relatedproduct(relatedproducts);
        }
     }

 

private void relatedproduct(datatable relatedproducts)
    {
        string strdynamictable;
        int rows = relatedproducts.rows.count;
        if (rows != 0)
        {
            strdynamictable = "<strong><h3>related product</h3></strong><br/>";
            strdynamictable += "<table border='2'>";

            (int = 0; < rows; i++)
            {
                strdynamictable += "<tr>";
                strdynamictable += "<td> ";
                strdynamictable += "<a href='";
                strdynamictable += "products.aspx?catalog=amazingcatalog&amp;productid=";

                strdynamictable += relatedproducts.rowsidea["productid"].tostring();
                strdynamictable += "'class='mainlevel' >";
                //strdynamictable += "'>";
                strdynamictable += relatedproducts.rowsidea["displayname"].tostring();
                strdynamictable += "</a>";
                strdynamictable += "</td>";
                strdynamictable += "</tr>";
            }
            strdynamictable += "</table>";
           
            response.write(strdynamictable);
        }
    }


but code not getting product image....
so pls me out..........

 

hi

 

the relatedproducts propety returns catalogrelationshipsdataset.

see following link descriptions of columns in datataset.

http://msdn2.microsoft.com/en-us/library/bb219205.aspx

 

if want more product level information, need load product instance targetcatalogname and targetproductid fields of catalogrelationshipdataset. object, can access products fields need.

 

hope helps

 

j-p 

 

 

 



Commerce Server  >  Commerce Server 2007



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'