AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
9.0.4 How to tell if the current page is a product page?
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
I have a Facebook Pixel control that needs migrated to AC9.
Part of the control needs to know which page is being rendered so it can create the appropriate javascript required by Facebook.
But how do I tell if I'm on a product page, or a category page?
In Able Gold, I could pull in HttpContext.Current.Request and look at the Url property. It would contain the original (native) url before anything got converted to the actual url.
That isn't the case in Able v9.
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
You can use the following code Code:if (CurrentRequestData.PageData.PageType == PageDataType.Product)
{
}
|
1 user thanked shaharyar for this useful post.
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Works perfectly, thank you!
A helper class just for identifying application pages would sure be handy: IsBasketPage() IsPasswordReset() IsCheckoutBilling() IsCheckoutPayment() IsReceiptPage()
That sort of thing. a LOT of these pixel/page tracking snippets are page-dependent.
I know WebpageController has IsReceiptPage() but would just be nice to have them all in one helper class.
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
9.0.4 How to tell if the current page is a product page?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close