Hello All, We're trying to implement a functional...
# suitecommerce
v
Hello All, We're trying to implement a functionality for the checkout domain, and I'm a bit confused with this so posting it as a query: Scenario: We are planning to build our own Checkout page/flow in SuiteCommerce in one of our extensions. We’re using SC 2020.2.7 currently. This checkout flow will have a different flow and additional features than the regular SC checkout flow (we not only process merchandise items, but also events, memberships, credentialing programs, etc). Also, instead of creating a sales order on submit, our checkout flow will be creating a custom record which will later be processed (asynchronously) and will generate a Sales Order along with some other records required by our modules (ex: Event, Membership, etc). (...continued in the thread...)
Reason to create a new Checkout Page: Since we had to implement such drastic changes, we do not plan on customizing the existing checkout page, and instead plan to create our own. We will still be using Extensibility API as a backbone of our checkout page (Cart, User Profile components) to show the user’s payment methods, applicable shipping methods, etc. Also, there will be a toggle in SC Configuration that will allow clients to use either the default checkout page or our custom checkout page (this depends on their requirements) -> this will ensure that we do not block the default Checkout page completely.
Query: My query is, what will be the best way to implement such a customization? I’ve used Page Types to create many landing pages (non-CMS) and their submodules in the shopping domain but never in the checkout domain. Will that same logic/flow still work here as well? We want to be able to use all methods of the Cart component (Extensibility API) on our custom Checkout page (ex: getShipMethods(), getPaymentMethods(), etc). (Our checkout page will have a URL like: /custom-checkout. Will we be able to redirect clients here when they checkout from the cart, instead of the regular checkout page?) I couldn’t find an example of any customizations like this one being done in the checkout domain (I referred developers.suitecommerce.com), hence decided to raise this query here. P.S.: We already have built a custom Cart page (in the shopping domain), which will work in tandem with this custom checkout page.
s
That sounds wildly outside the scope of a SuiteCommerce site and I would advise you to use SuiteCommerce Advanced instead.
v
Can we not create a Page Type for our Checkout page in the checkout domain?
s
I don't think they are part of our supported page types: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1549920564.html. Furthermore, what you have described seems best accomplished through creating a whole new checkout flow. You may have some joy by defining new checkout steps and groups, but my point is that this seems like a very convoluted way of squeezing something like this into an extension.
v
By Page Type, I meant creating a new public page for our Checkout module using PageType.registerPageType().
Copy code
var PageType = container.getComponent('PageType');
if(PageType) {
	PageType.registerPageType({
		name: 'Custom_Checkout_View',
		view: CustomCheckoutView,
		options: { container: container },
		routes: ['custom-checkout']
	});
}
But I understand what you're saying. What I have understood is that the Checkout module of SC is only meant to be extended (like you said, by defining new groups and steps) via an extension. Anything more than that, and it's better to be done via SCA. Your advice was really helpful, I will convey this to my team mates. Thank you. 🙂
s
As for your page type: I'm not sure what this would do? You have created it without specifying a route. so how would people access it? SuiteCommerce has a standard way of accessing the checkout, so you would have to plug anything you create into that.
v
The route I specified while creating (registering) the Page Type is 'custom-checkout'. So I was expecting that visiting this URL would show our custom checkout page: <https://dev.mem360.org/scs/checkout-local.ssp#m360-checkout%7Chttps://&lt;webstore-url&gt;/scs/checkout.ssp#custom-checkout>
And what we thought we could do is, if a certain (custom) config property in SC Config is set to true, we could redirect users to our custom checkout page instead of the default SC one.
s
Ah, I didn't notice that. You could try it but I'm not sure how it would work.