我想禁用Hybris OOTB提供的条目过滤器之一(entryMergeFilterConfigurableProduct)。由于使用了此过滤器,因此某些购物车条目已被合并,尽管按照我们的业务逻辑,这不是应该的。
我想覆盖自定义扩展名中的定义。但是它没有按预期工作。
OOTB xml代码:
<alias name="defaultEntryMergeStrategy" alias="entryMergeStrategy"/>
<bean id="defaultEntryMergeStrategy" class="de.hybris.platform.commerceservices.order.strategies.impl.DefaultEntryMergeStrategy">
<property name="entryMergeFilters" ref="commerceCartEntryMergeFilters"/>
</bean>
<bean id="entryMergeFilterConfigurableProduct" class="de.hybris.platform.commerceservices.order.impl.EntryMergeFilterConfigurableProduct">
<property name="productConfigurableChecker" ref="productConfigurableChecker" />
</bean>
<bean id="entryMergeFilterIsEntryUpdatable" class="de.hybris.platform.commerceservices.order.impl.EntryMergeFilterIsEntryUpdatable">
<property name="entryOrderChecker" ref="commerceOrderEntryModifiableChecker" />
</bean>
<bean id="entryMergeFilterPointOfService" class="de.hybris.platform.commerceservices.order.impl.EntryMergeFilterPointOfService"/>
<bean id="entryMergeFilterGiveAway" class="de.hybris.platform.commerceservices.order.impl.EntryMergeFilterGiveAway"/>
<bean id="entryMergeFilterProduct" class="de.hybris.platform.commerceservices.order.impl.EntryMergeFilterProduct"/>
<bean id="entryMergeFilterUnits" class="de.hybris.platform.commerceservices.order.impl.EntryMergeFilterUnits"/>
<bean id="entryMergeFilterEntryGroup" class="de.hybris.platform.commerceservices.order.impl.EntryMergeFilterEntryGroup"/>
<util:list id="commerceCartEntryMergeFilters" value-type="de.hybris.platform.commerceservices.order.EntryMergeFilter">
<ref bean="entryMergeFilterEntryGroup"/>
<ref bean="entryMergeFilterGiveAway"/>
<ref bean="entryMergeFilterProduct"/>
<ref bean="entryMergeFilterUnits"/>
<ref bean="entryMergeFilterPointOfService"/>
<ref bean="entryMergeFilterConfigurableProduct"/>
<ref bean="entryMergeFilterIsEntryUpdatable"/>
</util:list>
能否让我知道禁用特定过滤器需要更改什么?
答案 0 :(得分:0)
为此,ListMegreDerective可能会有所帮助,但尚未引入删除功能。这仅适用于填充列表。 https://help.sap.com/viewer/b490bb4e85bc42a7aa09d513d0bcb18e/1905/en-US/515ccff5d01b427f851694fb8ec989e6.html
通常的解决方案是覆盖bean(例如entryMergeFilterProduct)或为没有特定过滤器的过滤器定义新bean并创建别名。
<alias name="customizedYourAssignedCartEntryMergeFilters" alias="commerceCartEntryMergeFilters"/>
<util:list id="customizedYourAssignedCartEntryMergeFilters" value-type="de.hybris.platform.commerceservices.order.EntryMergeFilter">
<ref bean="entryMergeFilterEntryGroup"/>
<!-Your list of the Filters-->
</util:list>