Looking for old forum posts and information? View the old forum archive here ยป
Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

A static copy of our previous forums website is available online for reference. Click here to access the forum archive.

Learn more about...

AspDotNetStorefront
DotFeed

Getting Error when trying to use Variants

I'm trying to set up a product page that uses the XML package product.variantsintablecondensed.xml.config and I keep getting the error "Procedure or function aspdnsf_ProductInfo has too many arguments specified". In fact, any of the product.variantsin_.xml.config produce this error. 

The source file is showproduct.aspx.vb and the source error is as follows:
Using p As XmlPackage2 = New XmlPackage2(m_XmlPackage, ThisCustomer, SkinID, "", "EntityName=" & SourceEntity & "&EntityID=" & SourceEntityID.ToString() & CommonLogic.IIF(CommonLogic.ServerVariables("QUERY_STRING").IndexOf("cartrecid") <> -1, "&cartrecid=" & CommonLogic.QueryStringUSInt("cartrecid").ToString(), "&showproduct=1"), String.Empty, True)

The query in the XML package is below:
<query name="Products" rowElementName="Product">
        <sql>
            <![CDATA[
                exec dbo.aspdnsf_ProductInfo @ProductID, @CustomerLevelID, 1, 0, @affiliateID, 1, @CustID
            ]]>
        </sql>
        <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
        <queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@affiliateID"     paramtype="system"  requestparamname="AffiliateID"     sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@CustID" paramtype="system" requestparamname="CustomerID" sqlDataType="int" defvalue="0" validationpattern="" />
    </query>
    <query name="Variants" rowElementName="Variant">
        <sql>
            <![CDATA[
                SELECT pv.VariantID, pv.ProductID, pv.Description as VariantDescription, pv.name VariantName, pv.skusuffix, pv.Price,
                       isnull(pv.saleprice, 0) SalePrice, isnull(pv.colors, '') Colors, isnull(pv.sizes, '')  Sizes, pv.ImageFilenameOverride,
                       pv.Dimensions, pv.Weight, isnull(pv.Points, 0) Points,
                       case when pcl.productid is null then 0 else isnull(e.Price, 0) end ExtendedPrice,
                       p.TaxClassID, isnull(pv.CustomerEntersPrice, 0) CustomerEntersPrice, dbo.ism_fnCustPrice(@CustID, pv.VariantID, pv.Price, 1) AS CustPrice
                FROM dbo.ProductVariant pv with (nolock)
                    join dbo.product p with (nolock) on pv.ProductID = p.ProductID
                    left join dbo.ExtendedPrice e with (nolock) on pv.VariantID=e.VariantID and e.CustomerLevelID=@CustomerLevelID
                    left join dbo.ProductCustomerLevel pcl with (NOLOCK) on p.ProductID = pcl.ProductID and pcl.CustomerLevelID = @CustomerLevelID
                WHERE pv.ProductID = @ProductID and pv.Published = 1 and pv.Deleted = 0
                ORDER BY pv.DisplayOrder, pv.Name

            ]]>
        </sql>
        <queryparam paramname="@CustomerLevelID" paramtype="system"  requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
        <queryparam paramname="@CustID" paramtype="system" requestparamname="CustomerID" sqlDataType="int" defvalue="0" validationpattern="" />
    </query>
 

Any idea what is causing this error and how I can fix it?
I assumed that since this xml package comes standard with StoreFront that it work as is without having to modify any code. 

I'm using version ML 8.0.1.4/8.0.1.4. Don't have source code.

asked May 30, 2014 in ML by Potzi (380 points)

1 Answer

0 votes
Looks like someone tried to make some modifications there at some point.  The aspdnsf_ProductInfo sproc only takes 5 parameters in version 8.0.1.4.  There is no CustomerID parameter, and none of the variant* XML packages try to provide that parameter 'out of the box'.

You could try removing the last parameter from the SQL query and the list of queryparams under it, but it might be a good idea to track down who did (or started) that mod and why, just in case there are other things you need to clean up.
answered Jun 2, 2014 by Vortx ScottS (13,380 points)
Thanks Scott. Your answer helped me figure out what was wrong. I was accessing the wrong database table. Once I changed to the correct db table, I was able to display the variants.
...