IPB

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> The Official Ns Script Collective
Rating 5 V
martiniguy
post Aug 30 2008, 11:54 AM
Post #1





Group: Verified NS Member
Posts: 284
Joined: 10-March 08
From: South Eastern Martini-land
Member No.: 775



Hey everyone. The fine folks at NS have offered to pin this thread!

The intention of this thread is not for Q&A - but simply as a resource for NS scripts. Please feel free to post your scripts here for all to see and share!

As an example to get this started...

This little script is added to the "checkout page" top of page section. I offer free shipping on purchases of $75 or more. If a user begins to check out with less than $75 in the cart, they are presented with a call-to-action type of graphic enticing them to continue shopping to get free shipping

CODE
<ns:if condition="Cart.Total < 75">
  <a href="http://www.martiniart.com" target="_self"><img src="/martinidesign/continue-free-ship.gif" alt="continue shopping for martini glasses" border="0" /></a>
</ns:if>


*Thanks to Agkits & the NS folks for helping with this little script!

Ok...lets start writing and sharing!
Go to the top of the page
 
+Quote Post
martiniguy
post Aug 30 2008, 05:27 PM
Post #2





Group: Verified NS Member
Posts: 284
Joined: 10-March 08
From: South Eastern Martini-land
Member No.: 775



This script can be placed in your product layout. If an item is on sale, it will show an image. On my site, I use this to display a small "on sale" starburst below my product sale price

CODE
<ns:if condition="Product.CustomerPrice < Product.MsrpPrice"><img src="/martinidesign/sale-show.gif" /></ns:if>
Go to the top of the page
 
+Quote Post
Goomba
post Aug 31 2008, 12:31 AM
Post #3





Group: Verified NS Member
Posts: 215
Joined: 13-July 08
From: St. Louis, MO
Member No.: 1,446



The code below can be placed in your product layout. It will force your users to login before they can purchase the product.

CODE
<ns:if condition="User.IsLoggedIn"><ns:ProductAddToCart /></ns:if>
Go to the top of the page
 
+Quote Post
Goomba
post Sep 2 2008, 12:30 AM
Post #4





Group: Verified NS Member
Posts: 215
Joined: 13-July 08
From: St. Louis, MO
Member No.: 1,446



This bit of code will change the text on the confirmation email for when Shipping is marked as free on an item (when the cart displays Shipping not required) to just Free Shipping.

Put this in your email design on the line where it displays the shipping method. Since this is NS Script, it will work in both the text and HTML versions of the email.

CODE
<ns:choose><ns:when condition="Order.ShippingMethod == 'Shipping is not required for this order'">Free Shipping</ns:when><ns:otherwise><%Order.ShippingMethod%></ns:otherwise></ns:choose>
Go to the top of the page
 
+Quote Post
Goomba
post Oct 7 2008, 09:53 PM
Post #5





Group: Verified NS Member
Posts: 215
Joined: 13-July 08
From: St. Louis, MO
Member No.: 1,446



This little snippet will hide the prices in the list view if someone is not logged in. If they are logged in, they will see the prices just fine.

Put this at the bottom of your header.

CODE
<ns:if condition="!User.IsLoggedIn">
  <style type="text/css">
    div.product-list-price { display: none; }
  </style>
</ns:if>
Go to the top of the page
 
+Quote Post
ebead
post Oct 10 2008, 07:32 AM
Post #6





Group: Verified NS Member
Posts: 9
Joined: 30-August 08
Member No.: 2,238



This script Hides the CART when the total is zero or the Customer is in Checkout Process.

CODE
     <ns:if condition="Cart.Total > 0">
        <script language="Javascript"><!--
       var hasQueryString = document.URL.indexOf('checkout');
       if (hasQueryString > 1)
             document.writeln("\<!--");
         //-->
         </script>
       <table
