I am working with two xmlpackages. One of them returns a value from Extension Data and the other one doesn't. I am using GetMLValue(ExtensionData). Is there something that restricts access to this?
I am working with two xmlpackages. One of them returns a value from Extension Data and the other one doesn't. I am using GetMLValue(ExtensionData). Is there something that restricts access to this?
Does anybody have an idea about this?
trying to find this same answer...
John
www.Beadaholique.com
In product.variantsinrightbar.xml.config:
both <xsl:value-of select="$pName" disable-output-escaping="yes" /> and <xsl:value-of select="$pSKU" disable-output-escaping="yes" /> correctly output the data.Code:<xsl:template match="Product"> <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"/> <xsl:param name="pSKU" select="aspdnsf:GetMLValue(SkuSuffix)"/> ...
but in entity.gridwithprices.xml.config:
<xsl:value-of select="$pName" disable-output-escaping="yes" /> correctly outputs the data BUTCode:<xsl:template match="Product"> <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"/> <xsl:param name="pSKU" select="aspdnsf:GetMLValue(SkuSuffix)"/> ...
<xsl:value-of select="$pSKU" disable-output-escaping="yes" /> is empty.
Why is this? Would love some help with this.
John
www.Beadaholique.com
The 2 different xmlpackages have different SQL queries which return different data - one of them has the data you want & the other doesn't.
TTFN
BFG
I figured that was where the problem was... but I haven't a clue how to edit the entity.gridwithprices.xml.config sql query so that it will grab SkuSuffix for each product in the category.
Any suggestions?
John
www.Beadaholique.com
SKUSuffix is actually a variant field - so you actually need to grab the SKUSuffix for each variant of each product in the category.
That xmlpackage as default uses a stored procedure (aspdnsf_GetProducts) so you'd need to modify that (or write an SQL query that pulls only the data you actually need).
TTFN
BFG
I have no idea how to do that.....
Where in the manual does it explain how to do that? Or are there other resources online you'd recommend so I can teach myself how to do this?
John
www.Beadaholique.com
is there something I can just add to this to get SkuSuffix? One line or several lines or does it require a complete rewrite?
Code:<query name="Products" rowElementName="Product"> <sql> <![CDATA[ exec dbo.aspdnsf_GetProducts @categoryID = @CatID, @sectionID = @SecID, @manufacturerID = @ManID, @distributorID = @DistID, @genreID = @GenreID, @vectorID = @VectorID, @localeName = @locale, @CustomerLevelID = @CustLevelID, @affiliateID = @AffID, @ProductTypeID = @ProdTypeID, @ViewType = 1, @pagenum = @pgnum, @pagesize = null, @StatsFirst = 0, @publishedonly = 1, @ExcludePacks = 0, @ExcludeKits = 0, @ExcludeSysProds = 0, @InventoryFilter = @InvFilter, @sortEntityName = @entityname ]]> </sql> <queryparam paramname="@CatID" paramtype="runtime" requestparamname="CatID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@SecID" paramtype="runtime" requestparamname="SecID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@ManID" paramtype="runtime" requestparamname="ManID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@DistID" paramtype="runtime" requestparamname="DistID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@GenreID" paramtype="runtime" requestparamname="GenreID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@VectorID" paramtype="runtime" requestparamname="VectorID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@locale" paramtype="runtime" requestparamname="LocaleSetting" sqlDataType="varchar" defvalue="en-US" validationpattern="" /> <queryparam paramname="@CustLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@AffID" paramtype="runtime" requestparamname="AffiliateID" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@ProdTypeID" paramtype="runtime" requestparamname="ProductTypeFilterID" sqlDataType="int" defvalue="1" validationpattern="" /> <queryparam paramname="@pgnum" paramtype="request" requestparamname="pagenum" sqlDataType="int" defvalue="1" validationpattern="" /> <queryparam paramname="@InvFilter" paramtype="appconfig" requestparamname="HideProductsWithLessThanThisInventoryLevel" sqlDataType="int" defvalue="0" validationpattern="" /> <queryparam paramname="@entityname" paramtype="runtime" requestparamname="EntityName" sqlDataType="varchar" defvalue="" validationpattern="" /> </query>
John
www.Beadaholique.com
The sql query:
<!-- Needed to show variant info -->
<query name="Variants" rowElementName="Variant">
<sql>
<![CDATA[
SELECT * FROM ProductVariant PV WITH(NOLOCK)
WHERE PV.ProductID = @ProductID
AND PV.Published = 1 AND PV.Deleted = 0
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
</query>
<!-- Needed to show variant info -->
In the variant template: <xsl:template name="Variant">
<xslaram name="pName" select="aspdnsf:GetMLValue(Name)"/>
<xslaram name="vName" select="aspdnsf:GetMLValue(VariantName)"/>
<xslaram name="vDescription" select="aspdnsf:GetMLValue(VariantDescription)"/>
<xslaram name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"/>
<!-- Needed to show variant info -->
<xslaram name="vID" select="VariantID"/>
<xslaram name="vID2" select="VariantID2"/>
<xslaram name="vID3" select="VariantID3"/>
<xslaram name="vID4" select="VariantID4"/>
In the variant HTML:
<xsl:value-of select="$vDescription" disable-output-escaping="yes"/>
<xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ManufacturerPartNumber" disable-output-escaping="yes"/>
<xsl:value-of select="SkuSuffix"/>
<xsl:value-of select="$vName" disable-output-escaping="yes" />
<xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ManufacturerPartNumber" disable-output-escaping="yes"/>
<xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ExtensionData" disable-output-escaping="yes"/>
<xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ExtensionData2" disable-output-escaping="yes"/>
Let me know if it helped. I am using ML Version 8.104