cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

custom ywebservices conflicting with cmsocc

0 Likes
1,672

Hello,

I am trying to make custom ycommercewebservices based extension

Asked question https://answers.sap.com/questions/13134081/extending-userscontroller-hybris-commerce.html and followed the proposed solution. However this is conflicting with cmsocc that uses commercewebservices

I need it to be able to load pages in spartacus. How can i do that?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member270748
Discoverer
0 Likes

Hi Noha,

if you haven't find a solution I can provide you a fix to solve your problem.

Basically what's suggested in the proposed solution is correct. Let's suppose you have your own OCC extension generated from the ycommercewebservices template and called zcommercewebservices.

Add the following extensions to your localextensions.xml:

<extension name="zcommercewebservices" />
<extension name="cmsoccaddon" />

Add cmsoccaddon to your OCC extension:

ant addoninstall -Daddonnames="cmsoccaddon" -DaddonStorefront.ycommercewebservices="zcommercewebservices"

Modify the file /zcommercewebservices/extensioninfo.xml:

<!-- <webmodule jspcompile="false" webroot="/zcommercewebservices" /> -->

<webmodule jspcompile="false" webroot="/occ" />

Then compile (ant clean all) and restart hybris.

Provided that you have defined the occ endpoint in the Spartacus configuration file spartacus-configuration.module.ts:

...
  providers: [provideConfig(layoutConfig), provideConfig(mediaConfig), ...defaultCmsContentProviders, provideConfig(<OccConfig>{
    backend: {
      occ: {
        baseUrl: 'https://localhost:9002/',
      }
    },
  }), provideConfig(<SiteContextConfig>{
    context: {
      currency: ['USD'],
      language: ['en'],
      baseSite: ['---your base site---'],
    },
...

This solution works in my project. We were able to use the our customized OCC services with Spartacus.

0 Likes

Thanks a lot that was the solution I did

Answers (1)

Answers (1)

0 Likes

Hi Neha,

We are facing the same issue. Did you find any solution?

Thanks,

Priyanka

selman_celebi
Member
0 Likes

you can generate a new extension (customcontentocc) from cmsocc. Then replace the commercewebservices requirement with yours (in extensioninfo.xml)

Ask a Question