Plugin Directory

Changeset 3377443


Ignore:
Timestamp:
10/13/2025 10:58:30 AM (4 months ago)
Author:
flexshop
Message:

commission id tracking in order checkout process code commit

Location:
flexoffers-conversion-tracking
Files:
16 added
3 edited

Legend:

Unmodified
Added
Removed
  • flexoffers-conversion-tracking/trunk/flexoffers-conversion-tracking.php

    r3361627 r3377443  
    99Description: FlexOffers Conversion Tracking.
    1010
    11 Version: 1.0.6
     11Version: 1.0.7
    1212
    1313Author: FlexOffers
  • flexoffers-conversion-tracking/trunk/public/flextrack-flexOffers.js

    r3361627 r3377443  
    6464  }
    6565
     66  function GetParameterValues(commUrl, param) {
     67    var url = commUrl?.slice(commUrl?.indexOf('?') + 1)?.split('&');
     68    for (var i = 0; i < url?.length; i++) {
     69      var urlparam = url[i].split('=');
     70      if (urlparam[0]?.toLowerCase() == param?.toLowerCase()) {
     71        return urlparam[1];
     72      }
     73    }
     74  }
     75
    6676  jQuery('.flextrack-order-id').length &&
    6777    orderNumber &&
     
    6979    getOrderDetail().then((orderDetail) => {
    7080      const { coupons, items, order_amount, billing_country } = orderDetail;
     81
     82      var commissionId = "";
     83      jQuery('.woocommerce-order').each(function () {
     84        var imagesInEachDiv = jQuery(this).find('img');
     85
     86        for (var i = 0; i < imagesInEachDiv.length; i++) {
     87          var imageSrc = imagesInEachDiv[i]?.src;
     88          if (imageSrc?.includes('commissionid')) {
     89            if (imageSrc !== undefined && imageSrc !== null && imageSrc !== "") {
     90              commissionId = GetParameterValues(imageSrc, 'commissionid')
     91              return false;
     92            }
     93          }
     94        }
     95      });
    7196
    7297      flextrack.track({
     
    79104            ? coupons.join('|')
    80105            : "",
    81         order_commissionid: jQuery('#flextrack-commission-id').val(),
     106        order_commissionid: jQuery('#flextrack-commission-id').val() || commissionId,
    82107        order_items:
    83108          items && items.length
  • flexoffers-conversion-tracking/trunk/readme.txt

    r3361627 r3377443  
    99Requires at least: 6.3.2
    1010Tested up to:      6.8
    11 Stable tag:        1.0.6
    12 Version:           1.0.6
    13 Requires PHP:      7.2
     11Stable tag:        1.0.7
     12Version:           1.0.7
     13Requires PHP:      8.3
    1414License: GPLv2 or later
    1515License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    44441. Install the plugin
    45452. Click on Settings
    46 3. Logged In through your Advertiser Pro Credentials
     463. Login with your FlexOffers credentials
    47474. Click on Install
    48485. Done
     
    7676= 1.0.6 =
    7777* Fixes done related to order checkout process.
     78
     79= 1.0.7 =
     80* custom field (commissionid) tracking added in order checkout process.
Note: See TracChangeset for help on using the changeset viewer.