Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. <?php
  2. namespace {vendor}{module}BlockAccountDashboard;
  3.  
  4. use MagentoFrameworkViewElementTemplateContext;
  5.  
  6. class Updatemobile extends MagentoFrameworkViewElementTemplate
  7. {
  8. protected $_customersession;
  9.  
  10. public function __construct(Context $context, MagentoCustomerModelSession $customerSession)
  11. {
  12. $this->_customersession = $customerSession;
  13. parent::__construct($context);
  14. }
  15.  
  16. public function getCustomerid()
  17. {
  18. $customerId = 0;
  19. if ($this->_customersession->isLoggedIn()) {
  20. $customerId = $this->_customersession->getCustomer()->getId();
  21. }
  22. return $customerId;
  23. }
  24.  
  25. public function getMobilenumber()
  26. {
  27. $mobileNumber = 0;
  28. if ($this->_customersession->isLoggedIn()) {
  29. $mobileNumber = $this->_customersession->getCustomer()->getMobilenumber();
  30. }
  31. return $mobileNumber;
  32. }
  33. }
  34.  
  35. <div class="update_mob">
  36. <div class="update_mob_text">
  37. <input type="text" value="<?php echo $block->getMobilenumber(); ?>" class="updatemobnumber"/>
  38. <input type="hidden" value="<?php echo $this->getUrl("mobilelogin/index/updatemobilenumber"); ?>" class="url" />
  39. <input type="hidden" value="<?php echo $block->getCustomerid();?>" class="userId" />
  40. <span><?php echo __("You will get all the sms on this number"); ?></span>
  41. </div>
  42. <div class="update_mob_btn">
  43. <input type="button" value="Update Mobile Number" class="updatemobbtn action primary"/>
  44. <img class="sms-request-load" src="<?php echo $block->getViewFileUrl('images/loader-1.gif'); ?>" alt="Please Wait..." id="updatemobile_img"/>
  45. </div>
  46. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement