0

I need help with this: I need that the url of the downloadable products link with an external url. I´m trying to add a custom field and replace the filters woocommerce_product_file and woocommerce_product_file_download_path but it didn't worked, I think because I can´t call to the product data from the order. Someone did this? Thank you for your help!

The code doesn't works. Now is something like:

*function mostrar_campo_personalizado_en_order($file_id){ global $wpdb, $woocommerce;

echo get_post_meta($file_id, 'downloadable_url', true);
}

add_filter( 'woocommerce_product_file', 'mostrar_campo_personalizado_en_order', 10, 1 ); add_filter( 'woocommerce_product_file_download_path', 'mostrar_campo_personalizado_en_order', 10, 1 );*

I don´t know if I´m working in the correct way, I need to change the url of the downloadable products because woocommerce internally routed. Because I couldn't modify him, I intente removal and display a custom post field. The page is in a test server because the site is on line. The url of the tester server ishttp://lab.jus.raffles.com.ar/my-account/ but you need credential to come in: user: paula pass: 5VPeGgAHWzYX1T

  • can u plz put the code. and What u need with Exmple. – Dev Danidhariya May 25 '15 at 10:43
  • Here I extended the question with some code and the url – paula andriole May 25 '15 at 11:56
  • Dear @paula-andriole. i am not undustend what u need.? u need downloadable_url.?? – Dev Danidhariya May 25 '15 at 12:05
  • Look at the site, now I've deactivated my own filter and it works normally. When you come in an order or in "my downloads" the application displays the name and the url of the download (in this case are epubs). Woocommerce stored by default this files in his own database and displays this url. In the site I´m working, files are stored in an external server and must display this url. Sorry for my english, I expect you understand me. Thank you very much! – paula andriole May 25 '15 at 17:36
  • Hey, someone tried to do this or know how το display custom fields in the order page? I Think if can display them I can resolved this issue – paula andriole May 26 '15 at 20:20
  • Dear @paula andriole read this [link]http://docs.woothemes.com/document/woocommerce-admin-custom-order-fields/ How to add custome fields. how to use read this [link]http://stackoverflow.com/questions/12958193/show-custom-field-on-order-in-woocommerce – Dev Danidhariya May 27 '15 at 05:04
  • Also try this. id, 'custom-field-name', true ); ?> – Dev Danidhariya May 27 '15 at 05:07
  • Thank you very much Dev for your answers. I´m going read with attention those articles. Meantime I probed the code you sent me. First it responded $order is un undefined variable then I added $order = wc_get_order( $order_id ); Responded: Trying to get property of non-object in.... I follow working, if you have other idea please tell me,your are helping me a lot.... – paula andriole May 28 '15 at 18:27
  • $order_id is ur product id. – Dev Danidhariya May 29 '15 at 12:34
  • Hello Dev, I read the articles but none explains how to display products's custom fields out of the loop. In one case explains how to display checkout's custom fields and the other is for add a custom field in the order, but in this case I need to display a product's custom field, I need that when displays the product name and the quantity displays this field. Thank you! – paula andriole May 29 '15 at 15:40

0 Answers0