'How to show all coupon in woocommerce? [duplicate]

I am developing an eCommerce website. I have some questions about the woocommerce coupon that is my project related.

  1. I want to show all coupon list.
  2. An order id wise all coupon information find out. can any one help me about this ?


Solution 1:[1]

ssh -t is a good suggestion.

You might also try sprinkling print statements/functions in your code, writing to some file in /var/tmp or whatever, to see what it's doing.

Another way of seeing what a process is doing is to use something like Linux' strace: http://stromberg.dnsalias.org/~strombrg/debugging-with-syscall-tracers.html

EG: ssh remote.host.com 'strace -f -o /var/tmp/my_script.strace my_script'. Then inspect /var/tmp/my_script.strace to see what it's stuck on. Reading strace output isn't always simple, but at least it's interesting. :)

Solution 2:[2]

SSH isn't going to cause problems running a python script. In general the things to watch out for are environment variables changing and any expectation on standard input/output as these can cause symptoms similar to what you described. Running python directly will hang as python expects to be able to interact with stdin/stdout if not running a script.

An easy way to test that the basic environment is working is to create a test program (test.py) containing:

print "foo"

then

ssh hostname python test.py

you should get "foo" as a response.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user1277476
Solution 2 Clarus