admin管理员组文章数量:1434380
I have a standard WordPress WooCommerce site, and I recently integrated a three.js landing page with links to the WooCommerce site. To display the animated landing page, I added the .js file and an index.html file to the public_html directory of my site.
However, when I do this, the AJAX "add to cart" functionality and the mini side cart stop working; all other functionality remains intact. The index.html file doesn’t contain any WooCommerce-related code (see below). To debug, I even tested with a completely blank index.html file, and the issue still occurs.
Does anyone know why adding an index.html file would interfere with WooCommerce’s AJAX functionality? Alternatively, is there a better way to incorporate the three.js landing page without using an index.html file?
Index.html file content:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/assets/EveryRep-logo-black-DcJJJvSs.svg" type="image/svg+xml">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EveryRep - Premium Sustainable Athletic Apparel for Fitness Enthusiasts</title>
<meta name="description" content="EveryRep - Premium Sustainable Athletic Apparel for Fitness Enthusiasts" />
<meta name="keywords" content="fitness, athletic apparel, sustainable clothing, ecofriendly, workout clothes, gym wear, yoga pants, running shoes, mens clothing, womens clothing, activewear, outdoor gear, hiking boots">
<meta name="author" content="EveryRep">
<meta name="robots" content="index,follow">
<meta name="google-site-verification" content="Google verification token">
<meta property="og:title" content="EveryRep - Premium Sustainable Athletic Apparel for Fitness Enthusiasts">
<meta property="og:description" content="EveryRep - Premium Sustainable Athletic Apparel for Fitness Enthusiasts">
<meta property="og:image" content="/src/assets/EveryRep-logo-black.svg">
<meta property="og:url" content=";>
<meta property="og:type" content="website">
<script type="module" crossorigin src="/assets/index-DsGnWYTW.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BxLv6ccw.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
I've also tried:
Adding the three.js to a staging site with links to my regular site. Everything works in this scenario but I cannot use this solution as I need everything to share the same base URL
Using an empty index.html file. Even an empty index.html file in the root directory of my live site breaks the add to cart and side mini cart.
本文标签: reactjsIncorporating threejs landing page in Wordpress woocommerce siteStack Overflow
版权声明:本文标题:reactjs - Incorporating three.js landing page in Wordpress woocommerce site - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745607935a2665944.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论