Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session Bridge in PWA, How can we have hybrid storefront #1633

Open
Mohansharu opened this issue Jan 5, 2024 · 8 comments
Open

Session Bridge in PWA, How can we have hybrid storefront #1633

Mohansharu opened this issue Jan 5, 2024 · 8 comments
Labels
Acknowledged Team has responded to issue

Comments

@Mohansharu
Copy link

Mohansharu commented Jan 5, 2024

Hi,

I'm trying to have a home page in SFRA and a few pages in PWA like a hybrid. I have referred this document https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/phased-headless-rollouts.html, but still, I'm not getting how to achieve this do we need to deploy PWA to MRT to see changes?

I have cloned the repo that they mentioned in the doc and I'm using the latest PWA version in the cartridge path I have followed what they have mentioned. How can we do this? and also how to check please provide some info regarding this or share some documents that might be useful.

@agurumurthy96
Copy link
Contributor

Have you gone through this portion in the documentation link that you shared?
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/phased-headless-rollouts.html#set-up-phased-rollouts-locally-sig-instances

You do not need to deploy it on MRT, and can use the hybrid dev server as a reverse proxy to test on localhost.
https://github.com/SalesforceCommerceCloud/composable-hybrid-dev-server

@Mohansharu
Copy link
Author

Hi @agurumurthy96

I'm trying to make these changes in local and also to have a homepage in PWA rest of all modules in SFRA, how to achieve this in refArch? https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/phased-headless-rollouts.html. I have followed this document like having the SLAS plugin cartridge in the workspace as well as the base cartridge in the repo and have updated the cartridge path as mentioned in the doc. also, I have created the SLAS ID in BM by specifying the scope they mentioned.
Since I have the version 3 or greater PWA code base, I have not done any code changes in the auth.js file which they specified clearly in the doc. what needs to be done in routes exactly? and also I have tried with extensibility as well using overrides but still no luck, once after i followed the above doc steps when I run PWA storefront added product to cart if I click on cart page it's showing like below

image

after this what do we need to do here I have been stuck here, If I see a storefront one tab in PWA and another one in SFRA both work independently there is no relation between them after doing all the changes. Am I missing anything please help me

@bendvc
Copy link
Collaborator

bendvc commented Jan 18, 2024

@Mohansharu If you are hoping to be doing local development for a hybrid please take a look at this project that was specifically made for that purpose.

@bendvc bendvc added the Acknowledged Team has responded to issue label Jan 18, 2024
@Mohansharu
Copy link
Author

Hi @bendvc, I have referred to this cartridge and followed the steps, whenever I run localhost 8001 which is our hybrid server it shows PWA storefront when I add the product to the cart according to code it should render cart and checkout page in SFRA based on below code

image

it's working as expected but when it comes to 'cart' SFRA storefront when I click on the salesforce logo which is nothing but the home page it's navigating to the SFRA home page. It needs to navigate to the PWA home page right?

@bendvc
Copy link
Collaborator

bendvc commented Jan 22, 2024

Hey @Mohansharu .. so from what I'm hearing you are successfully making the transition from PWA-Kit to SFRA for checkout, but you are expecting that clicking the home button will bring you back to PWA-Kit home, and not SFRA home?

I'm going to loop in the dev (@sandragolden) of the project I previously mentioned to get her take on it since I'm not super familiar with it.

@athik88
Copy link

athik88 commented Jan 22, 2024

Hi @Mohansharu
We are tracking this request through cases: [46081299] and [46061053]
For the request sfra to pwa transition, you need to configure redirect rules in BM (Merchant Tools > SEO > URL Redirects) We can connect tomorrow as per support case 46081299 and discuss
Thanks

@sandragolden
Copy link
Contributor

@bendvc @Mohansharu I use the plugin_redirect cartridge to handle these cases. As you can see, mine does redirect back to cart through the use of plugin_redirect

@Mohansharu
Copy link
Author

Mohansharu commented Jan 23, 2024

@sandragolden @bendvc plugin_redirect worked for SFRA and was able to redirect back to PWA and even @athik88 told how we can specify SEO redirects to navigate to category pages from SFRA to PWA storefront. Thanks for the help and suggestion.

If we want to navigate to different categories from SFRA to PWA do we need to specify SEO URL redirects for individual categories or can we specify all categories in one shot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Acknowledged Team has responded to issue
Projects
None yet
Development

No branches or pull requests

5 participants