-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathCategory.aspx.vb
More file actions
108 lines (94 loc) · 5.71 KB
/
Category.aspx.vb
File metadata and controls
108 lines (94 loc) · 5.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
'========================================================================
'Kartris - www.kartris.com
'Copyright 2024 CACTUSOFT
'GNU GENERAL PUBLIC LICENSE v2
'This program is free software distributed under the GPL without any
'warranty.
'www.gnu.org/licenses/gpl-2.0.html
'KARTRIS COMMERCIAL LICENSE
'If a valid license.config issued by Cactusoft is present, the KCL
'overrides the GPL v2.
'www.kartris.com/t-Kartris-Commercial-License.aspx
'========================================================================
Imports CkartrisDataManipulation
Partial Class Category
Inherits PageBaseClass
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'We set a value to keep track of any trapped
'error handled, this way, we can avoid throwing
'a generic error on top of the handled one.
Dim strErrorThrown As String = ""
If Not Page.IsPostBack Then
Dim strCurrentPath As String = Request.RawUrl.ToString.ToLower
If Not (InStr(strCurrentPath, "/skins/") > 0 Or InStr(strCurrentPath, "/javascript/") > 0 Or InStr(strCurrentPath, "/images/") > 0) Then
Try
Dim strActiveTab As String = Request.QueryString("T")
Dim intCategoryID As Integer = Request.QueryString("CategoryID")
Dim numLangID As Short = 1 'default to default language
Try
numLangID = CShort(Session("LANG"))
Catch ex As Exception
'numLangID = Request.QueryString("L")
End Try
UC_CategoryView.LoadCategory(intCategoryID, Session("LANG"))
If UC_CategoryView.IsCategoryExist OrElse intCategoryID = 0 Then
Dim objCategoriesBLL As New CategoriesBLL
Me.CanonicalTag = CkartrisBLL.WebShopURL & Mid(SiteMapHelper.CreateURL(SiteMapHelper.Page.CanonicalCategory, intCategoryID), 2)
Me.MetaDescription = objCategoriesBLL.GetMetaDescriptionByCategoryID(intCategoryID, numLangID)
Me.MetaKeywords = objCategoriesBLL.GetMetaKeywordsByCategoryID(intCategoryID, numLangID)
UC_SubCategoryView.LoadSubCategories(intCategoryID, Session("LANG"), UC_CategoryView.SubCategoryDisplayType)
UC_CategoryProductsView.LoadCategoryProducts(intCategoryID, Session("LANG"), UC_CategoryView.ProductsDisplayType, UC_CategoryView.ProductsDisplayOrder, UC_CategoryView.ProductsSortDirection)
If UC_SubCategoryView.TotalItems > 0 Then
litSubCatHeader.Text &= " <span class=""total"">(" & UC_SubCategoryView.TotalItems & ")</span>"
If strActiveTab = "S" Then tabContainer.ActiveTabIndex = 0
Else
tabSubCats.Enabled = False
tabSubCats.Visible = False
End If
If UC_CategoryProductsView.TotalItems > 0 Then
litProductsHeader.Text &= " <span class=""total"">(" & UC_CategoryProductsView.TotalItems & ")</span>"
If strActiveTab <> "S" Then tabContainer.ActiveTabIndex = 1
ElseIf Request.QueryString("f") <> "1" Then
tabProducts.Enabled = False
tabProducts.Visible = False
End If
'If we are filtering in powerpack, always use the products tab, even if zero products/results
If Request.QueryString("f") = 1 Then
tabContainer.ActiveTabIndex = 1
End If
If Not Page.IsPostBack AndAlso KartSettingsManager.GetKartConfig("general.products.hittracking") = "y" Then
StatisticsBLL.AddNewStatsRecord("C",
GetIntegerQS("CategoryID"), GetIntegerQS("strParent"))
End If
'If intCategoryID = 0 Then UC_BreadCrumbTrail.SiteMapProvider = "BreadCrumbSitemap"
Else
'An item was called with correctly formatted URL, but
'the ID doesn't appear to pull out an item, so it's
'likely the item is no longer available.
strErrorThrown = "404"
Try
Server.ClearError()
HttpContext.Current.Server.Execute("~/404.aspx")
Catch exError As Exception
End Try
End If
Catch ex As Exception
'Some other error occurred - it seems the ID of the item
'exists, but loading or displaying the item caused some
'other error.
If strErrorThrown = "" Then '404s won't get logged
CkartrisFormatErrors.ReportHandledError(ex, Reflection.MethodBase.GetCurrentMethod())
HttpContext.Current.Server.Execute("~/Error.aspx")
End If
End Try
End If
End If
End Sub
Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
If Session("NewBasketItem") = 1 Then
Dim MiniBasket As Object = Master.FindControl("UC_MiniBasket")
MiniBasket.LoadMiniBasket()
Session("NewBasketItem") = 0
End If
End Sub
End Class