Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Unanswered

On checkout page I need to disable save button when there is no option has been chosen

Posted on by
I want to access the code for save button on delivery options. but as I understood the savebutton as  props is not important cause I removed the props and save button is still there. it means it would be rendered by it's parent component. I do not know how to find parent component for "Checkout-delivery-option-view".  
const CheckoutDeliveryOptionsView: React.FC<ICheckoutDeliveryOptionsViewProps> = props => {
    const {
        CheckoutDeliveryOptions,
        checkoutErrorRef,
        viewState,
        deliveryOptions,
        deliveryOptionSelected,
        alert,
        waiting,
        // saveButton,
        editButton,
        cancelButton
    } = props;
  return (
        <Module {...CheckoutDeliveryOptions} ref={checkoutErrorRef}>
            {viewState.isLoading && waiting}
            {viewState.isError && alert}
            {viewState.isShowList && deliveryOptions && (
                <DeliveryOptionList
                    props={props}
                    {...deliveryOptions}
                    listOfLocations={locatonList}
                    onRadioSelect={handleRadioSelect}
                    onDropdownSelect={handleDropdownSelect}
                    selectedDropdownOption={selectedDropdownOption}
                    selectedRadioButton={selectedRadioButton}
                />
            )}
            {viewState.isShowSelected && deliveryOptionSelected && <DeliveryOptionSelected {...deliveryOptionSelected} />}
            {/* {viewState.isShowSaveButton && saveButton} */}
            {viewState.isShowEditButton && editButton}
            {viewState.isShowCancelButton && cancelButton}
        </Module>
    );
};
 
export default CheckoutDeliveryOptionsView;
Could any one help me how to find the parent component or if there is any other idea to access saveButton action.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans