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 also see on below picture.

enter image description here

Please help me. Thank You.

  • 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 Oct 21 at 7:17
  • Thank You for your advice @Nits .I already tried may different way still cannot solve my problem. – ye yint Oct 21 at 7:19
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.

  • Thank you @Nits but not working. – ye yint Oct 21 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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