A solution to the new step in design choices

Posted almost 8 years ago by Jeremy Aaron Horland

Post a topic
Answered
J
Jeremy Aaron Horland

Previously, when we added a design choice to our designs, the choice window would close itself.  This was helpful for "simple" products, as we need to reduce clicks and steps to get more people to the finish line (ORDERS!)


Recently, an "x" was added, and for more complex or multiple designs it makes total sense.


For the rest of us, instead of a "request"  I am putting up a solution.


Add this to your favorite page footer script plugin, or even right into your code, and the click-to-choose-and-close behavior is back : 


 

<script type='text/javascript'>
jQuery( document ).ready(function() {
		
		setTimeout(function(){
		
			while (!jQuery( "div.fpd-view-stage").length ) {
				sleep(10);
			}
			
			//PUT YOUR JAVASCRIPT HERE
			
			jQuery("div.fpd-item picture").click(
				function() {
					setTimeout(function(){
						jQuery("div.fpd-close-stage-off-canvas span.fpd-icon-close").click();
					}, 20);
				}
			);		
			
		}, 10);

});
</script>

 

0 Votes

D

Deleted Agent posted almost 8 years ago Best Answer

thanks

0 Votes


5 Comments

Sorted by
R

R. Blasche posted over 7 years ago

 Big thumbs up!


Here is a little code update:

fancyProductDesigner.$container.on('elementAdd', function() { $('div.fpd-close-dialog span.fpd-icon-close').trigger('click'); });

 

 

0 Votes

B

Becker Enterprises posted over 7 years ago

Sorry, just found the events *facepalm* so this solution will work for any elements not just designs.

Add the following after Initialization where 'product-designer' is the ID of your designer:

$('#product-designer').on('elementAdd', function() { $('div.fpd-close-dialog span.fpd-icon-close').trigger('click'); });

 

0 Votes

B

Becker Enterprises posted over 7 years ago

Thanks, had the same problem but the solution is, somewhat strange :p


Just add the following anywhere for designs:

$(document).on('click', 'div[data-module="designs"] picture', function()
{
	$('div.fpd-close-dialog span.fpd-icon-close').trigger('click');
});

 

0 Votes

A

Ariana Falerni posted over 7 years ago

Thank you, I'm really surprised that closing isn't the default behavior!

0 Votes

D

Deleted Agent posted almost 8 years ago Answer

thanks

0 Votes

Login or Sign up to post a comment