Creating my own Brands addition

Posted By jenkins Fri 19 Aug 2011
Add to Favorites0
Author Message
jenkins
 Posted Fri 19 Aug 2011
Supreme Being

Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)

Group: Awaiting Activation
Last Active: Sat 3 Sep 2011
Posts: 16, Visits: 43
Hi there,

I am looking to create my own brands/manufacturers addition to Kartris as this is the only downfall at the moment that I can see with it, otherwise the software is awesome.

This is what I have done so far.

1) Created a Brands.aspx and Brands.aspx.cs file. Containing two textboxes a check box and two buttons (clear and save) - oh and a gridview.
2) Created a Brands table with BrandId, BrandName, BrandDescription and BrandLive.
3) Also created a LinkTable with P_ProductId and BrandId, so that I can associate Brands with Products.

I am a novice coder so I am becoming rapidly unstuck - I have put the Brands page into the web.sitemap for the backend. But when I click on the link or try to access it directly I get an error page. Is there something I need to do to be able to let me see the page?

Secondly, I want to be able to use the text editor (is it cutesoft?) how do I get this into the page?
Sun 21 Aug 2011 by jenkins
Mart
 Posted Sat 20 Aug 2011
Top Banana

Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)

Group: Administrators
Last Active: Wed 18 Nov 2020
Posts: 148, Visits: 3,450
There are 2 ways you could add brands without creating new entities in db.

The first would be to use "suppliers" as brands. "Suppliers" is on the products menu. Set up your brands here, then for each product you can go in and select the supplier for it. I guess it should be relatively easy to then have pages filtered by brand/supplier (would probably need a mod to do that, but at least you've avoided all the backend changes).

The 2nd way is to take advantage of the fact that kartris lets you have one product in multiple categories, and also lets you put category menus on a page, and specify different root categories of the menu.

So you setup 2 top level categories - "brand", and eg "type". Within brand you setup your brands as subcategories, and within "type" you setup categories. You then put each product into 2 categories - the correct "brand" category, and the correct "type".

You can see similar setups on these sites...
www.bodysolid.co.uk
www.safety-express.co.uk
Sat 20 Aug 2011 by Mart
jenkins
 Posted Sat 20 Aug 2011
Supreme Being

Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)

Group: Awaiting Activation
Last Active: Sat 3 Sep 2011
Posts: 16, Visits: 43
Thanks Mart! Thats awesome BigGrin as you say the second option looks the best. I'll have a play with this over the weekend Smile
Mart
 Posted Sat 20 Aug 2011
Top Banana

Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)Top Banana - (95,813 reputation)

Group: Administrators
Last Active: Wed 18 Nov 2020
Posts: 148, Visits: 3,450
For the second option, this is what the code looks like in the skin/template.master file (replacing the existing single call to category menu)...

<div id="categorymenu">
<h4><span>Shop by Category</span></h4>
<user:CategoryMenuAccordion ID="UC_Categorymenu" RootCategoryID="1" runat="server" />
<h4><span>Shop by Brand</span></h4>
<user:CategoryMenuAccordion ID="UC_Categorymenu2" RootCategoryID="2" runat="server" />
</div>


Where 1 & 2 are your 2 top level categories
jenkins
 Posted Sat 20 Aug 2011
Supreme Being

Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)

Group: Awaiting Activation
Last Active: Sat 3 Sep 2011
Posts: 16, Visits: 43
Hi Mart,

Thank you for the code. However, it didnt seem to work and threw an error. I had deleted the following line..

<aspTonguelaceHolder ID="phdCategoryMenu" runat="server"></aspTonguelaceHolder>

and replaced it with your code.

At which point it throws the following error message....



-----------------------------------------------------------------------------
>>     URL:http://kartrisdemo.urbanaddiction.co.uk/default.aspx
>>     Page:
-----------------------------------------------------------------------------
>>     20/08/2011 20:40:26
>>     2.124.104.112
>>     DESCRIPTION:
System.Web.HttpParseException (0x80004005): Unknown server tag 'user:CategoryMenuAccordion'. ---> System.Web.HttpParseException (0x80004005): Unknown server tag 'user:CategoryMenuAccordion'. ---> System.Web.HttpException (0x80004005): Unknown server tag 'user:CategoryMenuAccordion'.
   at System.Web.UI.TemplateParser.ProcessError(String message)
   at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
   at System.Web.UI.Page.ApplyMasterPage()
   at System.Web.UI.Page.PerformPreInit()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

==================================================




I am not sure why as looking at other user:Tag seem to follow the same patterns.

Commented out the user control section on template code behind, rebuilt the solution and uploaded the bin etc again, restarted the application and still errored.

I am running the latest version. Any ideas?
Mohammad
 Posted Sat 20 Aug 2011
Kartris Expert

Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)Kartris Expert - (78,917 reputation)

Group: Administrators
Last Active: Sun 27 Sep 2015
Posts: 115, Visits: 706
Let us say you have 2 root categories:
Site Items (ID = 1) & Brands (ID = 2)
In "Site Items" category will have the whole main categories under it.
In "Brands" category will have all brands' names (as subcategories) under it.

Step1: Replace this code in the template HTML (ex:Template.master) file (assuming the code is original - as shipped with Kartris Pack):
<div id="categorymeunblock" class="infoblock">
   <h4>
       <asp:Literal ID="litContentTextProducts" runat="server" EnableViewState="False"
