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.

Learn more about...

AspDotNetStorefront
DotFeed

How to modify the Kit Products XML Package?

I'm running storefront version ML 8.0.1.4, no source code.

When I have a kit product and use the product.kitproduct.xml.config file, the page output will show the Base Price, Customized Price and the customer level price with the base price and customized price crossed out. I want to remove the strikethroughs from the base and customized prices and hide or remove the customer level price.  Where in the XML file can I modify how these display?
asked Jun 10, 2015 in ML by Potzi (380 points)

1 Answer

0 votes
I'm on a newer version than you (9.2.0.0), but the strikethrough you're seeing on those prices should be set in the CSS with a rule "text-decoration: line-through;"

The strikethrough behavior is pretty common across price displays, so if you intend to limit the change to only kit items, then you may need to change the element class or ID on the kit-item prices (this is done in the kit XML package) and copy the desired rules - leaving out the line-throughs - to new style rules that reference the class or ID values that you set on those price elements.

You should be able to right-click on the prices and "Inspect Element" to open your web browser's developer tools (F12) and see the CSS rules in effect for that element.
answered Jun 11, 2015 by Chris (3,685 points)

When I open the developer tools, the strikethrough isn't set with CSS. It's a <strike> tag. Even if the strikethrough was in the CSS, that won't help me remove the customer level text. The first sceenshot below shows how it is currently displaying along with the developer tools console showing the <strike> tags being used. The second screenshot is what I want it to look like. I can't find anywhere in the XML package where I could make this change. XML package code is below.




 

