• Resolved pvtd

    (@pvtd)


    Hello,

    First off all, epic plugin, keep up the good work and try release a pro version in the future to back you up on the hours working on this.

    My problem is since version 2.x.x.
    I run a Crypto shop and use Discord as main communication system for the shop.
    With the help of your plugin, I managed to publish when people bought items from the shop (they are seats. The more sold, the faster the return starts) so that bot stimulates my clients to buy more and keep track of what is almost sold out.

    Since version 2.x.x the bot started posting more information to Discord and this should not be public.
    Here is a screenshot with the pre 2.x.x and after the 2.x.x update.

    View post on imgur.com

    Is there a way to have it back as before?
    Highly appreciated Nicola!
    Buona sera!
    PV

    PS: I tested 2.0.1 and it still gives me the same result.
    I also have this set in the settings:
    New order has been placed : %order_total% ! :tada:
    So in other words, there should be no connection to the order number or link.

    PS2: So I was comparing both versions (2.0.1 vs 1.1.6) but apparently I forgot to update to 1.1.6 when it came out so I ended up comparing 1.1.6 and 2.0.1 while they practically use the same posting mechanism…
    I will compare 1.1.5 that didn’t have the embedded change yet in case you haven’t responded yet. I will also keep users updated on this if needed.

    • This topic was modified 6 years, 4 months ago by pvtd.
    • This topic was modified 6 years, 4 months ago by pvtd.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello!

    You can use the filter wp_discord_post_order_embed to edit the embed of the order and remove any fields you don’t want to send or remove it entirely by setting it as an empty array.

    Thread Starter pvtd

    (@pvtd)

    Hello Nicola,

    I am not the brightest when it comes to filters.
    Mind if you tell me what to do :S?

    Much appreciated,
    PVTD

    Plugin Author Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hi,
    You could use something like this:

    add_filter( 'wp_discord_post_order_embed', 'custom_order_embed', 10, 2 );
    function custom_order_embed( $embed, $order ) {
      $embed['fields'] = array(
        // Replicate the array below for more fields.
        array(
          // Your custom field name and value here. 
        ),
      );
    
      return $embed;
    }

    What you want to add could be complex, I can’t write really more specific code. You can check what fields I add in class-wp-discord-post-woocommerce.php and copy paste only what you want to have.

    Unfortunately, I just found a bug in this filter which does not get the order object, but the product one instead, so you will not have the order details in the filter. It’s gonna be fixed in the next version.

    • This reply was modified 6 years, 3 months ago by Nico.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Woocomerce showing to many details’ is closed to new replies.