Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace {vendor}{module}BlockAccountDashboard;
- use MagentoFrameworkViewElementTemplateContext;
- class Updatemobile extends MagentoFrameworkViewElementTemplate
- {
- protected $_customersession;
- public function __construct(Context $context, MagentoCustomerModelSession $customerSession)
- {
- $this->_customersession = $customerSession;
- parent::__construct($context);
- }
- public function getCustomerid()
- {
- $customerId = 0;
- if ($this->_customersession->isLoggedIn()) {
- $customerId = $this->_customersession->getCustomer()->getId();
- }
- return $customerId;
- }
- public function getMobilenumber()
- {
- $mobileNumber = 0;
- if ($this->_customersession->isLoggedIn()) {
- $mobileNumber = $this->_customersession->getCustomer()->getMobilenumber();
- }
- return $mobileNumber;
- }
- }
- <div class="update_mob">
- <div class="update_mob_text">
- <input type="text" value="<?php echo $block->getMobilenumber(); ?>" class="updatemobnumber"/>
- <input type="hidden" value="<?php echo $this->getUrl("mobilelogin/index/updatemobilenumber"); ?>" class="url" />
- <input type="hidden" value="<?php echo $block->getCustomerid();?>" class="userId" />
- <span><?php echo __("You will get all the sms on this number"); ?></span>
- </div>
- <div class="update_mob_btn">
- <input type="button" value="Update Mobile Number" class="updatemobbtn action primary"/>
- <img class="sms-request-load" src="<?php echo $block->getViewFileUrl('images/loader-1.gif'); ?>" alt="Please Wait..." id="updatemobile_img"/>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement