Title: Custom value with PHP
Last modified: May 15, 2024

---

# Custom value with PHP

 *  Resolved [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/)
 * Hello
 * i need to create a custom column with a custom value returned by a custom PHP
   function.
   If i pu my code in your PHP field area, will it work ?thanks
 * function **get_total_installment_to_order**( $order_id ){
   $order    = wc_get_order(
   $order_id );if ( ! $order ) {return 0;}$payment_id = $order->get_meta( ‘_sumo_pp_payment_id’,
   true );if ( ! $payment_id ) {return 0;}$payment = _sumo_pp_get_payment( payment_id);
   if ( ! $payment ) {return 0;}return $payment->get_total_installments();}

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756640)
 * hello
 * follow to [https://docs.algolplus.com/algol_order_export/fields/](https://docs.algolplus.com/algol_order_export/fields/)
 * add key **total_installment**
 * use this code
 * `add_filter('woe_get_order_value_total_installment',function ($value, $order,
   $fieldname) {
   $order = wc_get_order( $order_id );if ( ! $order ) {return 0;}$
   payment_id = $order->get_meta( ‘_sumo_pp_payment_id’, true );if ( ! $payment_id){
   return 0;}$payment = _sumo_pp_get_payment( payment_id );if ( ! $payment ) {return
   0;}return $payment->get_total_installments();},10,3);
 *  Thread Starter [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756651)
 * Hello,
 * thanks will it work too if i export as 1 line = 1 product sold ?
 * and not 1 line = 1 order ?
 * thanks
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756698)
 * open Setup Fields and set “Fill order details” = All rows
 *  Thread Starter [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756715)
 * i don’t undestand hw your progam knows that he have to display the PHP result
   in the column **total_installment**
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756732)
 * please read topic
 * [https://docs.algolplus.com/algol_order_export/hooks-filters/](https://docs.algolplus.com/algol_order_export/hooks-filters/)
 *  Thread Starter [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756739)
 * i have executed but i have this error
 * Le code que vous essayez d’enregistrer a généré une erreur fatale sur la ligne
   13 :**syntax error, unexpected end of file**
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756806)
 * please, visit wordpress.org and copy whole code .
 * And paste code to [https://onlinephp.io/](https://onlinephp.io/) , probably you
   added some non-printable chars
 *  Thread Starter [pipoulito](https://wordpress.org/support/users/pipoulito/)
 * (@pipoulito)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756818)
 * i have added this at the end and it works !
 * thanks
 *  ,10,3);
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756829)
 * You’re welcome

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Custom value with PHP’ is closed to new replies.

 * ![](https://ps.w.org/woo-order-export-lite/assets/icon-256x256.png?rev=1365554)
 * [Advanced Order Export For WooCommerce](https://wordpress.org/plugins/woo-order-export-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-order-export-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-order-export-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-order-export-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-order-export-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-order-export-lite/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [algol.plus](https://wordpress.org/support/users/algolplus/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/custom-value-with-php/#post-17756829)
 * Status: resolved