Dynamicweb 8 Documentation
CustomerOrderCollectionFilter Class
Members  Example 

Represents a collection of customer orders
Object Model
CustomerOrderCollectionFilter ClassCustomerOrderCollection ClassOrder Class
Syntax
'Declaration
 
<SerializableAttribute()> 
Public Class CustomerOrderCollectionFilter 
[SerializableAttribute()] 
public class CustomerOrderCollectionFilter 
Example
public void RenderCustomerOrders( Rendering.Template t, String customerID, Dynamicweb.Frontend.PageView pageView, int paragraphID)
{
	if (t.LoopExists(Tags.LoopStartOrders))
	{
		CustomerOrderCollection co = new CustomerOrderCollection();
		co.Load(customerID);

		// Add filtering
		Orders.CustomerOrderCollectionFilter filter = new Orders.CustomerOrderCollectionFilter(co);
		filter.ApplyFromQueryString(paragraphID);

		Orders.OrderCollection ordersToRender = filter.Output;

		t.SetTag(Tags.OrderCount, ordersToRender.Count);
		if (ordersToRender.Count == 0)
		{
			t.SetTag(Tags.EmptyOrderList, "true");
		}
		else
		{
			Dynamicweb.Rendering.Template orderTemplate = t.GetLoop(Tags.LoopOrders);

			Dynamicweb.eCommerce.Frontend.Renderer r = new Dynamicweb.eCommerce.Frontend.Renderer();
			r.PageView = PageView;

			// Create querystrings common to add all products in the order to the cart command
			string rawQString = Base.StrippedQueryString("CC" + _paragraphID.ToString() + ",ReorderID" + _paragraphID.ToString() + ",ResendOrderID" + _paragraphID.ToString() + ",Addresses" + _paragraphID.ToString() + ",CCAddToFavorites" + _paragraphID.ToString() + "*,CCRemoveFromFavorites" + _paragraphID.ToString() + "*");
			string reorderQString = Base.AddToQueryString(rawQString, "CC" + _paragraphID.ToString() + "=Orders");

			string ordersPrintTemplate = Settings.MyOrderDetailsTemplate;
			foreach (Dynamicweb.eCommerce.Orders.Order order in ordersToRender)
			{
				// Adds all products in the order to the cart
				orderTemplate.SetTag(Tags.Reorder, Base.AddToQueryString(reorderQString, "ReorderID=" + order.ID.ToString()));

				r.RenderOrder(order, orderTemplate);
				orderTemplate.CommitLoop();
			}
		}
	}
}
Inheritance Hierarchy

System.Object
   Dynamicweb.eCommerce.Orders.CustomerOrderCollectionFilter

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

CustomerOrderCollectionFilter Members
Dynamicweb.eCommerce.Orders Namespace

Send Feedback