Created
May 30, 2023 16:55
-
-
Save opencarlos/1a1d3cff888c84b41007eb68f17ab86a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:function lineItem(e,n){e.forEach((e=>{line=e.querySelector(".Polaris-Link_yj5sy"),line&&(query=line.getAttribute("href"),lineCont=e,querySplit=query.split("/"),pID=querySplit[3],varID=querySplit[5],fetch(`${n}/admin/api/2022-04/variants/${varID}.json`).then((e=>e.json())).then((n=>{datacont=document.createElement("table"),datacont.innerHTML=`<table align="left">\n <th align="center" style="border-bottom: 1px solid #e1e3e5">\n Inventory Qty\n </th>\n <th align="center" style="border-bottom: 1px solid #e1e3e5">\n Inventory Policy\n </th>\n <th align="center" style="border-bottom: 1px solid #e1e3e5">\n Inventory Tracker\n </th>\n </tr>\n <tr >\n <td align="center" style="padding: .5rem 0">\n <span style="background-color:#91e0d6;padding:3px;border-radius:.5rem">${n.variant.inventory_quantity}</span>\n </td>\n <td align="center" style="padding: .5rem 0">\n <span style="background-color:#91e0d6;padding:3px;border-radius:.5rem">${n.variant.inventory_policy}</span>\n </td>\n <td align="center" style="padding: .5rem 0">\n <span style="background-color:#91e0d6;padding:3px;border-radius:.5rem">${n.variant.inventory_management}</span>\n </td>\n </tr>%60,datacont.style.border="1px #e1e3e5 solid",datacont.style.borderRadius="1em",datacont.style.padding=".5em",datacont.style.width="100%",e.append(datacont)})))}))}lineItem(document.querySelectorAll(".Polaris-LegacyCard__Section_1b1h1 ul > li"),window.location.origin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment