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


Forum Index » Templates

Post new topic   Reply to topic
Display Option Code to the end of the Product Code?
View previous topic :: View next topic  
Author Message
dpaulos



Joined: 06 Apr 2004
Posts: 7

PostPosted: Wed Sep 07, 2005 10:44 pm    Post subject: Display Option Code to the end of the Product Code? Reply with quote

Hello, Each of my product codes has approx. 4 sizes.
In Shop Invoice, I was able to modify the packing slip and pick list templates to display the size/option of each item and put it right next to the product code (so my fulfillment knows exactly what the customer bought).

Example: If the product code currently reads 91 and someone orders a size medium, I would like the "M" (which is the code that I have set up in Miva and already shows up under the product description in the Packing Slip - Standard template) to be added to the end of it. I'm making progress, but not yet convinced I can do this myself.

I would like the code to read "91M" if possible. Currently the option prompt also shows up; I would like to remove this and just display the code for the actual size/option.
Thanks in advance for any assistance.
Dina
Back to top
View user's profile
Wes
Site Admin


Joined: 07 Oct 2002
Posts: 7427

PostPosted: Fri Sep 09, 2005 7:24 am    Post subject: Reply with quote

Hello,

If you add the following code to your desired template to override the outputOrderDetails section, you can make modifications to the portion of the code responsible for outputting the order options, and have order options displayed next to the product code.


Code:
<!--                                                            -->
<!-- Outputs a table with all order items and options           -->
<!--                                                            -->
<xsl:template name="outputOrderDetails">
    <xsl:param name="order" />
    <xsl:param name="showAmounts" select="true()" />
    <xsl:param name="showThumbnails" select="false()" />

   <table id="orderdetails" cellspacing="0">
   
      <tr class="header">
            <xsl:if test="$showThumbnails">
                <td style="width: 50px;">Image</td>
            </xsl:if>
         <td style="width: 20%;">Item #</td>
         <td>Name</td>
         <td align="right">QTY</td>
            <xsl:if test="$showAmounts">
             <td align="right">Price</td>
             <td align="right">Total</td>
            </xsl:if>
      </tr>

      <xsl:for-each select="$order/Item">
         <tr class="orderitem">
                <xsl:if test="$showThumbnails">
                    <td>                     
                        <xsl:if test="Thumbnail != ''">
                     <img src="{Thumbnail}" alt="" style="height:50; width:50; border:0;" />
                  </xsl:if>
                    </td>
                </xsl:if>
            <td>
                    <xsl:if test="//StoreType = 'eBay'">
                        <a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&amp;item={Code}"><xsl:value-of select="Code" /></a>
                    </xsl:if>   
                    <xsl:if test="//StoreType != 'eBay'">
                        <xsl:value-of select="Code" />
                    </xsl:if>
                </td>
            <td><xsl:value-of select="Name" /></td>
            <td align="right"><xsl:value-of select="Quantity" /></td>
                <xsl:if test="$showAmounts">
                <td align="right"><xsl:value-of select="format-number(UnitPrice, '#,##0.00')" /></td>
                <td align="right"><xsl:value-of select="format-number(UnitPrice * Quantity, '#,##0.00')" /></td>
                </xsl:if>
            </tr>
         
         <xsl:for-each select="Option">
            <tr class="itemoption">
                    <xsl:if test="$showThumbnails">
                        <td></td>
                    </xsl:if>
               <td></td>
               <td>
                  <table class="itemoptionname" style="width: 100%;" cellspacing="0">
                     <tr>
                        <td nowrap="nowrap"><xsl:value-of select="Name" />: </td>
                        <td style="width: 100%;"><xsl:value-of select="Description" /></td>
                     </tr>
                  </table>
                </td>
                    <td></td>
                    <xsl:if test="$showAmounts">
                        <xsl:if test="UnitPrice != 0">
                   <td align="right"><xsl:value-of select="format-number(UnitPrice, '#,##0.00')" /></td>
                   <td align="right"><xsl:value-of select="format-number(UnitPrice * ../Quantity, '#,##0.00')" /></td>
                        </xsl:if>
                        <xsl:if test="UnitPrice = 0">
                            <td></td>
                            <td></td>
                        </xsl:if>
                    </xsl:if>
            </tr>
         </xsl:for-each>
      </xsl:for-each>
       
   </table>           
       
