I am using one custom payment module and i want to do code in html file. Path is
app/code/Custom/Payment/view/frontend/web/template/payment/custompayment.html
and my code is
$om = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $om->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()){
-----------code ---------
}
js file which i trying to do but not working
define(
[
'jquery',
'Magento_Customer/js/customer-data',
'Magento_Checkout/js/view/payment/default'
],
function (Component) {
'use strict';
var getCustomerInfo = function () {
var customer = customerData.get('customer');
return customer();
};
var isLoggedIn = function (customerInfo) {
customerInfo = customerInfo || getCustomerInfo();
return customerInfo && customerInfo.firstname;
};
return Component.extend({
defaults: {
template: 'XJ_Payment/payment/custompayment'
},
/** Returns send check to info */
getMailingAddress: function() {
return window.checkoutConfig.payment.checkmo.mailingAddress;
},
});
}
);
but i am not able to get result. i know this code is perfect work if i put on controller or model file. but still i am facing the issue which is output is after -> on second line all the code are print on frontend. i can't understand what's going on.
Can you please suggest me how to resolve the issue ?
custompayment.phtmlnotcustompayment.html– Qaisar Satti Sep 08 '16 at 10:51