• Resolved synflex

    (@synflex)


    Hi, and congratulations for the plugin, it works great.

    I have a single problem that I cannot solve. My ecommerce sells third-party services, for each of which, with your plugin, I generate a license number. After the purchase, I have to send two emails: the first to the customer, and the second to the service provider, both with the same license number contained in the order.

    For this kind of automatisms I use the Automattic plugin Automatewoo, which allows me to dynamically insert order details in emails, through variables. One of these variables is {{order_item.meta | key: ‘****’}}, which can be used to show the value of a specific meta field of the order. Assuming your plugin populates one of the fields in the wp_post table with the license number for each record in the order, my question is: what is the meta field to insert in the above variable? I hope I was clear. Thanks in advance for your support.

    • This topic was modified 2 years, 7 months ago by synflex.
    • This topic was modified 2 years, 7 months ago by synflex.
Viewing 1 replies (of 1 total)
  • Hi @synflex

    Hope you are doing good.

    The meta is not stored anywhere inside the wp post table or post meta table

    The licenses come from our own table and to find that we have our own functions

    I am sharing the example you need developer help to understand.

    use LicenseManagerForWooCommerce\Repositories\Resources\License as LicenseResourceRepository;

    /** @var LicenseResourceModel[] $licenses */
    $licenses = LicenseResourceRepository::instance()->findAllBy(
    array(
    ‘order_id’ => $order->get_id(),
    ‘product_id’ => $item[‘product_id’]
    )
    );

    // No license keys? Nothing to do…
    if (!$licenses) {
    return;
    }

    $html = sprintf(‘<p>%s:</p>’, __(‘The following license keys have been sold by this order’, ‘license-manager-for-woocommerce’));
    $html .= ‘<ul class=”lmfwc-license-list”>’;

    /** @var LicenseResourceModel $license */
    foreach ($licenses as $license) {
    $html .= sprintf(

    • </span> <code class=”lmfwc-placeholder”>%s
    • ‘,
      $license->getDecryptedLicenseKey()
      );
      }

      $html .= ‘‘;

      $html .= ‘<span class=”lmfwc-txt-copied-to-clipboard” style=”display: none”>’ . __(‘Copied to clipboard’, ‘license-manager-for-woocommerce’) . ‘</span>’;

      echo $html;`

Viewing 1 replies (of 1 total)
  • The topic ‘License meta field in wp_post’ is closed to new replies.