Plugin Directory

Changeset 3400275


Ignore:
Timestamp:
11/21/2025 08:54:08 AM (4 months ago)
Author:
OptiMonk
Message:

Preparing for 2.1.3 release

Location:
exit-intent-popups-by-optimonk/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • exit-intent-popups-by-optimonk/trunk/optimonk-woo-data-injector.php

    r3346372 r3400275  
    1818        $productData = $this->getProductData();
    1919        $orderData = $this->getOrderData();
     20        $categoryData = $this->getCategoryData();
    2021
    2122        $dataSet = array(
    22             'shop' => null, 'page' => null,'product' => null, 'order' => null
    23         );
    24 
    25         $dataSet = array_merge($dataSet, array('shop' => array(
     23            'shop' => null, 'page' => null,'product' => null, 'order' => null, 'category' => null
     24        );
     25
     26        $shopData = array(
    2627            'pluginVersion' => OM_PLUGIN_VERSION,
    2728            'platform' => $this->getPlatform(),
    28         )));
     29        );
     30
     31        // Add cart URL if WooCommerce is active
     32        if (WooVersion::isWooCommerce() && function_exists('wc_get_cart_url')) {
     33            $shopData['cartUrl'] = wc_get_cart_url();
     34        }
     35
     36        $dataSet = array_merge($dataSet, array('shop' => $shopData));
    2937
    3038        $dataSet = array_merge($dataSet, array('page' => array(
     
    3846        if (!empty($orderData) && $orderData['order.order_id']) {
    3947            $dataSet = array_merge($dataSet, array('order' => self::removePrefixes($orderData)));
     48        }
     49        if (!empty($categoryData) && $categoryData['category.id']) {
     50            $dataSet = array_merge($dataSet, array('category' => self::removePrefixes($categoryData)));
    4051        }
    4152
     
    138149    }
    139150
     151    protected function getCategoryData() {
     152        $return = array();
     153
     154        if (!WooVersion::isWooCommerce() || !function_exists('is_product_category') || !is_product_category()) {
     155            return $return;
     156        }
     157
     158        $queried_object = get_queried_object();
     159
     160        if (!$queried_object || !isset($queried_object->term_id)) {
     161            return $return;
     162        }
     163
     164        $return['category.id'] = $queried_object->term_id;
     165        $return['category.name'] = $queried_object->name;
     166        $return['category.slug'] = $queried_object->slug;
     167
     168        return $return;
     169    }
     170
    140171    protected function isWooCommerceProductPage() {
    141172        return WooVersion::isWooCommerce() && $this->postID !== 0 && $this->getPostType() === 'product';
     
    157188
    158189    protected static function removePrefixes(array $data): array {
    159         $prefixes = ['order.', 'current_product.'];
     190        $prefixes = ['order.', 'current_product.', 'category.'];
    160191        $result = [];
    161192        foreach ($data as $key => $value) {
  • exit-intent-popups-by-optimonk/trunk/optimonk.php

    r3354485 r3400275  
    55  Description: OptiMonk, the conversion optimization toolset crafted for marketers
    66  Author: OptiMonk
    7   Version: 2.1.2
     7  Version: 2.1.3
    88  Text Domain: optimonk
    99  Domain Path: /languages
     
    1212*/
    1313
    14 define('OM_PLUGIN_VERSION', '2.1.2');
     14define('OM_PLUGIN_VERSION', '2.1.3');
    1515define('OPTIMONK_FRONT_DOMAIN', 'onsite.optimonk.com');
    1616
  • exit-intent-popups-by-optimonk/trunk/readme.txt

    r3354485 r3400275  
    44Requires at least: 2.8.0
    55Tested up to: 6.6.1
    6 Stable tag: 2.1.2
     6Stable tag: 2.1.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    237237* New: 4 new template designs
    238238
     239= 2.1.3 =
     240* Feature: Add WooCommerce category data (name, slug, ID) to WooDataForOM for better campaign targeting
     241* Feature: Add WooCommerce cart URL to shop data for easier cart navigation in campaigns
     242
    239243= 2.0.8 =
    240244* Test up to 6.6.1
Note: See TracChangeset for help on using the changeset viewer.