Text="<%$ Resources: Products, ContentText_Products %>" />
   </h4>
    <aspTonguelaceHolder ID="phdCategoryMenu" runat="server">
    </aspTonguelaceHolder>
</div>

By this:
<div id="categorymeunblock" class="infoblock">
   <h4>
       <asp:Literal ID="litContentTextProducts" runat="server" EnableViewState="False"
Text="<%$ Resources: Products, ContentText_Products %>" />
   </h4>
    <user:CategoryMenu RootCategoryID="1" ID="UC_CategoryMenu1" runat="server" />
</div>
<div class="infoblock">
   <h4>Brands</h4>
   <user:CategoryMenu RootCategoryID="2" ID="
UC_CategoryMenu2" runat="server" />
 </div>

Note - Red color indicates the menu type as below:
1. default menu:keep same text (CategoryMenu)
2. accordion menu use (CategoryMenuAccordion)
3. dropdown menu use (CategoryMenuDropdownSelect)
In case you want to use the 2nd or 3rd type, you need to add reference to that menu control in the web.config inside the <controls> tag (see line #100 in web.config for example) :
<add tagPrefix="user" tagName="CategoryMenuAccordion" src="~/UserControls/Skin/CategoryMenuAccordion.ascx"/>
'OR
<add tagPrefix="user" tagName="CategoryMenuDropdownSelect" src="~/UserControls/Skin/CategoryMenuDropdownSelect"/>


Step2: Go to the .vb file of the template (ex: Template.master.vb) and comment/remove this code inside Page_Load Event:
'New usercontrol
Dim objCategoryMenuUserControl As Control
Select Case KartSettingsManager.GetKartConfig("frontend.display.categorymenu.type")
  Case "a"
    objCategoryMenuUserControl = LoadControl("~/UserControls/Skin/CategoryMenuAccordion.ascx")
  Case "d"
    objCategoryMenuUserControl = LoadControl("~/UserControls/Skin/CategoryMenuDropDownSelect.ascx")
  Case Else
    objCategoryMenuUserControl = LoadControl("~/UserControls/Skin/CategoryMenu.ascx")
End Select

'Add appropriate menu control
phdCategoryMenu.Controls.Add(objCategoryMenuUserControl)


Save your changes and give it a try.

Important:The above steps will replace the usage of the config "frontend.display.categorymenu.type", so if you want to change the menu type in the future, you have to do that from here, the config will be ignored in this case.
jenkins
 Posted Sun 21 Aug 2011
Supreme Being

Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)

Group: Awaiting Activation
Last Active: Sat 3 Sep 2011
Posts: 16, Visits: 43
Hi there,

That worked perfectly so now that I can have two of them on the page.

In all honesty I am trying to acheive a menu like the one at www.asos.com, where you have a mega drop down menu. Listing the categories and the brands in one dropdown.

IE top level mens and womens. 2nd level Categories and brands for men on hover. 2nd level categories and brands for womens on hover. I have set the categories up this way. I have have a look in the DB to see how the fields are layed out so that I can pull the information but I am starting to think this is a little beyond me!

Has anyone done this already, or is anyone working on this style of menu? The normal CSS foldout menu doesnt really cut it as it would list the items as flyout with Categories and brans below each other and doesnt display the categories or brands directly below them.

Thanks for any pointers.

Dave
Paul
 Posted Mon 22 Aug 2011
große Käse

große Käse - (509,210 reputation)große Käse - (509,210 reputation)große Käse - (509,210 reputation)große Käse - (509,210 reputation)große Käse - (509,210 reputation)große Käse - (509,210 reputation)große Käse - (509,210 reputation)große Käse - (509,210 reputation)große Käse - (509,210 reputation)

Group: Administrators
Last Active: Tue 10 Sep 2024
Posts: 807, Visits: 2,748
It should be possible to get something approaching that, in that you can have

WOMEN / MEN / MARKETPLACE / OUTFITS & LOOKS / BLOGS

as five separate menu controls (see Mart's last post above).

But you'd need an amount of modification of each control to give you that kind of layout. With the brands etc. separated into a separate column.

I have a feeling sites like this may well hardcode the menu rather than have it running from the db, on the basis that categories rarely change. This obviously gives you total control then over the formatting. With multiple columns within a menu like this, having it automated is rather difficult, because as you add extra categories, they may well force the formatting out. Getting menus to form into multiple columns with CSS is rather difficult, and to write the logic so the layout is automated but elegantly handles new categories and maybe new sections may end up taking more time than just hardcoding it and allowing for the occasional manual update of the code. For major sites like this, they obviously have in-house web people who can make changes to menus etc. If your client is smaller and doesn't have a dedicated web person, then they may need to budget for occasional updates for things like this, although the vast majority of content they can of course manage themselves.


--
If my post solves your issue, can you 'Mark as Answer' so it's easier for other users to find in future.

If you would like to be informed of new features, new releases, developments and occasional special bonuses, please sign up to our mailing list: http://bit.ly/19sKMZb
jenkins
 Posted Mon 22 Aug 2011
Supreme Being

Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)Supreme Being - (12,008 reputation)

Group: Awaiting Activation
Last Active: Sat 3 Sep 2011
Posts: 16, Visits: 43
Hi Paul,

I was afraid that I was going to have to hard code it - but I thought I would see if there was another option first.

Thanking everyone for their responses. Still evaluating and developing a theme for Kartris at the moment but so far so good. I will post my site when its been transferred across from nopCommerce.

Dave.

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top