• Resolved ogoege

    (@ogoege)


    How to make sure that when paying for the ad, all the details are sent to the user’s mail?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    I am not exactly sure, by all the details do you mean that the whole content from the [adverts_add] form? and to which email address you would like to send it to?

    Thread Starter ogoege

    (@ogoege)

    When a user adds an ad, he can choose a free option or a paid one, that’s when he selects a paid one, he needs to pay, he chooses a bank transfer, according to the standard you have 2 fields for filling: the user name and his mail.
    His payment is also assigned a number, which he must specify in the transfer, but after that the person can not look at what number of his order to transfer the funds (he may have accidentally closed the window or not recorded). How can I make sure that the information that is published about his order is sent to his mail?

    Plugin Author Greg Winiarski

    (@gwin)

    You can try using adverts_payments_order_create filter for this

    
    add_filter( "adverts_payments_order_create", "my_adverts_payments_order_create" );
    function my_adverts_payments_order_create( $data ) {
      $payment_id = $data["payment_id";
      $email = $data["form"]["adverts_email"];
      $m = sprintf( "Your order number is %s. To pay %s.", $payment_id, $data["price"] );
      wp_mail( $email, "Your order has been created.", $m );
      return $data;
    }
    
    Thread Starter ogoege

    (@ogoege)

    Where i should use it? When I added these in public_html/wp-content/plugins/wpadverts/addons/featured/featured.php site down. Sorry, I cant understand.

    Plugin Author Greg Winiarski

    (@gwin)

    The code you should add in your theme functions.php file or create a new plugin and paste it there.

    In the code itself there is a typo, use the one below instead

    
    add_filter( "adverts_payments_order_create", "my_adverts_payments_order_create" );
    function my_adverts_payments_order_create( $data ) {
      $payment_id = $data["payment_id"];
      $email = $data["form"]["adverts_email"];
      $m = sprintf( "Your order number is %s. To pay %s.", $payment_id, $data["price"] );
      wp_mail( $email, "Your order has been created.", $m );
      return $data;
    }
    
    Thread Starter ogoege

    (@ogoege)

    Where can I change the text of the message?

    • This reply was modified 8 years ago by ogoege.
    • This reply was modified 8 years ago by ogoege.
    • This reply was modified 8 years ago by ogoege.
    Plugin Author Greg Winiarski

    (@gwin)

    The email body is Your order number is %s. To pay %s. just update this phrase in the code snippet.

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

The topic ‘Paying’ is closed to new replies.