</xsl:template>


For example, you might modify the above to read:


Code:
<!--                                                            -->
<!-- Outputs a table with all order items and options           -->
<!--                                                            -->
<xsl:template name="outputOrderDetails">
    <xsl:param name="order" />
    <xsl:param name="showAmounts" select="true()" />
    <xsl:param name="showThumbnails" select="false()" />

   <table id="orderdetails" cellspacing="0">
   
      <tr class="header">
            <xsl:if test="$showThumbnails">
                <td style="width: 50px;">Image</td>
            </xsl:if>
         <td style="width: 20%;">Item #</td>
         <td>Name</td>
         <td align="right">QTY</td>
            <xsl:if test="$showAmounts">
             <td align="right">Price</td>
             <td align="right">Total</td>
            </xsl:if>
      </tr>

      <xsl:for-each select="$order/Item">
         <tr class="orderitem">
                <xsl:if test="$showThumbnails">
                    <td>                     
                        <xsl:if test="Thumbnail != ''">
                     <img src="{Thumbnail}" alt="" style="height:50; width:50; border:0;" />
                  </xsl:if>
                    </td>
                </xsl:if>
            <td>
                    <xsl:if test="//StoreType = 'eBay'">
                        <a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&amp;item={Code}"><xsl:value-of select="Code" /></a>
                    </xsl:if>   
                    <xsl:if test="//StoreType != 'eBay'">
                        <xsl:value-of select="Code" /><xsl:for-each select="Option[Name = 'Size']"><xsl:value-of select="Code" /></xsl:for-each>
                    </xsl:if>
                </td>
            <td><xsl:value-of select="Name" /></td>
            <td align="right"><xsl:value-of select="Quantity" /></td>
                <xsl:if test="$showAmounts">
                <td align="right"><xsl:value-of select="format-number(UnitPrice, '#,##0.00')" /></td>
                <td align="right"><xsl:value-of select="format-number(UnitPrice * Quantity, '#,##0.00')" /></td>
                </xsl:if>
            </tr>
         
         
      </xsl:for-each>
       
   </table>           
       
</xsl:template>

Please let us know if you have further questions.

Thanks,

Wes
Back to top
View user's profile Visit poster's website
dpaulos



Joined: 06 Apr 2004
Posts: 7

PostPosted: Tue Nov 01, 2005 5:17 pm    Post subject: Reply with quote

Hi Wes, thank you so much for all of you help with this previously. i tried on an off for about a month+ goofing around with the code and am constantly getting errors. i thought i would post my template and see if there is an easier fix (for me to add in the size code). just need the attribute (in this case) the size code to print next to the product code.
thank you!!!! dina

[code]
<html>

<head>
<title>
Pick List
</title>

<!-- Output all the CSS required for this template --> <xsl:call-template name="outputStandardCss" />

<style>
h1
{
font-size: 12pt;
}
#orderdetails tr.itemsheader td
{
border-bottom:solid 1px dimgray;
}


</style>

</head>

<body>


<table id="orderdetails" cellspacing="0" cellpadding="0">
<tr><td colspan="7"><b><xsl:value-of select="//Store/StoreName" /> Pick List</b></td></tr>

<xsl:for-each select="//Order">
<xsl:sort select="Number" order="descending" data-type="number" />

<xsl:variable name="address" select="Address[@type='ship']" />


<tr class="header">
<td>Order #</td>
<td>Date</td>
<td>Name</td>
<td>Address</td>
<td>City</td>
<td>State</td>
<td>Zip Code</td>
</tr>




<tr>
<td><xsl:value-of select="Number" /></td>
<td><xsl:value-of select="sw:ToShortDate(Date)" /></td>
<td><xsl:value-of select="$address/FirstName" /> <xsl:value-of select="$address/LastName" /></td>
<td><xsl:value-of select="$address/Line1" /><br /><xsl:value-of select="$address/Line2" /><br /><xsl:value-of select="$address/Line3" /></td>
<td><xsl:value-of select="$address/City" /></td>
<td><xsl:value-of select="$address/StateCode" /></td>
<td><xsl:value-of select="$address/PostalCode" /></td>

</tr>
<tr>
<td colspan="8"></td>
</tr>

<tr class="itemsheader">
<td>Item #</td>
<td>Product</td>
<td>Quantity Ordered</td>
<td>Quantity Picked</td>



</tr>

<xsl:for-each select="Item">

<tr>
<td><xsl:value-of select="Code" /></td>
<td><xsl:value-of select="Name" /></td>
<td><xsl:value-of select="Quantity" /></td>
<td>_____</td>




</tr>
</xsl:for-each>

<xsl:if test="Notes != ''">
<tr>
<td colspan="7"><br /><br />Notes:<xsl:value-of select="Notes" /></td>
</tr>
</xsl:if>





</xsl:for-each>

</table>



</body>
</html>

</xsl:template>

</xsl:stylesheet>
[/code]
Back to top
View user's profile
Wes
Site Admin


Joined: 07 Oct 2002
Posts: 7427

PostPosted: Wed Nov 02, 2005 9:28 am    Post subject: Reply with quote

Hello,

Can you please forward your template file, located in C:\Program Files\ShipWorks\Application Data\Templates to wes@interapptive.com, and I can take a look at the exact code for the template that is giving you problems.

Thanks,

Wes
Interapptive, Inc.
Back to top
View user's profile Visit poster's website
dpaulos



Joined: 06 Apr 2004
Posts: 7

PostPosted: Sat Mar 25, 2006 6:39 pm    Post subject: Need value of size code Reply with quote

hello, I am following up on the email I sent privately a while ago as requested. I have not heard back yet.

I need to find out what will display the attribute code that the customer selects on their order next to my product code on my pick list by customer template.

I've tried variations of the following and have not been succesful <xsl:value-of select="Option[Name = 'Size']" />

I am using the Miva Merchant 4 shopping cart. Thank you for any assistance. My attribute code in Miva is "size" and my attribute prompt is "select size".

[code] <xsl:for-each select="Item">

<tr>
<td><xsl:value-of select="Code" />SIZE CODE HERE</td>
<td><xsl:value-of select="Name" /></td>
<td><xsl:value-of select="Quantity" /></td>
<td>_____</td>


</tr>
</xsl:for-each>[/code]
thanks!
Dina
Back to top
View user's profile
Wes
Site Admin


Joined: 07 Oct 2002
Posts: 7427

PostPosted: Sun Mar 26, 2006 7:02 am    Post subject: Reply with quote

Dina,

I don't believe I received an email from you with the template attached. The ShipWorks XML specification in the Help document contains all of the information you would need to determine what specific XML elements are available in the database. I have included a snippet below that shows the item option element and sub elements.

Code:
<Option ID="OptionID">
             <Name>   
             <Code>   
             <Description>   
             <UnitPrice>
             <Miva>   
                 <OptionCode>
                 <AttributeID>


Within the code you pasted you may need to add an additional for-each to display the item option information for each item:

Code:
 <xsl:for-each select="Item">

<tr>
<td><xsl:value-of select="Code" />SIZE CODE HERE</td>
<td><xsl:value-of select="Name" /></td>
<td><xsl:value-of select="Quantity" /></td>
<td>_____</td>
</tr>

<!-- show the item's associated options/attributes - example showing all elements output -->
<xsl:for-each select="Option">
<tr>
<td colspan="4">
<xsl:value-of select="Name" /> : <xsl:value-of select="Code" /> : <xsl:value-of select="Description /> : <xsl:value-of select="UnitPrice /> : <xsl:value-of select="Miva/OptionCode /> : <xsl:value-of select="Miva/AttributeID />
</td>
</tr>
</xsl:for-each>

</xsl:for-each>


Let us know if you have further questions.

Thanks,

Wes
Interapptive, Inc.
Back to top
View user's profile Visit poster's website
dpaulos



Joined: 06 Apr 2004
Posts: 7

PostPosted: Sun Mar 26, 2006 2:41 pm    Post subject: BRILLIANT! Thank You Wes. Reply with quote

thank you Wes! works great now. i seriously did not know there was a manual containing this info.

thank you so much for your help. btw- it didn't sound like you not to reply. you are great!

Smile
dina
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