Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: display shipping cost table on product page

  1. #1
    deselt is offline Senior Member
    Join Date
    Mar 2009
    Posts
    100

    Default display shipping cost table on product page

    I have individual item shipping cost. It’s any way to display shipping cost table on product page.

  2. #2
    AspDotNetStorefront Staff - Lindsay is offline Junior Member
    Join Date
    Jun 2012
    Location
    Ashland, OR
    Posts
    7

    Default Displaying Shipping Cost Table on Product Page

    You'll want to add a query to your product xml package that selects the individual item shipping cost and pass in the productid as a parameter:

    Code:
    <query name="Shipping" rowElementName="Cost">
    <sql>
    <![CDATA[
    select SomeValue as Cost, SomeValue as Method from SomeTable with (NOLOCK) 
    where ProductId=@ProductId
    ]]>
    </sql>
    <queryparam paramname="@ProductId"
    paramtype="request"
    requestparamname="ProductId"
    sqlDataType="int"
    defvalue="0"
    validationpattern="" />
    </query>
    They will become available in the XML and you can then transform them in the XSLT.

    You'll want to create a new template in your XSLT:

    Code:
    <xsl:template match="Cost">
    <div class="shipCost">
    <xsl:value-of select="Method"/> : <xsl:value-of select="Cost"/>
    </div>
    </xsl:template>
    and then call it from wherever you want it to display in the package:
    Code:
    <xsl:apply-template select="/root/Shipping/Costs"/>