Skip to content

Add Rally to the integrations list - #885

Closed
zenkkor wants to merge 4 commits into
vercel:mainfrom
RallyCommerce:RALLY-VERCEL-COMMERCE/add-rally
Closed

Add Rally to the integrations list#885
zenkkor wants to merge 4 commits into
vercel:mainfrom
RallyCommerce:RALLY-VERCEL-COMMERCE/add-rally

Conversation

@zenkkor

@zenkkorzenkkor commented Nov 21, 2022

Copy link
Copy Markdown

Rally Next.js


#### To successfully integrate the Rally Checkout Button follow the steps below.

1. Install the Rally Checkout Button

npm install @rallycommerce/checkout-button

2. Create a Rally Checkout Button component

Create a RallyCheckoutButton.tsx component in the project with the following content 👇. Structure example 👉 lib/rally/RallyCheckoutButton.tsx

importReactfrom'react'import{Rally,RallyCheckoutButtonConfig}from'@rallycommerce/checkout-button';declareglobal{namespaceJSX{interfaceIntrinsicElements{'rally-checkout-button': any;}}}interfaceRallyCheckoutButtonProps{customText?: string|undefined;customClass?: string|undefined;cart?: any;}constRallyCheckoutButton=(props: RallyCheckoutButtonProps)=>{constcustomClass=props.customClass||"rally-custom-button-class";constcart=props?.cart;if(cart){constconfiguration: RallyCheckoutButtonConfig={cartData: {content: cart,id: cart.id,currency: cart.currency}};Rally.init('clientId',configuration);}return(<>{<rally-checkout-buttonsuppressHydrationWarning={true}custom-class={customClass}custom-text={props.customText}loader="true"></rally-checkout-button>}</>)}exportdefaultRallyCheckoutButton;

3. Use the Rally Checkout Button component

The component can now be imported (ex. on the cart page) like this 👇.

importdynamicfrom'next/dynamic';constRallyCheckoutButton=dynamic(()=>import('@lib/rally/RallyCheckoutButton'),{ssr: false,})import{Context}from'../../lib/xy/storefront-data-hooks/src/Context';const{ cart }=useContext(Context)<RallyCheckoutButtoncart={cart}customText="Custom text"customClass="custom-css-class"></RallyCheckoutButton>

@vercel

vercelBot commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

@FrciSmrci is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercelBot commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

NameStatusPreviewUpdated
commerce-bigcommerce❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-commercejs❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-kibocommerce❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-local✅ Ready (Inspect)Visit PreviewDec 8, 2022 at 8:03PM (UTC)
commerce-ordercloud❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-saleor❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-shopify❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-spree❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-swell❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)
commerce-vendure❌ Failed (Inspect)Dec 8, 2022 at 8:03PM (UTC)

@leerob

Copy link
Copy Markdown
Contributor

Hey there! Thank you for your contribution. We have decided to take Next.js Commerce in a new direction and will be closing out current PRs and issues due to this change. Please see this PR for more details: #966

P.S. we'd still love to see a Rally fork of the new direction! 🙏

@leerobleerob closed this Apr 18, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@zenkkor@leerob@FrciSmrci