spartacus | based JavaScript storefront for SAP Commerce Cloud | Ecommerce library
kandi X-RAY | spartacus Summary
kandi X-RAY | spartacus Summary
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
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of spartacus
spartacus Key Features
spartacus Examples and Code Snippets
Community Discussions
Trending Discussions on spartacus
QUESTION
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:30While 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:
QUESTION
What is the difference between those two configs and which should be used when?
...ANSWER
Answered 2022-Mar-25 at 19:24As 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
QUESTION
ANSWER
Answered 2022-Mar-17 at 14:25Able 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.
QUESTION
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:03The 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.
QUESTION
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:01Out 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)
QUESTION
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:45This 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:
QUESTION
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:42It was not working for me too before I changed the styles imports from angular.json to styles.scss.
Before:
QUESTION
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}}
QUESTION
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:41My 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:
QUESTION
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:37As 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:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spartacus
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page