Woocommerce product download URL

Question

I’m making a skin for The Grid plugin (https://theme-one.com/docs/the-grid/#developer_guide).

All the products are virtual and downloadable — I’ve managed to make an add to cart function, but need to download products instantly too. Is there a meta key for the file url (combed the database and couldn’t spot one) or a way to get it?

Currently I’ve got something that just returns an array:

$output .= '<p><a href="' . $tg_el->get_item_meta('_downloadable_files') . '" download target="_blank"><i class="fa fa-download"></i> Download Image</a></p>';

Thought I’d found a possible solution: https://wordpress.stackexchange.com/a/199884/134263 but am not great with php and I’m unsure how to implement it.

Any pointers would be much appreciated!

0
, ellen 2 years 2019-12-31T08:38:41-05:00 0 Answers 111 views 0

Leave an answer

Browse
Browse