2

I tried to find where did a button send data to do something. For example, for a button below, it is a button on "Ship to Multiple Addresses" page.

<button type="button" title="<?php /* @escapeNotVerified */ echo __('Enter a New Address') ?>" class="action add" data-role="add-new-address">
   <span>
      <?php /* @escapeNotVerified */ echo __('Enter a New Address') ?>
   </span>
</button>

So, where i can find the logic for that button? Is it in controller? or other place?

0

You can find newShipping button logic from below file, Logic is reside in contorller file.

vendor/magento/module-multishipping/Controller/Checkout/Address/NewShipping.php

Go to execute function and you can find your logic as above file.

Thanks.

  • Thank you for your answer, but how could that button call that controller? Is it by class? or by data role? – Edwin Widhiyanto Sep 18 '17 at 6:40
  • By default button click form submit, you can check form action above button html and on form action they redirect to above action. – Rakesh Jesadiya Sep 18 '17 at 6:41
  • It is called getPostActionUrl(), and it is return $this->getUrl('*/*/addressesPost'); Is that mean its called controller with name "AddressesPost.php"? – Edwin Widhiyanto Sep 18 '17 at 6:50

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.