This is old but may help:
https://codeghar.wordpress.com/2014/07/23/zypper-cookbook-autoremove-packages-and-remove-orphaned-packages/