Integrating shophome with home

Last post 06-15-2008 12:30 AM by TheCommunityHost. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-14-2008 4:55 AM

    Integrating shophome with home

    Hi

    Do you have any tips for removing the functionality/widgets from shophome.aspx and integrating them with home.aspx.  The cart for example.  I'd like that to always be displayed wherever a user is.

  • 06-14-2008 5:50 AM In reply to

    Re: Integrating shophome with home

    The simple way to achieve what you are looking for is to wrap all of the controls inside a ShopData tag and then manually bind your shop to that control. 

    <script language="c#" runat="server">
     protected override void OnLoad ( EventArgs e )
     {
      base.OnLoad ( e );
      MyShopCtrl.DataSource = Shops.GetShop("ShopApplicationKey")

     }

    </script>

    <ShopData runat=server id=MyShopCtrl >
    <ContentTemplate>
    ...Your shop cotrols in here....
    </ContentTemplate>
    </ShopData>

    Of course if this was a common occurance then you'd want to inherit from ShopData and create your own wrapper, that binds automatically.

    Rob
     

  • 06-14-2008 11:28 AM In reply to

    Re: Integrating shophome with home

    Thanks for that Rob.  However getting an error which you may well know.  Please take a look at the excerpt below:

     

    Compiler Error Message: CS0103: The name 'Shops' does not exist in the current context

    Source Error:

    Line 14:         //Shop stuff
    Line 15:         base.OnLoad ( e );
    Line 16:         MyShopCtrl.DataSource = Shops.GetShop("ShopApplicationKey");
    Line 17:                 
    Line 18:         int userID = CommunityServer.Components.CSContext.Current.User.UserID;

    Any pointers?
  • 06-14-2008 1:34 PM In reply to

    Re: Integrating shophome with home

    You need to include the namespaces in the ASPX file

    <%@ Import Namespace="FourRoads.CsShop.Core.Components" %>
    <%@ Import Namespace="FourRoads.CsShop.Core" %>

    Also you need to replace ShopApplicationKey with the application name of your shop.

    Rob

  • 06-15-2008 12:30 AM In reply to

    Re: Integrating shophome with home

    LOL!

    I had the imports but missed the 'ShopApplicationKey'  Been looking at this stuff for so long I couldn't see the wood for the trees.

     

    Thanks for the support. Outstanding!

Page 1 of 1 (5 items)