Unknown server tag 'orders:couponcodeentryview'.
Hi,
I am using this code in sitefinity 6.2 and getting error "Unknown server tag 'orders:couponcodeentryview'." But the same code was used in sitefinity 4.4 and was working fine.
Code in the ascx file:
<%@ Register TagPrefix=
"orders"
Namespace=
"Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI"
Assembly=
"Telerik.Sitefinity"
%>
<orders:couponcodeentryview runat=
"server"
></orders:couponcodeentryview>
Hello Asit,
I can suggest you try reference it like this instead:
<%@ Register TagPrefix="orders"Namespace="Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI"
Assembly=" Telerik.Sitefinity.Ecommerce" %>
<
orders:couponcodeentryview
runat
=
"server"
></
orders:couponcodeentryview
>
Please let me know if this helps.
Hi Elena,
Thanks so much for your quick reply. This worked, now i am not getting that error.
As i mentioned earlier i am getting "Error parsing the template" error when using the below code in the list template in the Ecommerce productList control.
The code was used in sitefinity 4.4 earlier and the current sitefinity ecommerce version is 6.2
I have tried changing the assembley name to "Telerik.Sitefinity.Ecommerce", but still didn't work.
<%@ Control Language="C#" %>
<%@ Import Namespace="Telerik.Sitefinity.Model" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Modules.Ecommerce.Catalog.Web.UI.Fields" TagPrefix="sfCatalog" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Modules.Ecommerce.Catalog.Web.UI" Assembly="Telerik.Sitefinity" %>
<
div
id
=
"widgetStatus"
runat
=
"server"
visible
=
"false"
class
=
"sfErrorSummary sfTopMsg"
>
<
asp:Label
ID
=
"widgetStatusMessage"
runat
=
"server"
/>
</
div
>
<
asp:Placeholder
id
=
"widgetBody"
runat
=
"server"
>
<
sf:ItemsPerPageSelector
ID
=
"itemsPerPageSelectorTop"
runat
=
"server"
GroupingKey
=
"Products"
CssClass
=
"sfitemsPerPageWrp"
/>
<
telerik:RadListView
ID
=
"productsListView"
runat
=
"server"
ItemPlaceholderID
=
"ProductContainer"
EnableEmbeddedSkins
=
"false"
EnableEmbeddedBaseStylesheet
=
"false"
>
<
LayoutTemplate
>
<
ul
class
=
"sfproductsList"
>
<
asp:PlaceHolder
ID
=
"ProductContainer"
runat
=
"server"
/>
</
ul
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
li
class
=
"sfproductListItem"
>
<
div
class
=
"sfproductTmbWrp"
>
<
sf:DetailsViewHyperLink
runat
=
"server"
CssClass
=
"sfproductTitleLnk"
><
img
runat
=
"server"
src='<%# Eval("ThumbnailUrl") %>' alt='<%# Eval("ThumbnailAlternativeText") %>' title='<%# Eval("Title") %>' /></
sf:DetailsViewHyperLink
>
</
div
>
<
h2
class
=
"sfproductTitle"
>
<
sf:DetailsViewHyperLink
Text='<%# (Eval("Title").ToString()).TruncateString(56, SitefinityExtensions.TruncateOptions.IncludeEllipsis) %>' runat="server" CssClass="sfproductTitleLnk" />
</
h2
>
<
div
class
=
"sfproductPrice"
>
<
sf:DetailsViewHyperLink
Text
=
'View details'
runat
=
"server"
CssClass
=
"sfproductTitleLnk"
/>
</
div
>
<%--NOTE: Uncomment the next line to display custom product fields--%>
<%--<
sf:ProductDynamicFields
id
=
"productDynamicFields"
runat
=
"server"
></
sf:ProductDynamicFields
>--%>
</
li
>
</
ItemTemplate
>
</
telerik:RadListView
>
<
sf:ItemsPerPageSelector
ID
=
"itemsPerPageSelectorBottom"
runat
=
"server"
GroupingKey
=
"Products"
CssClass
=
"sfitemsPerPageWrp"
/>
<
br
class
=
"clear"
/>
<
sf:Pager
id
=
"pager"
runat
=
"server"
DisplayCount
=
"3"
/>
</
asp:Placeholder
>
Hello Asit,
Thank you for the details. It seems like in your template you don’t have productSortControlWrp which is required for the ProductsList control. Therefore I could suggest you add this code inside the asp:Placeholder tag:
<
div
class
=
"sfProductsSortByWrp"
id
=
"productSortControlWrp"
runat
=
"server"
>
<
sf:SortProductsControl
ID
=
"sortProductsControl"
runat
=
"server"
/>
</
div
>
Furthermore I have modified the code that you provided so you can easily replace your current template with the one in the attached file.
If you need any additional assistance on this matter please do not hesitate to ask.
Hi Elena,
Thanks so much for your quick response. This works fine. Do i need to this code in all eCommerce templates?
Now I am experiencing one more issue.
I have created some products and created variations for each products. When i am trying to access these variations using API, i am getting the variations associated with the products with status "Master". But the Product-id i am getting from order manager is showing status Live .
Please find the code used here.
CatalogManager catalogManager = new CatalogManager();
IList<
ProductVariationDetail
> productVariationDetails = new List<
ProductVariationDetail
>();
productVariationDetails = catalogManager.GetProductVariationDetails().ToList();
//Parent.Id property belongs to Status Master
OrdersManager ordersManager1 = new OrdersManager();
var cartDetails1 = from cd in ordersManager1.GetCartDetails()
select cd;
cartDetails1 = cartDetails1.Where(cid => cid.Parent.Id == this.GetShoppingCartId());
//ProductId property belongs to status Live
Hi,
I am also getting error in Shopping basket template.
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Unknown server tag 'sfCatalog:DisplayPriceField'.
Source Error:
Line 42: <br class="clear" />
Line 43: <div class="price">
Line 44: <sfCatalog:DisplayPriceField id="displayPriceField" ObjectType="Cart" ObjectId='<%# Eval("Id") %>' runat="server" />
Line 45: </div>
Line 46: <br class="clear" />
Hello Asit,
There is no need to include the mentioned code in all of your Ecommerce templates since it is specific for the ProductMasterView template.
Regarding the ShoppingBascket – it seems that the sfCatalog tag is not pointing to existing location, therefore I can suggest you modify the ShoppingBascket template in order to include the following reference on the top:
<%@ Register Assembly="Telerik.Sitefinity.Ecommerce" Namespace="Telerik.Sitefinity.Modules.Ecommerce.Catalog.Web.UI.Fields" TagPrefix="sfCatalog" %>
Regarding the issue that you mentioned while working with products- it seems to be due to our Content LifeCycle:
As mentioned in the documentation we are showing on the frontend the live version of the products, that’s why you are getting the difference in the ids. Based on this if you are creating the products though code you can try the following approach and Publish the items once they are created:
also once you have the master id of the item you can use it to get the live id like this:
var manager = ProductsManager.GetManager();
var item = manager.GetItem(
typeof
(ProductItem), masterId);
manager.GetLive(item);
Please let me know it this helps in your scenario.
Hi Elena,
can you please help me with the below code implementation. I am unable to get the "ProductsManager" and the "ProductItem". if you please provideme the namespace for these, that will be great.
The code proved by you is here.
var manager = ProductsManager.GetManager();
var item = manager.GetItem(typeof(ProductItem), masterId);
manager.GetLive(item);
Hello,
Hello Asit,
It seems that we posted a wrong code. Please find the correct code here.
using
Telerik.Sitefinity.Ecommerce.Catalog.Model;
using
Telerik.Sitefinity.Modules.Ecommerce.Catalog;
var manager = CatalogManager.GetManager();
var item = manager.GetItem(
typeof
(Product), Guid.NewGuid())
as
Product;
var live = manager.Lifecycle.GetLive(item);
Please let me know if this helps you.
Regards,
Hi,
Thanks for your reply, that solves my old problem.
But Now i am facing one more issue regarding the CouponCodeEntryView control.
I have used this sitefinity "CouponCodeEntryView" control in my custom checkout page, once i enter a valid coupon and click the apply button the textbox and apply button are hiding. But in the previous versions of sitefinity it worked fine. can you please help me on this.
Hello Asit,
the hiding of the coupon control is intended.
Ones you enter a valid code the control is hidden but there is a link "Undo" clicking this link removes the coupon and shows back the control to enter the code. The idea is that if we keep the control shown the user may think he can use multiple discounts which is not right.
Indeed there was a bug with not hiding it but it was fixed 1 or 2 versions ago, so currently it is the way its suppose to be.
Regards,
Nayden Gochev
Telerik