spartacus | based JavaScript storefront for SAP Commerce Cloud | Ecommerce library

 by   SAP TypeScript Version: schematics-4.3.8 License: Apache-2.0

kandi X-RAY | spartacus Summary

kandi X-RAY | spartacus Summary

spartacus is a TypeScript library typically used in Web Site, Ecommerce applications. spartacus has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud. Spartacus talks to SAP Commerce Cloud exclusively through the Commerce REST API.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spartacus has a low active ecosystem.
              It has 686 star(s) with 339 fork(s). There are 55 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 718 open issues and 7849 have been closed. On average issues are closed in 235 days. There are 206 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of spartacus is schematics-4.3.8

            kandi-Quality Quality

              spartacus has 0 bugs and 0 code smells.

            kandi-Security Security

              spartacus has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              spartacus code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              spartacus is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              spartacus releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.
              It has 26182 lines of code, 0 functions and 5527 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of spartacus
            Get all kandi verified functions for this library.

            spartacus Key Features

            No Key Features are available at this moment for spartacus.

            spartacus Examples and Code Snippets

            No Code Snippets are available at this moment for spartacus.

            Community Discussions

            QUESTION

            What is the compatible Node version for Spartacus 4.X?
            Asked 2022-Mar-30 at 12:57

            The SAP Spartacus documentation suggests the below in their official GitHub page: https://github.com/SAP/spartacus

            From the documentation , what I could understand is that the Spartacus documentation was last updated on Sept 2021 and Node 16 came out in October 2021.

            So is higher versions of node supported but is not officially specified by Spartacus team yet?

            ...

            ANSWER

            Answered 2022-Jan-13 at 14:30

            While Node 16 is not officially supported due to it not being supported in Angular 12, we have not encountered issues using Node 16 with Spartacus 4.x thus far. It will be officially supported in Angular 13/Spartacus 5.x.

            Angular compatibility list: https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3

            The package.json including Node 16:

            Source https://stackoverflow.com/questions/70676792

            QUESTION

            ConfigModule.withConfig or provideConfig in Spartacus
            Asked 2022-Mar-25 at 19:24

            What is the difference between those two configs and which should be used when?

            ...

            ANSWER

            Answered 2022-Mar-25 at 19:24

            As mentioned in the docs, they are the same.

            ConfigModule.withConfig({}) behaves the same way as provideConfig({})

            The difference between them is that the first is used to be used in import's array, whereas the latter is used in the provider's array

            However, you can create an issue in the Spartacus repository https://github.com/SAP/spartacus/issues in order to open the discussion of deprecating ConfigModule.withConfig

            'legacy' way

            Source https://stackoverflow.com/questions/71584554

            QUESTION

            OOTB Spartacus SASS build is failing
            Asked 2022-Mar-17 at 14:25

            I'm having this issue below just today. would you know how to fix this? This is the SASS version installed in my Spartacus sass "1.22.9" sass-loader "7.2.0" I'm using Angular8 and Spartacus 1.5

            ...

            ANSWER

            Answered 2022-Mar-17 at 14:25

            Able to build successfully in CCV2. I added the below code in my package.json and make sure to remove the package-lock.json or yarn.lock before doing yarn install.

            Source https://stackoverflow.com/questions/71493804

            QUESTION

            How to add additional query parameters in cms page content api call
            Asked 2022-Mar-03 at 10:03

            we want to append the cms page content api used out of box by spartacus for cart page

            current: cms/pages?pageType=ContentPage&pageLabelOrId=/cart

            required to add some additional query parameter

            required: cms/pages?pageType=ContentPage&pageLabelOrId=/cart&staticstorecode=42

            what code changes are required to achieve the above scenario?

            ...

            ANSWER

            Answered 2022-Mar-03 at 10:03

            The page request is made in the load method of the OccCmsPageAdapter. You would need to override this method to add your additional params. You could extend this class and create your own CustomOccCmsPageAdapter and subsequent classes like CustomPage model etc.

            Source https://stackoverflow.com/questions/71295087

            QUESTION

            How do you change the theme based on login in Spartacus?
            Asked 2022-Mar-01 at 04:07

            I'm working on a B2B portal using Spartacus where multiple companies can login. We need to show a different theme (scss) depending on what company they are logging in from.

            Does anyone know how to do this?

            ...

            ANSWER

            Answered 2021-Sep-07 at 17:01

            Out of the Box (OOTB), Spartacus does not support changing themes during runtime, and themes are not tied to the user profile either.

            Themes can be set dynamically in the back-office (see documentation)

            Source https://stackoverflow.com/questions/69081758

            QUESTION

            Spartacus add to cart
            Asked 2022-Feb-24 at 14:45

            With Spartacus I have been able to change the PDP call to take an extra parameter which is the store code and its working fine. But when I add the product to the cart the api call fails because the store code is not being passed through.

            I have started by extending the active-cart and multi-cart services to take my extra parameter and I am struggling with one of the private variables that are used in the function that are not exposed.

            Am I on the right path or is there an easier way to add a parameter to this call? Is an intercepter going to work?

            ...

            ANSWER

            Answered 2022-Feb-24 at 14:45

            This is the easy way for you, if you are using Spartacus 4.1.x

            1 - Create a service that will provide the store code (maybe you already have it)

            2 - Override original configuration for Occ addEntries endpoint to use your additional parameter (e.g., addEntries: 'users/${userId}/carts/${cartId}/entries?storeCode=${storeCode}' )

            3 - Extend OccCartEntryAdapter from Spartacus, inject the service from Step 1 in the constructor, and override add method; the method body will be almost equal as the original Spartacus code, with the additional that you will get the storeCode from the service injected, and you will add it to buildUrl call:

            Source https://stackoverflow.com/questions/71239787

            QUESTION

            Skipping Specific Component Styles
            Asked 2022-Feb-23 at 20:42

            I try to do something realy basic what is described in spartacus documentation https://sap.github.io/spartacus-docs/css-architecture/#skipping-specific-component-styles

            At file src/styles.scss:

            ...

            ANSWER

            Answered 2022-Feb-23 at 20:42

            It was not working for me too before I changed the styles imports from angular.json to styles.scss.

            Before:

            Source https://stackoverflow.com/questions/71207022

            QUESTION

            Spartacus 4.2 - Type '"before"' is not assignable to type 'OutletPosition'
            Asked 2022-Feb-18 at 20:43

            While trying to customize the navigation slot, we are getting the error

            Type '"before"' is not assignable to type 'OutletPosition'.

            This is the code we are trying.

            Also have tried

            [cxOutletPos]=“outletPosition.BEFORE”

            Documentation referred for Spartacus 4.2 :

            https://sap.github.io/spartacus-docs/outlets/#template-driven-outlets

            Result should be something like custom info, followed by navigation bar as shown below:

            Also, as the above method didn't work I tried retrieving data through let-model for manipulation. Array I want to retrieve data from into our component: CategoryNavigationComponent. But using let-model and Printing model object I can see only "uid" , "typeCode" and "flexType" but not the navigatioNode and Children.

            Is there any way to retrieve Navigation bar or Children array data on the screen?

            ...

            ANSWER

            Answered 2022-Feb-09 at 17:11
            ****in TS File:****
              settingsSubmenu: any = [];
            
            constructor(public component: CmsComponentData )
            {
               this.component.data$.forEach(element => {
                 element.navigationNode.children.forEach(child => {
                  this.settingsSubmenu.push(child)   
                 });
                });
            }
            **in HTML File**
            
             
                                    {{menuItem.title}}
              
            

            Source https://stackoverflow.com/questions/70695830

            QUESTION

            Production build orderCore is missing
            Asked 2022-Feb-15 at 01:41

            I had to manually upgrade from 3.2 to 4.2 and because I am developing a Angular library, I could not use the schematics to perform the update.

            I have got it working on the development build. We are developing a feature library that targets the checkout (Payment Page and Order Confirmation Page) and it works fine.

            With the production build (ng build --configuration production), the payment page works fine, but the Order Confirmation page is not working. it complains that orderCore feature is not configured properly.

            Note: we are being redirected from an external site, back to the order confirmation page (after authorization). When the page loads, it shows the following error in the log and show a broken my account page.

            ...

            ANSWER

            Answered 2022-Feb-15 at 01:41

            My colleague has provided a proposal:

            If you want to use Spartacus Order library, you need to create "order-feature.module.ts" for it. And by default core is bundled together with components. So, in your configuration, you need have this set: "[ORDER_CORE_FEATURE]: ORDER_FEATURE". So, the config is something like this:

            Source https://stackoverflow.com/questions/70420852

            QUESTION

            How can auto play carousel in SAP/spartacus?
            Asked 2022-Feb-14 at 13:37

            I am using carousel components of SAP/spartacus. My requirement is carousel should be auto play. Please help me to resolve it.

            ...

            ANSWER

            Answered 2022-Feb-14 at 13:37

            As I can see in the source code it's not implemented OOTB in Spartacus, but you can easily add this functionality to your project.

            Please create your own CarouselComponent, based on Spartacus' one.

            1 class should implement also OnDestroy interface

            2 add new dependency protected ref: ChangeDetectorRef

            3 add new property subscription = new Subscription();

            4 fill method ngOnInit by this:

            Source https://stackoverflow.com/questions/71101971

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install spartacus

            To get up and running with Spartacus, the recommended approach is to build your storefront application from ready-made libraries. You can also clone and build from source, but upgrading is not as simple. Spartacus currently can only be used with a SAP Commerce Cloud instance through Commerce APIs. To quickly add Spartacus libraries to an Angular application, you can use Spartacus schematics: ng add @spartacus/schematics. This will setup and install Spartacus libraries to your Angular project. Please check the official Spartacus schematics documentation for all the prerequisites and instruction on how to use Spartacus schematics. For complete setup instructions, see Building the Spartacus Storefront from Libraries.

            Support

            The latest generated documentation for Spartacus application libraries (modules, classes, interfaces, and so on) is hosted here: https://sap.github.io/spartacus/. The application documentation is versioned and it is included on the Assets section of every release of each and every Spartacus library. You can download the documentation for a particular version by accessing the Assets section of any Spartacus library from that particular release, and then clicking on docs.tar.gz or docs.zip. To find the Assets folder for a particular library, access the Released Libraries for Spartacus, click on the link for the library you are interested in, and scroll to the bottom of the page.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Ecommerce Libraries

            saleor

            by saleor

            saleor

            by mirumee

            spree

            by spree

            reaction

            by reactioncommerce

            medusa

            by medusajs

            Try Top Libraries by SAP

            openui5

            by SAPJavaScript

            ui5-webcomponents

            by SAPTypeScript

            styleguides

            by SAPCSS

            luigi

            by SAPJavaScript