Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Print Values From A Php File

  • bububeti
  • Member
  • Trial users
  • Join Date: 28-Aug 20
  • 24 posts

Posted 14 September 2020 - 10:56 AM #1

I am using change_order_status_post hook. With this hook I get a variable $order_info. How can I see what this variable return? I try to echo it but it does not show anywhere. I know for sure that my function is called. Is there any way to log the value to $order_info?


And another question, why I cannot post in Developer's Corner section?

  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22247 posts

Posted 14 September 2020 - 01:25 PM #2

For example, you can use the following code

file_put_contents('order_info.txt', var_export($order_info, true), FILE_APPEND);

After the function is called, the order_info.txt file will be created in the root directory of CS-Cart installation with the required information

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)

  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12107 posts

Posted 14 September 2020 - 07:35 PM #3

Or in the template use a comment such as:

<!-- MY_UNIQUE_MARKER: {$order_info:print_r:true} -->


The just search the page source for MY_UNIQUE_MARKER.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.