0

I'm new to magento.I'm working on magento 2 custom checkout module due to integration with client ERP system.

All of my checkout process are using custom table like custom_order_table and custom_order_items_table.

My question is how can I add PayPal Checkout button on my custom page and when click the button retrieve data from my custom table etc .. grand_total,currency,item_detils and submit to PayPal to complete payment process.

Please help me. Thank You.

2
  • Please follow the checkout_cart_index.xml layout in the PayPal module. You will get an idea to add that button on the custom page.
    – Nits
    Commented Oct 21, 2019 at 7:17
  • Thank You for your advice @Nits .I already tried may different way still cannot solve my problem.
    – Ye Yint
    Commented Oct 21, 2019 at 7:19

1 Answer 1

0

Please follow the below steps to add a button on your custom page.

1) Review this block and do the required changes in your custom module file.

/var/www/html/magento2/vendor/magento/module-checkout/Block/QuoteShortcutButtons.php

2) Add this code in your custom page block file (php)

    /**
     * Dispatch shortcuts container event
     * @return $this
     */
    protected function _beforeToHtml()
    {
        $this->_eventManager->dispatch(
            'shortcut_buttons_container',
            [
                'container' => $this,
                'is_catalog_product' => $this->_isCatalogProduct,
                'or_position' => $this->_orPosition
            ]
        );
        return $this;
    }

I have not checked in detail but logic is the "shortcut_buttons_container" event configured this button and it will render on particular page section.

Hope this will help you.

1
  • Thank you @Nits but not working.
    – Ye Yint
    Commented Oct 21, 2019 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.