style="background-color: #e7ffd5; border-collapse:collapse;" cellpadding="0" cellspacing="0" border="0"
width="100%">
        <tbody>
          <tr><td><a href="/cart.aspx"><img title="View Card" src="images/carthead.gif" border="0"></a></td></tr>
<tr><td align="center" style="border-left: 1px solid #000000; border-right: 1px solid #000000; background-color: #e7ffd5;">&nbsp;<b>Your Cart has:</b><br><br></td></tr>
          <tr>
            <td align="right" style="border-left: 1px solid #000000; border-right: 1px solid #000000; background-color: #e7ffd5;"><b><%Cart.Count%></b>&nbsp;Item(s)&nbsp;&nbsp;<br><b><%Cart.Total%></b>&nbsp;Subtotal&nbsp;<br><br></td>
          </tr>
<tr><td align="center" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000;"><a href="/cart.aspx">
<img title="View Card" src="images/viewcart3.gif" border="0"></a><br><br>Shipping: <b>$4.99</b><br>(within USA)<br><br><a href="/checkout.aspx">
<img title="Checkout" src="images/ebscheckout.gif" border="0"></a><br></td></tr>
        </tbody>
      </table>
<tr><td align="center"><br>
</td></tr>
        <script language="Javascript"><!--
       var hasQueryString = document.URL.indexOf('checkout');
         if (hasQueryString > 1)
             document.writeln("--\>");
         //-->
         </script>
</ns:if>
Go to the top of the page
 
+Quote Post
cctvgirl
post Oct 16 2008, 08:22 PM
Post #7





Group: Verified NS Member
Posts: 24
Joined: 13-August 08
Member No.: 1,899



I wrote this script to compose different email messages based on the status change of the order. Put in the 'Status Change' email design:

CODE
<ns:choose>

<!-- Do this when order status == In-Process -->
<ns:when condition="Order.Status == 'In-Process'">

          <div>Hello <%Billing.FirstName%> <%Billing.LastName%>,</div>
          <p>This email has been sent to inform you that we have begun to process your order.
                 Most orders are shipped within 24 hours.
                 You will receive another email when your order has shipped that will contain your UPS tracking information.
          </p>

</ns:when>

<!-- Do this when order status == Shipped -->
<ns:when condition="Order.Status == 'Shipped'">

          <div>Hello <%Billing.FirstName%> <%Billing.LastName%>,</div>
          <p>This email has been sent to inform you that your order has shipped.
          Below is your UPS tracking information.
          Please be aware that the tracking information may not be available in the UPS system for several hours after the order has been picked up.
          </p>

</ns:when>

<!-- Otherwise do this -->
<ns:otherwise>

          <div>Hello <%Billing.FirstName%> <%Billing.LastName%>,</div>
          <p>This email has been sent to inform you that your order, #<%Order.Number%>, has been updated to a status of <%Order.Status%>.</p>

</ns:otherwise>
</ns:choose>

Remember to put (a version of) this code in both the html and text sections for the status email. I made the mistake of only putting it in the html section so my text-only customers were getting the wrong messages.
Go to the top of the page
 
+Quote Post
ArcoJedi
post Dec 17 2008, 02:02 PM
Post #8





Group: Administrators
Posts: 558
Joined: 10-August 07
From: Galaxy Far, Far Away...
Member No.: 13



I originally posted this here -
http://forums.networksolutions.com/feature...html#entry13169
- but I thought it could be added to this list.
CODE
<ns:choose>
<ns:when condition="Cart.Count > 0">
  <h3>Your Cart: <%Cart.Count%> Items</h3>
   <p><a href="/cart.aspx" title="View Cart">View Cart &amp; Check Out</a></p>
</ns:when>
<ns:otherwise><p>Your Cart is Empty</p></ns:otherwise>
</ns:choose>

This would conditionally show either "Your Cart is Empty" at regular size OR a heading that says "Your Cart: X Items" and a link to check out. Add this to an HTML module in your left/right column.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2008 Time is now: 8th January 2009 - 07:26 PM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates