Shoplazza
申请钱海时增加支付图标
Section titled “申请钱海时增加支付图标”<script type = "text/javascript"> try { const logoSnippets = document.createElement("div"); logoSnippets.id = "shoplaza-section-footer-logo"; document.getElementById("shoplaza-section-footer").appendChild(logoSnippets); document.getElementById('shoplaza-section-footer-logo').innerHTML = '<div style="white-space:normal;text-align:center;" class="footer bg-footer footer_container tw-bg-footer-bg tw-bg-footer"><!-- Visa --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/0244f114b3afad4d9b0fe22f54dbb837_180x.png"><!-- Mastercard --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/431cf474360ec26f50e453910d747622_180x.png"><!-- Maestro --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/ea127d2967d52ee7106f1d862a4be2aa_180x.png"><!-- Visa Electron --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/9042ff8fe121c2fe80df22b3a4e38c67_180x.png"><!-- JCB --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/2d9a48ae30ea532451ce4c54825d5dfe_180x.png"><!-- American Express --><img style="height:24px;margin:4px;" src="https://cdn.shoplazza.com/ee0414210cf3495b1abf7137cffe680d.png"><!-- Carte Bancaire --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/8c7d570994064c8066658bc0edba5366_180x.png"><!-- Diners Club --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/47c5b22ec39fb82d220efef0c301e8cd_180x.png"><!-- Discover --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/7b913163091dc227b0d4b946be32b704_180x.png"><!-- UnionPay --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/1b2b030090fdac882511e286a570ba0e_180x.png"><!-- PayPal --><img style="height:24px;margin:4px;" src="https://img.shoplazza.com/oss/operation/a0a058baaeef16e88f6bd2ee36c03f6f_180x.png"> <!-- Klarna --><img style="height:24px;margin:4px;" src="https://cnres.appracle.com/1c2927e0f5a159190622f2d75dd7c2c0.jpeg"></div>'; } catch(e){ }</script>删除“from”
Section titled “删除“from””<style> .product-snippet__price { font-size: 0; } .product-snippet__price > * { font-size: 1.2rem; color: #e74c3c; }</style>隐藏占位空白图
Section titled “隐藏占位空白图”<style> .i-spzhtml-intrinsic-sizer.i-spzhtml-element.i-spzhtml-layout-intrinsic.i-spzhtml-layout-size-defined.i-spzhtml-built.i-spzhtml-layout img.i-spzhtml-fill-content.i-spzhtml-replaced-content { display: none !important; }</style>隐藏多余横线
Section titled “隐藏多余横线”<style> .product-desc-container > section::before { display: none !important; }</style>隐藏多余栏目
Section titled “隐藏多余栏目”<script> document.addEventListener("DOMContentLoaded", function () { const selector = ".product-desc-item-header.flex.items-center.justify-between"; const elements = document.querySelectorAll(selector); if (elements.length > 1) { for (let i = 1; i < elements.length; i++) { const currentElement = elements[i]; const h3Elements = currentElement.querySelectorAll("h3"); if (h3Elements.length === 0) { currentElement.parentNode.removeChild(currentElement); break; } let hasDescriptionH3 = false; for (const h3 of h3Elements) { if ( h3.textContent.trim() === "Description" || h3.textContent.trim() === "描述" || h3.textContent.trim() === "Descripción" || h3.textContent.trim() === "Descrizione" || h3.textContent.trim() === "Beschreibung" ) { hasDescriptionH3 = true; break; } } if (!hasDescriptionH3) { let nextSibling = currentElement.nextElementSibling; while (nextSibling) { nextSibling.parentNode.removeChild(nextSibling); nextSibling = nextSibling.nextElementSibling; } } currentElement.parentNode.removeChild(currentElement); } } });</script>
<style> .product-desc-item-header.flex.items-center.justify-between + .product-desc-item-content.mce-content * { padding: 0; } .product-desc-item-header.flex.items-center.justify-between + .product-desc-item-content.mce-content .product-desc-container > section::before { display: none !important; }</style>spz-img
Section titled “spz-img”<script> // 当页面DOM内容加载完成后执行 document.addEventListener("DOMContentLoaded", function () { try { // 定义要查找的选择器列表 const selectors = [ ".product-desc-item-content.mce-content p strong>spz-img", ".product-desc-item-content.mce-content div>spz-img", ".product-desc-item-content.mce-content p>spz-img", ]; // 遍历每个选择器 selectors.forEach((selector) => { // 查找所有匹配的元素 const spzImgs = document.querySelectorAll(selector); // 对每个找到的元素执行替换操作 spzImgs.forEach((spzImg) => { replaceSpzImg(spzImg); }); }); // 替换函数定义 function replaceSpzImg(spzImg) { // 获取原始图片路径 const src = spzImg.getAttribute("src"); // 如果路径无效则跳过 if (!src || src === "null") return; // 创建新的标准img元素 const img = document.createElement("img"); img.src = src; // 要复制的属性列表 const attributes = ["width", "height", "alt", "class", "id", "title"]; // 复制所有属性 attributes.forEach((attr) => { const value = spzImg.getAttribute(attr); if (value) img.setAttribute(attr, value); }); // 设置图片样式 Object.assign(img.style, { maxWidth: "100%", // 最大宽度为容器宽度 height: "auto", // 高度自适应保持比例 display: "block", // 块级显示 }); // 用新图片替换旧元素 spzImg.parentNode.replaceChild(img, spzImg); } } catch (e) { // 错误处理 console.error("error:", e); } });</script>