Hi @emoteek,
There are a few ways to go about this. 15k is a substantial number of products.
To address the concern about multiple tabs – Yes, the tabs are stored as a list, so adding one tab requires you to write it in your spreadsheet as a list containing one element.
You could theoretically use the same strategy to create a field that just stores a URL, which you then use PHP to format as the content of the single tab and store that as product meta. It would be significantly less complicated to edit on the spreadsheet side of things, but if you needed to add more than one tab, it would require using both strategies in tandem and being careful not to overwrite one another. This strategy also only works if the files are already hosted somewhere and you are just providing a link to them.
Alternatively, if you need to host the files on the WordPress server, you could add a meta field that stores a file upload. You could then use the WooCommerce “edit tabs” hook to check that meta field and append a tab with markup containing a link. This requires a bit less work on the WordPress side, but the issue of uploading PDF’s for 15k products would need to be solved separately.
There’s also the hybrid approach of 1. create a meta field storing the URL of the PDF, 2. add a column to your spreadsheet containing the URL, 3. use that “edit tabs” hook to add a tab with a link to the URL.
I’d use that last option if possible.
Let me know if that helps,
Jon
Hi @jpowersdev
I’m not sure to understand something. On the hybrid approach, adding a column to my excell file with the URL I need is not a big deal, but on the third step you mean to get on this page :” https://snipboard.io/Zl1cSJ.jpg ” and add a link to the URL, but I would have to do it for all 15k products manually again. That won’t solve my problem right? Or maybe I misunderstood something?
The objective here is to have an example as how I could modify my excell file to add a column that would eventually create + add content to each products. Even if that column would be complicated we can manage it with excell.
Hi @emoteek,
The hybrid approach I suggested would not involve the use of our plugin, you’d be doing that in PHP. You’d add a function to your functions.php file which would use the WooCommerce tabs filter to insert a tab, and that tab would contain the markup and URL coming from your spreadsheet (stored on your product as a meta field). The tabs filter / “edit tabs” hook is documented here: https://woocommerce.com/document/editing-product-data-tabs/#section-5
Let me know if that makes more sense,
Jon
Plugin Contributor
Tracy Levesque
(@liljimmi)
🏳️🌈 YIKES, Inc. Co-Owner
Hello @emoteek,
Just checking in.
Please let us know if you still need help with this issue.
Thank you!
-Tracy
Hello,
I had other urgent problems to solve sorry for the delay in response.
Here the part that I do not understand is how to make the link between a created tab and a product x.
If I understand correctly, we create a tab in PHP. But then in the csv file that I use to import my data how can I make the link?