get_downloads() returns null for guests
-
When dumping the $product->get_downloads on a product page i see the download files with there details in the array:
array(1) { ["d1f74fd5-7013-48d9-8408-b0e41e782561"]=> object(WC_Product_Download)#4076 (1) { ["data":protected]=> array(3) { ["id"]=> string(36) "d1f73455-7013-48d9-8408-b0e41e782561" ["name"]=> string(35) "Como Tomar Una Buena Decision (PDF)" ["file"]=> string(102) "example.com/wp-content/uploads/woocommerce_uploads/2019/02/mypdf.pdf" } } }
But when i see it as a guest it returns empty:
array(0) { }
I checked and i don’t see any restrictions defined in woo commerce for non logged users.
Why is it acting like that?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_downloads() returns null for guests’ is closed to new replies.