Shopify themes, liquid, logos, and UX
Hi,
I would like to know if there is any app or solution that can print the items in the cart into a table format, or export/save the cart as PDF or CSV?
Your help is really appreciated.
Thanks,
Azie
To export your cart data as a CSV file, you can use a simple JavaScript solution. This works by grabbing the contents of the cart using Shopify's fetch API, then formatting that data into a CSV file that you can download. It's straightforward to set up and will allow customers to save their cart in CSV format.
If this fixed your issue, likes and accepting as a solution are highly appreciated
| Build an online presence with our custom-built Shopify Theme: EcomifyTheme
| Check out our reviews: Trustpilot Reviews
| We are Shopify Partners: EcomGraduates Shopify Partner
example
function exportCartToCSV() {
fetch('/cart.js')
.then(response => response.json())
.then(cart => {
let csvContent = "data:text/csv;charset=utf-8,Product Name,Quantity,Price\n";
cart.items.forEach(item => {
csvContent += `${item.title},${item.quantity},${item.price / 100}\n`;
});
let encodedUri = encodeURI(csvContent);
let link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "cart.csv");
document.body.appendChild(link);
link.click();
});
}
If this fixed your issue, likes and accepting as a solution are highly appreciated
| Build an online presence with our custom-built Shopify Theme: EcomifyTheme
| Check out our reviews: Trustpilot Reviews
| We are Shopify Partners: EcomGraduates Shopify Partner
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024