User listing submitted without selecting package

Hello

I have solution that worked for me.

See this topic:

As I understand you have a package with 1 listing - customer buys 1 listing.

So Customer fill listing, select package, (he has then 1 package), place order and listing is published. So package changes to 0 and disapears.

Problem is:

In Woocommerce status of order is “processing”. You change it to “completed”. After changing order status to “completed” Customer gets one extra package (he has 1 package again on his account).

So when he publish next listing he gets it for free because of this extra package.

==========================================================

What have I done that solved this problem for me:

in file
\plugins\hivepress-paid-listings\includes\components\class-listing-package.php

there is

if ( in_array( $new_status, [ ‘processing’, ‘completed’ ], true ) ) {

Changed to:

if ( in_array( $new_status, [ ‘processing’ ], true ) ) {

( without ‘completed’ - when the order status is changed to “completed” )

I only have instant payments and I always get the “processing” status after a successful payment. When I change the status of the order to “completed” then nothing happens, no additional package for the user is added.

1 Like