• Resolved Robert Trevellyan

    (@trevellyan)


    I’m seeing a problem with dkeys in saved variations when using the modal product details code snippet. For an example, see any of the items on http://singermanpost.com/product-cat/dangle-earrings/page/4/

    In each case, there’s a saved variation for “ear wires” that appears correctly if you strip the “modal=true” parameter from the URL. However, in the modal, it only appears if you change the first option from earrings to necklace and back to earrings.

    At first glance it looks like the solution is too hook the onComplete colorBox callback to something like this:

    $("form.foxyshop_product").each(function() {
    		updateVariations($(this));
    	});

    and I’ve tried to do that on the page linked above, but I’m not having any luck (I get updateVariations is not defined errors in the console).

    Any chance of a pointer in the right direction?

    https://wordpress.org/plugins/foxyshop/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author sparkweb

    (@sparkweb)

    Hmmm. Nothing comes to mind at the moment. If you are getting updateVariations is not defined it sounds like it might not be loaded yet. Make sure that it’s queued to only be fired after everything is loaded. Make sure that updateVariations is loaded when this tries to run.

    Thread Starter Robert Trevellyan

    (@trevellyan)

    Here’s my code from the single category page. The fastIframe:false is supposed to delay the onComplete event “until iframe’s content has completely loaded.”

    <script type="text/javascript">
    jQuery(".foxyshop_product_list .foxyshop_product_box a").each(function() {
    	jQuery(this).attr("href", jQuery(this).attr("href") + "?modal=true");
    });
    jQuery(".foxyshop_product_list .foxyshop_product_box a").colorbox({
    	close:"⇐ Continue Shopping",
    	maxWidth: "100%",
    	fastIframe: false,
    	onComplete: function() {
    		jQuery("form.foxyshop_product").each(function() {
    			updateVariations(jQuery(this));
    		});
    	}
    });
    jQuery("form.foxyshop_product").submit(function() {
    	jQuery.colorbox.close();
    });
    </script>

    Thread Starter Robert Trevellyan

    (@trevellyan)

    I was finally able to fix this by changing this line
    updateVariations(jQuery(this));
    to this
    jQuery(this).change();

    Plugin Author sparkweb

    (@sparkweb)

    Glad you got it figured out. Thanks for posting back.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘help with dkey saved variations in modal product details’ is closed to new replies.