在Hybris中,如何在同一代码库中创建b2b和b2c店面? [英] In Hybris, how to create b2b and b2c storefronts in the same code base?

查看:92
本文介绍了在Hybris中,如何在同一代码库中创建b2b和b2c店面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ant modulegen命令创建了b2c店面.现在,我想在相同的代码库中创建b2b店面.最后,b2b和b2c店面应在单个hybris实例上运行.请提供逐步过程以实现此目的.预先感谢.

I created b2c storefront using ant modulegen command. Now I want to create b2b storefront in the same code base. At the end b2b and b2c storefronts should run on the single hybris instance. Please provide the step by step process to achieve this. Thanks in advance.

推荐答案

我同意其他答复者的观点,即问题尚不完全清楚.但是,如果您想要一个店面,则可以执行以下操作:

I agree with the other respondents that the question is not completely clear. However, if you want one storefront, then you can do the following:

ref: https://help.hybris.com/1811/hcd/8ae0711f86691014877ae05249b2f5ac .html

如果您有多个店面,则可以在用户的​​URL不能提供足够的信息来区分不同店面时,将此处描述的更改应用于要显示为默认店面的店面.

If you have multiple storefronts, you can apply the changes described here to the storefront you want to appear as the default storefront when the user's URL does not provide sufficient information to discriminate between different storefronts.

SAP Commerce Accelerator提供了支持多个店面的功能;在servlet的根上下文路径中对servlet的请求直接导致500错误.您需要使用主机文件映射或使用site-ID参数来避免500错误.

SAP Commerce Accelerator provides the functionality to support multiple storefronts; a request to the servlet at its root context path directly results in a 500 error. You need to use hosts file mappings or use the site-ID parameter to avoid a 500 error.

CMS网站具有一个称为urlPatterns的属性.这是网站CMS过滤器匹配的正则表达式列表,以确定用户尝试访问的店面.

The CMS site has an attribute called urlPatterns. This is a list of regular expressions that the website CMS filters match to determine which storefront a user is trying to access.

要解决此问题,请向CMS网站添加其他正则表达式,例如:

To resolve this, add an additional regular expression to the CMS site such as the following:

(?i)^ https?://[^/] /yacceleratorstorefront((?![\?\&] site =).) 可以在Backoffice Administration主控室中添加正则表达式.

(?i)^https?://[^/]/yacceleratorstorefront((?![\?\&]site=).) The regular expression can be added in the Backoffice Administration Cockpit.

在Backoffice中设置URL模式 登录到Backoffice. 导航到导航路径的起点WCMS下一导航步骤导航路径的WebsiteEnd.店面列表出现在主窗格中. 单击您要设置的店面. 在属性"选项卡中,确保"URL模式"部分中的文本字段看起来类似于下面的示例:

Setting URL Patterns in Backoffice Log into Backoffice. Navigate to Start of the navigation pathWCMS Next navigation step WebsiteEnd of the navigation path. A list of storefronts appears in the main pane. Click the storefront you want to set up. In the Properties tab, make sure that the text field in the URL Patterns section looks like the one in the example below:enter image description here

要使更改永久生效,请将以下代码添加到在初始化的项目数据阶段运行的CMS站点设置ImpEx脚本中.

To make the change permanent, add the following code to the CMS site setup ImpEx script run during the project data phase of initialization.

UPDATE CMSSite; uid [unique = true]; urlPatterns; ; electronics;(?i)^ https?://[^/] +(/[^?] )?\?(. \&)?(site = electronics)(| \ & ;. )$,(?i)^ https?://electronics.[^/] +(|/. | \ ?. )$,(?i)^ https ?://api.hybrisdev.com(:[\ d] +)?/rest. $,(?i)^ https?://://[^/] /yacceleratorstorefront((?! [\?\&] site =).);

UPDATE CMSSite;uid[unique=true];urlPatterns; ;electronics;(?i)^https?://[^/]+(/[^?])?\?(.\&)?(site=electronics)(|\&.)$,(?i)^https?://electronics.[^/]+(|/.|\?.)$,(?i)^https?://api.hybrisdev.com(:[\d]+)?/rest.$,(?i)^https?://[^/]/yacceleratorstorefront((?![\?\&]site=).);

这篇关于在Hybris中,如何在同一代码库中创建b2b和b2c店面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