<?xml version="1.0" encoding="utf-8" ?>
<package displayname="Kit Product" version="2.1" debug="false" includeentityhelper="true">

	<!-- ###################################################################################################### -->
	<!-- Copyright AspDotNetStorefront.com, 1995-2011.  All Rights Reserved.					                -->
	<!-- http://www.aspdotnetstorefront.com														                -->
	<!-- For details on this license please visit  the product homepage at the URL above.		                -->
	<!-- THE ABOVE NOTICE MUST REMAIN INTACT.                                                                   -->
	<!--                                                                                                        -->
	<!-- ###################################################################################################### -->


    <query name="Products" rowElementName="Product">
        <sql>
            <![CDATA[
                exec dbo.ism_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="" />
		<!-- Brian Hayes 7/27/2011 (ISM) Added the following queryparam node so query can ref CustomerID... -->
		<queryparam paramname="@CustID" paramtype="system" requestparamname="CustomerID" sqlDataType="int" defvalue="0" validationpattern="" />
    </query>

    <query name="KitItems" rowElementName="Item">
        <sql>
            <![CDATA[
                SELECT * FROM kitgroup
                where ProductID = @ProductID
                ORDER BY DisplayOrder
            ]]>
        </sql>
        <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
    </query>
    <PackageTransform>
        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
            <xsl:output method="html" omit-xml-declaration="yes" />

            <xsl:param name="LocaleSetting" select="/root/Runtime/LocaleSetting" />
            <xsl:param name="WebConfigLocaleSetting" select="/root/Runtime/WebConfigLocaleSetting" />

            <xsl:param name="SecID">
                <xsl:choose>
                    <xsl:when test="count(/root/QueryString/sectionid) &gt; 0">
                        <xsl:value-of select="/root/QueryString/sectionid" />
                    </xsl:when>
                    <xsl:otherwise>0</xsl:otherwise>
                </xsl:choose>
            </xsl:param>


            <xsl:param name="CatID">
                <xsl:choose>
                    <xsl:when test="count(/root/QueryString/categoryid) &gt; 0">
                        <xsl:value-of select="/root/QueryString/categoryid" />
                    </xsl:when>
                    <xsl:otherwise>0</xsl:otherwise>
                </xsl:choose>
            </xsl:param>


            <xsl:param name="ManID">
                <xsl:choose>
                    <xsl:when test="count(/root/QueryString/manufacturerid) &gt; 0">
                        <xsl:value-of select="/root/QueryString/manufacturerid" />
                    </xsl:when>
                    <xsl:otherwise>0</xsl:otherwise>
                </xsl:choose>
            </xsl:param>

            <xsl:param name="CartRecID">
                <xsl:choose>
                    <xsl:when test="/root/QueryString/cartrecid">
                        <xsl:value-of select="/root/QueryString/cartrecid" />
                    </xsl:when>
                    <xsl:otherwise>0</xsl:otherwise>
                </xsl:choose>
            </xsl:param>
            
                
            <xsl:template match="/">
                <xsl:choose>
                    <xsl:when test="/root/Products/Product/IsAKit='0'">
                        <b>This XMLPackage is designed to work with Kit products only</b>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:apply-templates select="/root/Products/Product"></xsl:apply-templates>
                    </xsl:otherwise>
                </xsl:choose>                
            </xsl:template>

            <xsl:template match="Product">
                <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
                <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
                <xsl:param name="HidePriceUntilCart" select="HidePriceUntilCart" />
                <xsl:param name="ProductID" select="ProductID" />
                <xsl:param name="q"><xsl:if test="$CartRecID&gt;0">?CartRecID=<xsl:value-of select="$CartRecID" /></xsl:if></xsl:param>
				<xsl:param name="EntityID"><xsl:value-of select="/root/Runtime/EntityID"/></xsl:param>
				<xsl:param name="EntityName"><xsl:value-of select="/root/Runtime/EntityName"/></xsl:param>
                <xsl:param name="AltText">
                    <xsl:choose>
                        <xsl:when test="aspdnsf:GetMLValue(SEAltText)=''"><xsl:value-of select="aspdnsf:GetMLValue(Name)" /></xsl:when>
                        <xsl:otherwise><xsl:value-of select="aspdnsf:GetMLValue(SEAltText)" /></xsl:otherwise>
                    </xsl:choose>
                </xsl:param>

                <table border="0" cellpadding="0" cellspacing="4" width="100%">

                    <tr>
                        <td align="center" valign="top" width="40%">
                            <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                        </td>
                        <td align="left" valign="top" >
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td align="right">
                                        <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left" valign="top" width="40%">
                                        <div  class="ProductNameText">
                                            <xsl:value-of select="aspdnsf:Decode($pName)" disable-output-escaping="yes"/>
                                        </div>
                                        <xsl:value-of select="aspdnsf:ProductSpecsLink(ProductID, SpecsInline, SpecTitle, SKU, SpecCall)" disable-output-escaping="yes" />
                                        <br/>
                                        <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes"/>
                                        <div align="left">
                                            <xsl:value-of select="aspdnsf:Decode($pDescription)" disable-output-escaping="yes"/>
                                        </div>
                                        <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductID)" disable-output-escaping="yes" />
                                        <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID)" disable-output-escaping="yes" />
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <td height="10"></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <hr size="1" color="#666666" />
                <br clear="all" />
                <xsl:value-of select="aspdnsf:GetJSPopupRoutines()" disable-output-escaping="yes" />
												<span>
													<xsl:attribute name="id">KitPrice</xsl:attribute>
                <xsl:value-of select="aspdnsf:GetKitPrice(ProductID, CustPrice, SalePrice,ExtendedPrice, HidePriceUntilCart, Colors, $CartRecID, TaxClassID)" disable-output-escaping="yes" />
				</span>

                <script type="text/javascript">
                    <![CDATA[
                    function deleteimage(itemID, el)
                    {
                        el.innerHTML='';
                        var fn = document.getElementById('FileNameH_'+itemID);
                        var imgfn = document.getElementById('Img_'+itemID);
                        fn.value='';
                        imgfn.style.display ='none';
                    }
                ]]>
                </script>
                
                
                <form method="post" enctype="multipart/form-data">
                    <xsl:attribute name="action"><xsl:value-of select="aspdnsf:ProductLink(ProductID, SEName, 0, '')" /><xsl:value-of select="$q" /></xsl:attribute>
                    <input type="hidden" name="IsKitSubmit" value="true" />
                    <input type="hidden" name="CartRecID" value="{$CartRecID}" />
                    <xsl:for-each select="/root/KitItems/Item">
                        <xsl:variable name="vName" select="aspdnsf:GetMLValue(Name)"></xsl:variable>
                        <xsl:variable name="vDescription" select="aspdnsf:GetMLValue(Description)"></xsl:variable>
                        <xsl:value-of select="aspdnsf:GetKitItemOptions($ProductID, KitGroupID, IsRequired, $vName, $vDescription, KitGroupTypeID, $HidePriceUntilCart, number($CartRecID), /root/Products/Product/TaxClassID)" disable-output-escaping="yes" />
                    </xsl:for-each>
					
                    <div align="center">
					    <br/>
						<xsl:if test="aspdnsf:AppConfigBool('WholesaleOnlySite') = 'false' or /root/System/CustomerLevelID > 0">
							<xsl:choose>
								<xsl:when test="$HidePriceUntilCart=0">
									<input>
										<xsl:choose>
											<xsl:when test="$CartRecID=0">
												<xsl:attribute name="type">submit</xsl:attribute>
												<xsl:attribute name="value">
													<xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.17')"/>
												</xsl:attribute>
											</xsl:when>
											<xsl:otherwise>
												<xsl:attribute name="type">submit</xsl:attribute>
												<xsl:attribute name="value">
													<xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.40')"/>
												</xsl:attribute>
											</xsl:otherwise>
										</xsl:choose>
									</input>
								</xsl:when>
								<xsl:otherwise>
									<input>
										<xsl:attribute name="type">submit</xsl:attribute>
										<xsl:attribute name="value">
											<xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.18')"/>
										</xsl:attribute>
									</input>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:if>
					</div>
                </form>
				<div>
				<br/>
                    <xsl:value-of select="aspdnsf:RelatedProducts(ProductID)" disable-output-escaping="yes"/>
                    <xsl:value-of select="aspdnsf:RecentlyViewed(ProductID)" disable-output-escaping="yes"/>
                    <xsl:value-of select="aspdnsf:ShowUpsellProducts(ProductID)" disable-output-escaping="yes"/>
					          <xsl:value-of select="aspdnsf:AlsoBought(ProductID, VariantID)" disable-output-escaping="yes"/>
					          <xsl:value-of select="aspdnsf:ProductSpecs(ProductID, 1, SpecsInline, SpecCall, 400)" disable-output-escaping="yes"/>
                    <xsl:value-of select="aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1)" disable-output-escaping="yes"/>
				</div>
            </xsl:template>
        </xsl:stylesheet>
    </PackageTransform>
</package>

 

That's the difference between the 8.x versions and 9.x versions, then.

The <strike> kit price block is actually being created from a location in the source code based on arguments passed with the method call. You can see this on line 148 of the XML package where there's a call to aspdnsf:GetKitPrice().

You have some options, though they vary pretty greatly in terms of complexity. Probably the easiest thing to do is to not use that method call, replacing it in the XML package with the markup and styling that you want to use.

You could also go about creating an override XSLTExtension class and re-defining a set of methods to use for this stuff. You'd gain a lot of portability that way (able to use same code across multiple XML packages), but it can rapidly become a daunting task.

I'm glad you posted the code and everything, that makes it a lot easier to see the differences between our versions.
...