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
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024