Modifying authentication popup Announcing the arrival of Valued Associate #679: Cesar Manara ...
How can I make a line end at the edge of an irregular shape?
Why did C use the -> operator instead of reusing the . operator?
Married in secret, can marital status in passport be changed at a later date?
Would reducing the reference voltage of an ADC have any effect on accuracy?
Determining the ideals of a quotient ring
Error: Syntax error. Missing ')' for CASE Statement
How would this chord from "Rocket Man" be analyzed?
What if Force was not Mass times Acceleration?
How would I use different systems of magic when they are capable of the same effects?
Align column where each cell has two decimals with siunitx
std::is_constructible on incomplete types
"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"
Who is Alexandra K. Trenfor? Did she say the quote?
How do I check if a string is entirely made of the same substring?
Are these square matrices always diagonalisable?
Split coins into combinations of different denominations
Mistake in years of experience in resume?
My admission is revoked after accepting the admission offer
Why does the Cisco show run command not show the full version, while the show version command does?
What *exactly* is electrical current, voltage, and resistance?
What is a 'Key' in computer science?
Is Bran literally the world's memory?
Can I criticise the more senior developers around me for not writing clean code?
Raising a bilingual kid. When should we introduce the majority language?
Modifying authentication popup
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Modifying the checkout success page in magentoMagento2 override admin js fileMagento 2: Modify authentication-popup.html form actionMagento 2 - Minicart not updated after login from authentication popupmagento 2 js modal popup close eventMagento2 - Add mailchimp popupLoading Javascript for minicart in Magento 2Call default Magento 2 authentication popup from a custom moduleHow to hide particular admin form field(UI Component) based on the value of select field?overriding Authentication popup is notworking
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I'm trying to apply the authentication popup on a custom button in my module. I've implemented it by overriding it in my requirejs-config.
var config = {
map: {
'*': {
'Magento_Customer/js/model/authentication-popup': 'Vendor_CustomPopup/js/model/authentication-popup-download'
}
}
};
and my modified JS looks like this:
define(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function ($, modal) {
'use strict';
return {
modalWindow: null,
// Create popUp window for provided element
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
},
// Show login popup window
showModal: function () {
$(this.modalWindow).modal('openModal');
}
}
}
);
The only change I need to apply is the trigger in the options, this works, but is there a better way of modifying this without overriding the whole function?
magento2 javascript extend
bumped to the homepage by Community♦ 4 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm trying to apply the authentication popup on a custom button in my module. I've implemented it by overriding it in my requirejs-config.
var config = {
map: {
'*': {
'Magento_Customer/js/model/authentication-popup': 'Vendor_CustomPopup/js/model/authentication-popup-download'
}
}
};
and my modified JS looks like this:
define(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function ($, modal) {
'use strict';
return {
modalWindow: null,
// Create popUp window for provided element
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
},
// Show login popup window
showModal: function () {
$(this.modalWindow).modal('openModal');
}
}
}
);
The only change I need to apply is the trigger in the options, this works, but is there a better way of modifying this without overriding the whole function?
magento2 javascript extend
bumped to the homepage by Community♦ 4 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm trying to apply the authentication popup on a custom button in my module. I've implemented it by overriding it in my requirejs-config.
var config = {
map: {
'*': {
'Magento_Customer/js/model/authentication-popup': 'Vendor_CustomPopup/js/model/authentication-popup-download'
}
}
};
and my modified JS looks like this:
define(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function ($, modal) {
'use strict';
return {
modalWindow: null,
// Create popUp window for provided element
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
},
// Show login popup window
showModal: function () {
$(this.modalWindow).modal('openModal');
}
}
}
);
The only change I need to apply is the trigger in the options, this works, but is there a better way of modifying this without overriding the whole function?
magento2 javascript extend
I'm trying to apply the authentication popup on a custom button in my module. I've implemented it by overriding it in my requirejs-config.
var config = {
map: {
'*': {
'Magento_Customer/js/model/authentication-popup': 'Vendor_CustomPopup/js/model/authentication-popup-download'
}
}
};
and my modified JS looks like this:
define(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function ($, modal) {
'use strict';
return {
modalWindow: null,
// Create popUp window for provided element
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
},
// Show login popup window
showModal: function () {
$(this.modalWindow).modal('openModal');
}
}
}
);
The only change I need to apply is the trigger in the options, this works, but is there a better way of modifying this without overriding the whole function?
magento2 javascript extend
magento2 javascript extend
asked Jul 21 '16 at 11:44
belfort1belfort1
377110
377110
bumped to the homepage by Community♦ 4 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 4 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can do it with a mixin and only update the function createPopUp.
Vendor/Module/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_Customer/js/view/authentication-popup': {
'Vendor_Module/js/view/authentication-popup-mixin': true
}
}
}
};
Vendor/Module/view/frontend/web/js/view/authentication-popup-mixin.js
define([
'uiComponent',
'jquery',
'Magento_Ui/js/modal/modal'
], function (Component, $, modal) {
'use strict';
return function (Component) {
return Component.extend({
/**
* @inheritDoc
*/
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
}
});
};
});
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f126800%2fmodifying-authentication-popup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can do it with a mixin and only update the function createPopUp.
Vendor/Module/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_Customer/js/view/authentication-popup': {
'Vendor_Module/js/view/authentication-popup-mixin': true
}
}
}
};
Vendor/Module/view/frontend/web/js/view/authentication-popup-mixin.js
define([
'uiComponent',
'jquery',
'Magento_Ui/js/modal/modal'
], function (Component, $, modal) {
'use strict';
return function (Component) {
return Component.extend({
/**
* @inheritDoc
*/
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
}
});
};
});
add a comment |
You can do it with a mixin and only update the function createPopUp.
Vendor/Module/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_Customer/js/view/authentication-popup': {
'Vendor_Module/js/view/authentication-popup-mixin': true
}
}
}
};
Vendor/Module/view/frontend/web/js/view/authentication-popup-mixin.js
define([
'uiComponent',
'jquery',
'Magento_Ui/js/modal/modal'
], function (Component, $, modal) {
'use strict';
return function (Component) {
return Component.extend({
/**
* @inheritDoc
*/
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
}
});
};
});
add a comment |
You can do it with a mixin and only update the function createPopUp.
Vendor/Module/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_Customer/js/view/authentication-popup': {
'Vendor_Module/js/view/authentication-popup-mixin': true
}
}
}
};
Vendor/Module/view/frontend/web/js/view/authentication-popup-mixin.js
define([
'uiComponent',
'jquery',
'Magento_Ui/js/modal/modal'
], function (Component, $, modal) {
'use strict';
return function (Component) {
return Component.extend({
/**
* @inheritDoc
*/
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
}
});
};
});
You can do it with a mixin and only update the function createPopUp.
Vendor/Module/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_Customer/js/view/authentication-popup': {
'Vendor_Module/js/view/authentication-popup-mixin': true
}
}
}
};
Vendor/Module/view/frontend/web/js/view/authentication-popup-mixin.js
define([
'uiComponent',
'jquery',
'Magento_Ui/js/modal/modal'
], function (Component, $, modal) {
'use strict';
return function (Component) {
return Component.extend({
/**
* @inheritDoc
*/
createPopUp: function (element) {
this.modalWindow = element;
var options = {
'type': 'popup',
'modalClass': 'popup-authentication',
'responsive': true,
'innerScroll': true,
'trigger': '.download-purchase', // only change needed
'buttons': []
};
//console.log(options);
modal(options, $(this.modalWindow));
}
});
};
});
answered Sep 20 '18 at 11:42
raumatbelraumatbel
733414
733414
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f126800%2fmodifying-authentication-popup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown