AI OnAI Off
Hi,
I don't see any code you assign value to ProductLink. Can you show it here?
Regards.
/Q
I don't assign it from code, It's a url, that i assign when i create the block in edit mode. I get a catalog browser and i can choose a node and save the block.
Your block looks perfect Mikael, I have it work on my site. What CMS and Commerce versions do you have in your site? And have you injected any custom routing?
No, i'm using the standard from the sample site. Attached it below.
[ModuleDependency(typeof(EPiServer.Commerce.Initialization.InitializationModule))]
public class InitializationModule : IConfigurableModule
{
public void Initialize(InitializationEngine context)
{
MapRoutes(RouteTable.Routes);
// Check the HostType is WebApplication
if (context == null || context.HostType != HostType.WebApplication)
{
return;
}
AddAssociationGroups(context);
// Init only in Web context type and first loading time of EPiServer Commerce Sample Site
if (SettingFactory.Instance.Setting.IsSampleDataConfigured)
return;
// switch the flag
SettingFactory.Instance.Setting.IsSampleDataConfigured = true;
SettingFactory.Instance.Save();
}
private static void MapRoutes(RouteCollection routes)
{
CatalogRouteHelper.MapDefaultHierarchialRouter(routes, false);
}
public void Preload(string[] parameters)
{
}
public void Uninitialize(InitializationEngine context)
{
}
public void ConfigureContainer(ServiceConfigurationContext context)
{
context.Container.Configure(c => c.For<ICurrentMarket>().Singleton().Use<DinTidning.Commerce.Helpers.MarketStorage>());
}
private void AddAssociationGroups(InitializationEngine context)
{
// Add predefined selections CrossSell and UpSell
// If they already exist nothing will be added
var associationDefinitionRepository =
context.Locate.Advanced.GetInstance<GroupDefinitionRepository<AssociationGroupDefinition>>();
associationDefinitionRepository.Add(new AssociationGroupDefinition { Name = Constants.CrossSellGroupName });
associationDefinitionRepository.Add(new AssociationGroupDefinition { Name = Constants.UpSellGroupName });
}
}
<packages>
<package id="Castle.Core" version="3.2.2" targetFramework="net40" />
<package id="Castle.Windsor" version="3.2.1" targetFramework="net40" />
<package id="Common.Logging" version="1.2.0" targetFramework="net40" />
<package id="Common.Logging.EntLib" version="1.2.0" targetFramework="net40" />
<package id="Common.Logging.Log4Net" version="1.2.0" targetFramework="net40" />
<package id="Common.Logging.NLog" version="1.2.0" targetFramework="net40" />
<package id="DotNetZip" version="1.9.1.8" targetFramework="net40" />
<package id="EPiServer.CMS.Core" version="7.7.0" targetFramework="net40" />
<package id="EPiServer.CMS.UI" version="7.8.0" targetFramework="net40" />
<package id="EPiServer.CMS.UI.Core" version="7.8.0" targetFramework="net40" />
<package id="EPiServer.Commerce" version="7.7.2" targetFramework="net40" />
<package id="EPiServer.Commerce.Core" version="7.7.2" targetFramework="net40" />
<package id="EPiServer.Commerce.UI" version="7.7.2" targetFramework="net40" />
<package id="EPiServer.CommonFramework" version="7.5.446.2" targetFramework="net40" />
<package id="EPiServer.Framework" version="7.7.0" targetFramework="net40" />
<package id="log4net" version="1.2.10" targetFramework="net40" />
<package id="Lucene.Net" version="3.0.3" targetFramework="net40" />
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net40" />
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net40" />
<package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="MicrosoftReportViewerWebForms_v10" version="1.0.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net40" />
<package id="structuremap" version="2.6.4.1" targetFramework="net40" />
</packages>
I'm using the Sample store for EPiServer 7.5 as base for the website.
I have upgraded to the latest version through nuget.
I have added a seperate catalog along side with the standard in the sample proejct.
I created an advertisement block
And i created a control for this:
with codebehind
For som reason the url created from product link is
http://dev:17003/-1073741823/<catalogroot>/<categorynode>/
The problem here is the underlined segement. if copy the link and remove that part the url works and i get to the correct category or product.
Where whould I direct my focus. Is it something in my routing that i've missed? I'm basically using the sample store out of the box, just changed the markup and rendering templates for metaclasses.
The other links on the site works as intended.