Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Can the following cart modifications be done?

  1. #1
    lleemon is offline Member
    Join Date
    Jan 2007
    Posts
    57

    Default Can the following cart modifications be done?

    Current version using: AspDotNetStorefront Multistore 9.1.0.1/9.1.0.0

    The designer would like to modify two cart pages:
    1) ShoppingCart.aspx
    2) checkout1.aspx

    A lot of the changes are css changes but some structural changes look to be done as well.
    1) ShoppingCart.aspx
    -Change to two column format, with column A being 75% and contains the list of products, column B is 'Recommended Accessories' and change from checkbox to each having 'Add To Cart' button to add to list.
    -Add thumbnail for each product item in cart

    2) checkout1.aspx
    -split checkout1.aspx into two pages
    -Part 1 - change to two column format, 75% for billing/shipping and signin/create account section and 25% for order summary
    -Part 2 - change to two column format, 75% for discounts, shipping, payment select sections and 25% for order summary section

    We do not have source code so wondering if these changes can be done without having source code.

    Thanks.
    AspDotNetStorefront Multistore 9.1.0.1/9.1.0.0 with sourcecode

  2. #2
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi

    You can change anything related to the HTML and CSS without the source code. It gets more complicated when you want to change the content within the pages because in some cases (not all) the content you see on screen is rendered by an ASPDotNetStorefront control but the code for this control is buried within a dll that you can't change without source code.

    Take the cart contents on the shoppingcart.aspx page as an example. If you look at shoppingcart.aspx, you'll see that the cart contents are drawn by a control: <aspdnsfc:ShoppingCartControl ... />

    This shopping cart control is contained within the ASPDNSFControls.dll and you can't change it unless you have the source code.

    However... there is a trick.

    Using class inheritance, you can create your own custom control that is derived from the core ASPDNSF controls and then modify them without having access to the source code. In a way, this is also better than modifying the core source code because it makes future upgrades much more straightforward. Here's an example...

    Create a new file called MyCart.cs in the App_Code folder that looks like this:

    Code:
    using System;
    using System.Web;
    using System.IO;
    using System.Text;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.Design;
    using System.Web.UI.Design.WebControls;
    using System.ComponentModel;
    using AspDotNetStorefrontCore;
    
    namespace AspDotNetStorefrontControls
    {
        public class MyCart : ShoppingCartControl
        {
    	
    	protected override void CreateChildControls()
            {
    			base.CreateChildControls();
    			Controls.Add(new LiteralControl("This is a custom cart"));
    	}
        }
    }
    This creates a custom cart control based on the standard shopping cart with one simple addition that adds a 'This is a custom cart' line at the bottom. You can of course change this any way you like.

    Now, in shoppingcart.aspx, add the following line into the definitions section at the top:

    Code:
    <%@ Register TagPrefix="aspdnsfc2" Namespace="AspDotNetStorefrontControls" %>
    And change references to 'aspdnsfc:ShoppingCartControl' to 'aspdnsfc2:MyCart'

    Now, when you view the shoppingcart page, you'll see you Custom cart being used instead of the standard cart.

    Adam