Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Search
Search


Forum Index » Templates

Post new topic   Reply to topic
Modifying a template.
View previous topic :: View next topic  
Author Message
alpha-bid



Joined: 04 Oct 2005
Posts: 120

PostPosted: Thu Jan 12, 2006 8:40 pm    Post subject: Modifying a template. Reply with quote

How can I produce a template like "packing slips/standard" but ommiting the title bar, store name and store inforamation?
Thanks
Back to top
View user's profile
Wes
Site Admin


Joined: 07 Oct 2002
Posts: 7427

PostPosted: Fri Jan 13, 2006 4:17 pm    Post subject: Reply with quote

Hello,

The following template would accomlish the desired result:

Code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sw="http://www.interapptive.com/shipworks" extension-element-prefixes="sw">

<sw:settings>
    <sw:general>
        <sw:context>order</sw:context>
    </sw:general>
</sw:settings>   

<!-- Use the base Standard Template -->
<xsl:import href="System\Standard Order Template" />
 
<!-- Specify the template properties -->
<xsl:variable name="templateType" select="'packingslip'" />
<xsl:variable name="showThumbnails" select="false()" />

<xsl:output method="html" encoding="utf-8" />

<xsl:template name="outputPageHeader" />


<xsl:template name="outputBaseTemplateContent">

    <!-- If there is not just a single order its an error -->
    <xsl:if test="count(//Order) != 1">
        <p>
            This template is designed to be per-order.  There are currently
            <xsl:value-of select="count(//Order)" /> orders in the XML input source.
        </p>
        <p>
            Please adjust the template settings to be processed per-order.
        </p>
    </xsl:if>
   
    <!-- Continue if there is only a single order as input -->
    <xsl:if test="count(//Order) = 1">
   
    <xsl:variable name="order" select="//Order[1]" />

   <xsl:call-template name="outputPageHeader" />
   
    <table id="headerInfo">
        <tr>
       
            <xsl:call-template name="outputHeaderPreAddress" />       
       
            <td id="storeAddress">

            </td>
         
            <td id="orderinfo">
                <div> <!-- This div is used only to provide a border -->
                    <table cellspacing="0">
                        <tr><td class="label">Order:</td><td class="value"><xsl:value-of select="$order/Number" /></td></tr>
                       <tr><td class="label">Placed:</td><td class="value"><xsl:value-of select="sw:ToShortDate($order/Date)" /></td></tr>
                    </table>
                </div>
            </td>
        </tr>
    </table>

   <xsl:call-template name="outputShipBillHeader" />
   
    <xsl:call-template name="outputShipToBillTo">
        <xsl:with-param name="order" select="$order" />
    </xsl:call-template>
   
   <xsl:call-template name="outputOrderDetailsHeader" />
   
    <xsl:call-template name="outputOrderDetails">
        <xsl:with-param name="order" select="$order" />
        <xsl:with-param name="showThumbnails" select="$showThumbnails" />
        <xsl:with-param name="showAmounts" select="$templateType = 'invoice'" />
    </xsl:call-template>
   
    <xsl:call-template name="outputOrderDetailsFooter" />
   
    <xsl:if test="$templateType = 'invoice'">
   
       <xsl:call-template name="outputOrderTotalsHeader" />
   
        <xsl:call-template name="outputOrderTotals">
            <xsl:with-param name="order" select="$order" />
        </xsl:call-template>
       
    </xsl:if>
   
    <div style="width: {//ContentWidth} in;">
        <xsl:call-template name="outputPageFooter" />
    </div>
   
    <!-- This is the end of the test ensuring a single order -->
    </xsl:if>
       
</xsl:template>



</xsl:stylesheet>


Please let us know if you have further questions.

Thanks,

Wes
Interapptive, Inc.


Last edited by Wes on Sat Jan 14, 2006 7:36 am; edited 1 time in total
Back to top
View user's profile Visit poster's website
alpha-bid



Joined: 04 Oct 2005
Posts: 120

PostPosted: Fri Jan 13, 2006 4:50 pm    Post subject: Reply with quote

Nice! works great. thanks
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic     Forum Index » Templates All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  

Powered by phpBB © 2001, 2002 phpBB Group