magento 2 Uncaught TypeError: Cannot read property 'version' of undefinedMagento 2.1 Uncaught TypeError: Cannot read property 'replace' of nullUncaught TypeError Porto Theme 2.1.0 Magento 2product quickview not working with infinite scrollUncaught TypeError: Cannot read property 'autocompleteIndex' of undefinedUncaught TypeError: Cannot read property 'nodeName' of undefined in custom js admin panelMagento 2, Cannot read property 'ui' of undefinedHow can I check if my attribute select option has been selected?jQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Magento 2: Cannot read property 'dialog' of undefined, 'timepicker' of undefined,'RFC_2822' of undefinedMagento 2.2.5 - Uncaught TypeError: Cannot read property 'dialog' of undefined
Reason why a kingside attack is not justified
Would this string work as string?
Why do Radio Buttons not fill the entire outer circle?
How do I prevent inappropriate ads from appearing in my game?
If the Dominion rule using their Jem'Hadar troops, why is their life expectancy so low?
What do the positive and negative (+/-) transmit and receive pins mean on Ethernet cables?
What is the period/term used describe Giuseppe Arcimboldo's style of painting?
What is the tangent at a sharp point on a curve?
How can a new country break out from a developed country without war?
Offset in split text content
Relations between homogeneous polynomials
What is the purpose of using a decision tree?
I keep switching characters, how do I stop?
Is there a POSIX way to shutdown a UNIX machine?
Showing mass murder in a kid's book
"Oh no!" in Latin
Reasons for having MCU pin-states default to pull-up/down out of reset
How do you say "Trust your struggle." in French?
How would a solely written language work mechanically
Should I warn a new PhD Student?
How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?
Does capillary rise violate hydrostatic paradox?
Friend wants my recommendation but I don't want to give it to him
What should be the ideal length of sentences in a blog post for ease of reading?
magento 2 Uncaught TypeError: Cannot read property 'version' of undefined
Magento 2.1 Uncaught TypeError: Cannot read property 'replace' of nullUncaught TypeError Porto Theme 2.1.0 Magento 2product quickview not working with infinite scrollUncaught TypeError: Cannot read property 'autocompleteIndex' of undefinedUncaught TypeError: Cannot read property 'nodeName' of undefined in custom js admin panelMagento 2, Cannot read property 'ui' of undefinedHow can I check if my attribute select option has been selected?jQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Magento 2: Cannot read property 'dialog' of undefined, 'timepicker' of undefined,'RFC_2822' of undefinedMagento 2.2.5 - Uncaught TypeError: Cannot read property 'dialog' of undefined
I got below error randomly in front-end and when all modal popup not working when below error occurs.
Uncaught TypeError: Cannot read property 'version' of undefined
I have override admin product-gallery.js and its working fine.
requirejs-config.js
var config =
config:
mixins:
'Magento_Catalog/js/product-gallery':
'Hs_Mageenhancement/js/product-gallery-mixin': true
;
Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js
define([
'jquery',
'underscore',
'mage/template',
'uiRegistry'
], function($, _, mageTemplate, registry)
'use strict';
return function (widget)
$.widget('mage.productGallery', widget,
/**
* Initializes dialog element.
*/
_initDialog: function ()
var $dialog = $(this.dialogContainerTmpl());
$dialog.modal(
'type': 'slide',
title: $.mage.__('Image Detail'),
buttons: [],
/** @inheritdoc */
opened: function ()
$dialog.trigger('open');
,
/** @inheritdoc */
closed: function ()
$dialog.trigger('close');
);
$dialog.on('open', this.onDialogOpen.bind(this));
$dialog.on('close', function ()
var $imageContainer = $dialog.data('imageContainer');
$imageContainer.removeClass('active');
$dialog.find('#hide-from-product-page').remove();
);
$dialog.on('change', '[data-role=type-selector]', function ()
var parent = $(this).closest('.item'),
selectedClass = 'selected';
parent.toggleClass(selectedClass, $(this).prop('checked'));
);
$dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));
$dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
var imageData = $dialog.data('imageData');
this.element.trigger('updateVisibility',
disabled: $(e.currentTarget).is(':checked'),
imageData: imageData
);
, this));
$dialog.on('change', '[data-role="image-description"]', function (e)
var target = $(e.target),
targetName = target.attr('name'),
desc = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);
imageData.label = desc;
imageData['label_default'] = desc;
this.element.trigger('updateImageTitle',
imageData: imageData
);
.bind(this));
$dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
var target = $(e.target),
targetName = target.attr('name'),
tirePriceQty = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
, this));
this.$dialog = $dialog;
);
return $.mage.productGallery;
);
Also added popup code into .phtml file.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
)
var contactOptions =
type: 'popup',
title: $.mage.__('Contact Us'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
$("#ContactUsModal").on('click',function()
$("#contact-popup-mpdal").modal("openModal");
);
var pricePromiseOptions =
type: 'popup',
title: $.mage.__('Price Match Promise Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
$("#price_promise").on('click',function()
$("#price-promise-popup-mpdal").modal("openModal");
);
var privacyPolicyOptions =
type: 'popup',
title: $.mage.__('Privacy Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
$("#privacy_policy").on('click',function()
$("#privacy-policy-popup-mpdal").modal("openModal");
);
var cookiesPolicyOptions =
type: 'popup',
title: $.mage.__('Cookie Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
$("#cookies_policy").on('click',function()
$("#cookie-policy-popup-mpdal").modal("openModal");
);
var termsConditionOptions =
type: 'popup',
title: $.mage.__('Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
$("#TermsCondiModal").on('click',function()
$("#terms-condition-popup-mpdal").modal("openModal");
);
);
</script>
Another popup code as below.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal',
'mage/validation'
],
function(
$,
modal
)
jQuery(document).ready(function()
var options =
type: 'popup',
title: $.mage.__('All Reviews'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var popup = modal(options, $('#list-review-popup-mpdal'));
jQuery("#ListReview").on('click',function()
jQuery("#list-review-popup-mpdal").modal("openModal");
);
var reviewFormOptions =
type: 'popup',
title: $.mage.__('Write a Review'),
responsive: true,
innerScroll: true,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
jQuery("#SubmitReview").on('click',function()
jQuery("#submit-review-popup-mpdal").modal("openModal");
);
var dataForm = $('#review-form');
dataForm.mage('validation', );
jQuery('body').on('click', '#review-form .action.submit', function(e)
e.preventDefault();
e.stopImmediatePropagation();
if(dataForm.validation('isValid'))
jQuery.ajax(
type: 'post',
url: jQuery('#review-form').attr('action'),
data: jQuery('#review-form').serialize(),
cache: false,
showLoader: 'true',
success: function(response)
var message = response.message;
if(response.success)
jQuery('#feedback_review').removeClass('error-msg');
jQuery('#feedback_review').addClass('Succ-msg');
else
jQuery('#feedback_review').removeClass('Succ-msg');
jQuery('#feedback_review').addClass('error-msg');
jQuery('#feedback_review').html(message).show();
);
return false;
);
);
);
</script>
Is there any issue related to popups?
Please help to resolve issue.
jquery magento2.3.0 modal-popup requirejs-config.js console
add a comment |
I got below error randomly in front-end and when all modal popup not working when below error occurs.
Uncaught TypeError: Cannot read property 'version' of undefined
I have override admin product-gallery.js and its working fine.
requirejs-config.js
var config =
config:
mixins:
'Magento_Catalog/js/product-gallery':
'Hs_Mageenhancement/js/product-gallery-mixin': true
;
Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js
define([
'jquery',
'underscore',
'mage/template',
'uiRegistry'
], function($, _, mageTemplate, registry)
'use strict';
return function (widget)
$.widget('mage.productGallery', widget,
/**
* Initializes dialog element.
*/
_initDialog: function ()
var $dialog = $(this.dialogContainerTmpl());
$dialog.modal(
'type': 'slide',
title: $.mage.__('Image Detail'),
buttons: [],
/** @inheritdoc */
opened: function ()
$dialog.trigger('open');
,
/** @inheritdoc */
closed: function ()
$dialog.trigger('close');
);
$dialog.on('open', this.onDialogOpen.bind(this));
$dialog.on('close', function ()
var $imageContainer = $dialog.data('imageContainer');
$imageContainer.removeClass('active');
$dialog.find('#hide-from-product-page').remove();
);
$dialog.on('change', '[data-role=type-selector]', function ()
var parent = $(this).closest('.item'),
selectedClass = 'selected';
parent.toggleClass(selectedClass, $(this).prop('checked'));
);
$dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));
$dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
var imageData = $dialog.data('imageData');
this.element.trigger('updateVisibility',
disabled: $(e.currentTarget).is(':checked'),
imageData: imageData
);
, this));
$dialog.on('change', '[data-role="image-description"]', function (e)
var target = $(e.target),
targetName = target.attr('name'),
desc = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);
imageData.label = desc;
imageData['label_default'] = desc;
this.element.trigger('updateImageTitle',
imageData: imageData
);
.bind(this));
$dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
var target = $(e.target),
targetName = target.attr('name'),
tirePriceQty = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
, this));
this.$dialog = $dialog;
);
return $.mage.productGallery;
);
Also added popup code into .phtml file.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
)
var contactOptions =
type: 'popup',
title: $.mage.__('Contact Us'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
$("#ContactUsModal").on('click',function()
$("#contact-popup-mpdal").modal("openModal");
);
var pricePromiseOptions =
type: 'popup',
title: $.mage.__('Price Match Promise Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
$("#price_promise").on('click',function()
$("#price-promise-popup-mpdal").modal("openModal");
);
var privacyPolicyOptions =
type: 'popup',
title: $.mage.__('Privacy Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
$("#privacy_policy").on('click',function()
$("#privacy-policy-popup-mpdal").modal("openModal");
);
var cookiesPolicyOptions =
type: 'popup',
title: $.mage.__('Cookie Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
$("#cookies_policy").on('click',function()
$("#cookie-policy-popup-mpdal").modal("openModal");
);
var termsConditionOptions =
type: 'popup',
title: $.mage.__('Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
$("#TermsCondiModal").on('click',function()
$("#terms-condition-popup-mpdal").modal("openModal");
);
);
</script>
Another popup code as below.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal',
'mage/validation'
],
function(
$,
modal
)
jQuery(document).ready(function()
var options =
type: 'popup',
title: $.mage.__('All Reviews'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var popup = modal(options, $('#list-review-popup-mpdal'));
jQuery("#ListReview").on('click',function()
jQuery("#list-review-popup-mpdal").modal("openModal");
);
var reviewFormOptions =
type: 'popup',
title: $.mage.__('Write a Review'),
responsive: true,
innerScroll: true,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
jQuery("#SubmitReview").on('click',function()
jQuery("#submit-review-popup-mpdal").modal("openModal");
);
var dataForm = $('#review-form');
dataForm.mage('validation', );
jQuery('body').on('click', '#review-form .action.submit', function(e)
e.preventDefault();
e.stopImmediatePropagation();
if(dataForm.validation('isValid'))
jQuery.ajax(
type: 'post',
url: jQuery('#review-form').attr('action'),
data: jQuery('#review-form').serialize(),
cache: false,
showLoader: 'true',
success: function(response)
var message = response.message;
if(response.success)
jQuery('#feedback_review').removeClass('error-msg');
jQuery('#feedback_review').addClass('Succ-msg');
else
jQuery('#feedback_review').removeClass('Succ-msg');
jQuery('#feedback_review').addClass('error-msg');
jQuery('#feedback_review').html(message).show();
);
return false;
);
);
);
</script>
Is there any issue related to popups?
Please help to resolve issue.
jquery magento2.3.0 modal-popup requirejs-config.js console
add a comment |
I got below error randomly in front-end and when all modal popup not working when below error occurs.
Uncaught TypeError: Cannot read property 'version' of undefined
I have override admin product-gallery.js and its working fine.
requirejs-config.js
var config =
config:
mixins:
'Magento_Catalog/js/product-gallery':
'Hs_Mageenhancement/js/product-gallery-mixin': true
;
Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js
define([
'jquery',
'underscore',
'mage/template',
'uiRegistry'
], function($, _, mageTemplate, registry)
'use strict';
return function (widget)
$.widget('mage.productGallery', widget,
/**
* Initializes dialog element.
*/
_initDialog: function ()
var $dialog = $(this.dialogContainerTmpl());
$dialog.modal(
'type': 'slide',
title: $.mage.__('Image Detail'),
buttons: [],
/** @inheritdoc */
opened: function ()
$dialog.trigger('open');
,
/** @inheritdoc */
closed: function ()
$dialog.trigger('close');
);
$dialog.on('open', this.onDialogOpen.bind(this));
$dialog.on('close', function ()
var $imageContainer = $dialog.data('imageContainer');
$imageContainer.removeClass('active');
$dialog.find('#hide-from-product-page').remove();
);
$dialog.on('change', '[data-role=type-selector]', function ()
var parent = $(this).closest('.item'),
selectedClass = 'selected';
parent.toggleClass(selectedClass, $(this).prop('checked'));
);
$dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));
$dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
var imageData = $dialog.data('imageData');
this.element.trigger('updateVisibility',
disabled: $(e.currentTarget).is(':checked'),
imageData: imageData
);
, this));
$dialog.on('change', '[data-role="image-description"]', function (e)
var target = $(e.target),
targetName = target.attr('name'),
desc = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);
imageData.label = desc;
imageData['label_default'] = desc;
this.element.trigger('updateImageTitle',
imageData: imageData
);
.bind(this));
$dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
var target = $(e.target),
targetName = target.attr('name'),
tirePriceQty = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
, this));
this.$dialog = $dialog;
);
return $.mage.productGallery;
);
Also added popup code into .phtml file.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
)
var contactOptions =
type: 'popup',
title: $.mage.__('Contact Us'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
$("#ContactUsModal").on('click',function()
$("#contact-popup-mpdal").modal("openModal");
);
var pricePromiseOptions =
type: 'popup',
title: $.mage.__('Price Match Promise Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
$("#price_promise").on('click',function()
$("#price-promise-popup-mpdal").modal("openModal");
);
var privacyPolicyOptions =
type: 'popup',
title: $.mage.__('Privacy Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
$("#privacy_policy").on('click',function()
$("#privacy-policy-popup-mpdal").modal("openModal");
);
var cookiesPolicyOptions =
type: 'popup',
title: $.mage.__('Cookie Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
$("#cookies_policy").on('click',function()
$("#cookie-policy-popup-mpdal").modal("openModal");
);
var termsConditionOptions =
type: 'popup',
title: $.mage.__('Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
$("#TermsCondiModal").on('click',function()
$("#terms-condition-popup-mpdal").modal("openModal");
);
);
</script>
Another popup code as below.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal',
'mage/validation'
],
function(
$,
modal
)
jQuery(document).ready(function()
var options =
type: 'popup',
title: $.mage.__('All Reviews'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var popup = modal(options, $('#list-review-popup-mpdal'));
jQuery("#ListReview").on('click',function()
jQuery("#list-review-popup-mpdal").modal("openModal");
);
var reviewFormOptions =
type: 'popup',
title: $.mage.__('Write a Review'),
responsive: true,
innerScroll: true,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
jQuery("#SubmitReview").on('click',function()
jQuery("#submit-review-popup-mpdal").modal("openModal");
);
var dataForm = $('#review-form');
dataForm.mage('validation', );
jQuery('body').on('click', '#review-form .action.submit', function(e)
e.preventDefault();
e.stopImmediatePropagation();
if(dataForm.validation('isValid'))
jQuery.ajax(
type: 'post',
url: jQuery('#review-form').attr('action'),
data: jQuery('#review-form').serialize(),
cache: false,
showLoader: 'true',
success: function(response)
var message = response.message;
if(response.success)
jQuery('#feedback_review').removeClass('error-msg');
jQuery('#feedback_review').addClass('Succ-msg');
else
jQuery('#feedback_review').removeClass('Succ-msg');
jQuery('#feedback_review').addClass('error-msg');
jQuery('#feedback_review').html(message).show();
);
return false;
);
);
);
</script>
Is there any issue related to popups?
Please help to resolve issue.
jquery magento2.3.0 modal-popup requirejs-config.js console
I got below error randomly in front-end and when all modal popup not working when below error occurs.
Uncaught TypeError: Cannot read property 'version' of undefined
I have override admin product-gallery.js and its working fine.
requirejs-config.js
var config =
config:
mixins:
'Magento_Catalog/js/product-gallery':
'Hs_Mageenhancement/js/product-gallery-mixin': true
;
Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js
define([
'jquery',
'underscore',
'mage/template',
'uiRegistry'
], function($, _, mageTemplate, registry)
'use strict';
return function (widget)
$.widget('mage.productGallery', widget,
/**
* Initializes dialog element.
*/
_initDialog: function ()
var $dialog = $(this.dialogContainerTmpl());
$dialog.modal(
'type': 'slide',
title: $.mage.__('Image Detail'),
buttons: [],
/** @inheritdoc */
opened: function ()
$dialog.trigger('open');
,
/** @inheritdoc */
closed: function ()
$dialog.trigger('close');
);
$dialog.on('open', this.onDialogOpen.bind(this));
$dialog.on('close', function ()
var $imageContainer = $dialog.data('imageContainer');
$imageContainer.removeClass('active');
$dialog.find('#hide-from-product-page').remove();
);
$dialog.on('change', '[data-role=type-selector]', function ()
var parent = $(this).closest('.item'),
selectedClass = 'selected';
parent.toggleClass(selectedClass, $(this).prop('checked'));
);
$dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));
$dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
var imageData = $dialog.data('imageData');
this.element.trigger('updateVisibility',
disabled: $(e.currentTarget).is(':checked'),
imageData: imageData
);
, this));
$dialog.on('change', '[data-role="image-description"]', function (e)
var target = $(e.target),
targetName = target.attr('name'),
desc = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);
imageData.label = desc;
imageData['label_default'] = desc;
this.element.trigger('updateImageTitle',
imageData: imageData
);
.bind(this));
$dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
var target = $(e.target),
targetName = target.attr('name'),
tirePriceQty = target.val(),
imageData = $dialog.data('imageData');
this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
, this));
this.$dialog = $dialog;
);
return $.mage.productGallery;
);
Also added popup code into .phtml file.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
)
var contactOptions =
type: 'popup',
title: $.mage.__('Contact Us'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
$("#ContactUsModal").on('click',function()
$("#contact-popup-mpdal").modal("openModal");
);
var pricePromiseOptions =
type: 'popup',
title: $.mage.__('Price Match Promise Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
$("#price_promise").on('click',function()
$("#price-promise-popup-mpdal").modal("openModal");
);
var privacyPolicyOptions =
type: 'popup',
title: $.mage.__('Privacy Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
$("#privacy_policy").on('click',function()
$("#privacy-policy-popup-mpdal").modal("openModal");
);
var cookiesPolicyOptions =
type: 'popup',
title: $.mage.__('Cookie Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
$("#cookies_policy").on('click',function()
$("#cookie-policy-popup-mpdal").modal("openModal");
);
var termsConditionOptions =
type: 'popup',
title: $.mage.__('Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
$("#TermsCondiModal").on('click',function()
$("#terms-condition-popup-mpdal").modal("openModal");
);
);
</script>
Another popup code as below.
<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal',
'mage/validation'
],
function(
$,
modal
)
jQuery(document).ready(function()
var options =
type: 'popup',
title: $.mage.__('All Reviews'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var popup = modal(options, $('#list-review-popup-mpdal'));
jQuery("#ListReview").on('click',function()
jQuery("#list-review-popup-mpdal").modal("openModal");
);
var reviewFormOptions =
type: 'popup',
title: $.mage.__('Write a Review'),
responsive: true,
innerScroll: true,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();
]
;
var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
jQuery("#SubmitReview").on('click',function()
jQuery("#submit-review-popup-mpdal").modal("openModal");
);
var dataForm = $('#review-form');
dataForm.mage('validation', );
jQuery('body').on('click', '#review-form .action.submit', function(e)
e.preventDefault();
e.stopImmediatePropagation();
if(dataForm.validation('isValid'))
jQuery.ajax(
type: 'post',
url: jQuery('#review-form').attr('action'),
data: jQuery('#review-form').serialize(),
cache: false,
showLoader: 'true',
success: function(response)
var message = response.message;
if(response.success)
jQuery('#feedback_review').removeClass('error-msg');
jQuery('#feedback_review').addClass('Succ-msg');
else
jQuery('#feedback_review').removeClass('Succ-msg');
jQuery('#feedback_review').addClass('error-msg');
jQuery('#feedback_review').html(message).show();
);
return false;
);
);
);
</script>
Is there any issue related to popups?
Please help to resolve issue.
jquery magento2.3.0 modal-popup requirejs-config.js console
jquery magento2.3.0 modal-popup requirejs-config.js console
asked 42 mins ago
Hiren ShahHiren Shah
4719
4719
add a comment |
add a comment |
0
active
oldest
votes
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%2f266592%2fmagento-2-uncaught-typeerror-cannot-read-property-version-of-undefined%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f266592%2fmagento-2-uncaught-typeerror-cannot-read-property-version-of-undefined%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