Results 1 to 2 of 2

Thread: display shipping cost table on product page

  1. #1
    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
    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"/>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •