Conflict with YITH Amazon S3 Storage for Woocommerce
-
Hello there,
hope you are all well.
we encountered an issue/conflict between SG Optimizer and YITH Amazon S3 Storage for Woocommerce.
Amazon S3 Storage enables storage of Woocommerce DL files on Amazon S3.
Problem occurs as follows:
– SG Optimizers combine JS is enabled
– customer not logged into site
– customer has bought as guest (they do not have an account).
– customer inserts order number and billing email in standard Woocommerce Order tracking page. When clicking on the Download button, the file does not download (Pressing the DL button usually results in a fast redirection from the order tracking page to an html page with the Amazon link back to the tracking page – during which time the download starts.
In this case there is no redirection back and the download does not start.– we tried testing with TwentyTwentyone or Storefront + WC + SG Optimizer
– we tried identifying the ‘culprit js’ by process of elimination from the combined js file as follows (for twentytwentyone theme)add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' ); function js_combine_exclude( $exclude_list ) { $exclude_list[] = 'jquery-blockui'; $exclude_list[] = 'jquery-migrate'; $exclude_list[] = 'js-cookie'; $exclude_list[] = 'wc-add-to-cart-variation'; $exclude_list[] = 'wc-add-to-cart'; $exclude_list[] = 'wc-cart-fragments'; $exclude_list[] = 'woocommerce'; $exclude_list[] = 'woocommerce-no'; $exclude_list[] = 'wp-embed'; $exclude_list[] = 'twenty-twenty-one-responsive-embeds-script'; $exclude_list[] = 'twenty-twenty-one-primary-navigation-script'; $exclude_list[] = 'twenty-twenty-one-ie11-polyfills'; $exclude_list[] = 'twenty-twenty-one-ie11-polyfills-asset'; return $exclude_list; }
the javascript that remains in the combined files are three pieces of inline js we cannot eliminate, specifically:
document.body.classList.remove("no-js");; if ( -1 !== navigator.userAgent.indexOf( 'MSIE' ) || -1 !== navigator.appVersion.indexOf( 'Trident/' ) ) { document.body.classList.add( 'is-IE' ); }; (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })();; /(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1);
Still the issue remains – the downloads become possible only when JS combination is disabled.
– The issue does not occur when the Download is ‘internal / tied to a file that resides on the server’;
– Downloads are set to ‘Force’;
– Also: following the link from the order confirmation email (the same link as on the Order tracking page) results in the file actually being downloaded.
Does this suggest anything to you? I will reach out to the YITH developers, but if it would be helpful to get extra thoughts before I do. Something in the redirection process gets stopped, and I cannot figure what (nor can I get to it by process of elimination).
Thanks for any thoughts you may have about this
Giacomo Bruzzo
The page I need help with: [log in to see the link]
- The topic ‘Conflict with YITH Amazon S3 Storage for Woocommerce’ is closed to new replies.