How to disabhle the modal when changing the layout?
D
Danny de Kruijk
started a topic
over 3 years ago
I use MSCP to change the layout of the product. Each time, there is a modal to confirm to replace all the elements. I can't find to disable the specific modal, only the modal for 'swapping products' can be disabled, but this doesn't affect the layout change.
Is there a way to disable the 'layout' change modal?
Thanks!
Best Answer
D
Danny de Kruijk
said
over 3 years ago
Found and changed it in the JS eventually. It's a little bit nasty, so a toggle in an update would be nice :) For anyone with the same issue, change the code to the following in the FancyProductDesigner-all.js. Don't forget to minify it after and replace the .min version on the server!
$scrollArea.on('click', '.fpd-item', function() {
if(fpdInstance.productCreated) {
var $confirm = true,
layoutIndex = $scrollArea.find('.fpd-item').index($(this));
_layoutElementLoadingIndex = 0;
var $viewInstance = $(fpdInstance.currentViewInstance);
_totalLayoutElements = currentLayouts[layoutIndex].elements.length;
fpdInstance.globalCustomElements = [];
if(fpdInstance.mainOptions.replaceInitialElements) {
fpdInstance.globalCustomElements = fpdInstance.getCustomElements();
}
$viewInstance.on('beforeElementAdd', _loadingLayoutElement);
fpdInstance.toggleSpinner(true);
fpdInstance.currentViewInstance.loadElements(currentLayouts[layoutIndex].elements, function() {
fpdInstance.toggleSpinner(false);
$viewInstance.off('beforeElementAdd', _loadingLayoutElement);
/**
* Gets fired when a all elements of layout are added.
*
* @event FancyProductDesigner#productAdd
* @param {Event} event
* @param {Array} elements - Added elements.
*/
fpdInstance.$container.trigger('layoutElementsAdded', [currentLayouts[layoutIndex].elements]);
});
fpdInstance.$viewSelectionWrapper.find('.fpd-item').eq(fpdInstance.currentViewIndex).children('picture').css('background-image', 'url('+currentLayouts[layoutIndex].thumbnail+')');
}
});
};
_initialize();
};
Found and changed it in the JS eventually. It's a little bit nasty, so a toggle in an update would be nice :) For anyone with the same issue, change the code to the following in the FancyProductDesigner-all.js. Don't forget to minify it after and replace the .min version on the server!
$scrollArea.on('click', '.fpd-item', function() {
if(fpdInstance.productCreated) {
var $confirm = true,
layoutIndex = $scrollArea.find('.fpd-item').index($(this));
_layoutElementLoadingIndex = 0;
var $viewInstance = $(fpdInstance.currentViewInstance);
_totalLayoutElements = currentLayouts[layoutIndex].elements.length;
fpdInstance.globalCustomElements = [];
if(fpdInstance.mainOptions.replaceInitialElements) {
fpdInstance.globalCustomElements = fpdInstance.getCustomElements();
}
$viewInstance.on('beforeElementAdd', _loadingLayoutElement);
fpdInstance.toggleSpinner(true);
fpdInstance.currentViewInstance.loadElements(currentLayouts[layoutIndex].elements, function() {
fpdInstance.toggleSpinner(false);
$viewInstance.off('beforeElementAdd', _loadingLayoutElement);
/**
* Gets fired when a all elements of layout are added.
*
* @event FancyProductDesigner#productAdd
* @param {Event} event
* @param {Array} elements - Added elements.
*/
fpdInstance.$container.trigger('layoutElementsAdded', [currentLayouts[layoutIndex].elements]);
});
fpdInstance.$viewSelectionWrapper.find('.fpd-item').eq(fpdInstance.currentViewIndex).children('picture').css('background-image', 'url('+currentLayouts[layoutIndex].thumbnail+')');
}
});
};
_initialize();
};
R
Rhiannon Doyle
said
over 3 years ago
Thanks for sharing Danny!
Little reminder to anyone who customises the core... you'll need to do this every time you update the plugin.
M
Miran
said
about 2 years ago
Please include option in settings to disable confirmation popup on changing layouts.
Thank you.
D
Dimitris Mourtzis
said
about 2 months ago
I am trying to do the same thing but I cannot find what to replace.
Does this still work with current version of the plugin?
Danny de Kruijk
I use MSCP to change the layout of the product. Each time, there is a modal to confirm to replace all the elements. I can't find to disable the specific modal, only the modal for 'swapping products' can be disabled, but this doesn't affect the layout change.
Is there a way to disable the 'layout' change modal?
Thanks!
Found and changed it in the JS eventually. It's a little bit nasty, so a toggle in an update would be nice :)
For anyone with the same issue, change the code to the following in the FancyProductDesigner-all.js. Don't forget to minify it after and replace the .min version on the server!
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstDanny de Kruijk
Found and changed it in the JS eventually. It's a little bit nasty, so a toggle in an update would be nice :)
For anyone with the same issue, change the code to the following in the FancyProductDesigner-all.js. Don't forget to minify it after and replace the .min version on the server!
Rhiannon Doyle
Thanks for sharing Danny!
Little reminder to anyone who customises the core... you'll need to do this every time you update the plugin.
Miran
Please include option in settings to disable confirmation popup on changing layouts.
Thank you.
Dimitris Mourtzis
I am trying to do the same thing but I cannot find what to replace.
Does this still work with current version of the plugin?
-
Adding Fancy Products to Categories
-
Shortcode for specfic product designer
-
What theme is recommended to use with FPD ?
-
Exclude Image from export
-
Google Font Family adds extras
-
Floating Dialog box
-
Uploadzone not working
-
Image transparency like in T-shirt demo
-
How do I get clipart
-
What does the LOAD button do / what is it for?
See all 2208 topics