Changeset 3400275
- Timestamp:
- 11/21/2025 08:54:08 AM (4 months ago)
- Location:
- exit-intent-popups-by-optimonk/trunk
- Files:
-
- 3 edited
-
optimonk-woo-data-injector.php (modified) (4 diffs)
-
optimonk.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
exit-intent-popups-by-optimonk/trunk/optimonk-woo-data-injector.php
r3346372 r3400275 18 18 $productData = $this->getProductData(); 19 19 $orderData = $this->getOrderData(); 20 $categoryData = $this->getCategoryData(); 20 21 21 22 $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( 26 27 'pluginVersion' => OM_PLUGIN_VERSION, 27 28 '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)); 29 37 30 38 $dataSet = array_merge($dataSet, array('page' => array( … … 38 46 if (!empty($orderData) && $orderData['order.order_id']) { 39 47 $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))); 40 51 } 41 52 … … 138 149 } 139 150 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 140 171 protected function isWooCommerceProductPage() { 141 172 return WooVersion::isWooCommerce() && $this->postID !== 0 && $this->getPostType() === 'product'; … … 157 188 158 189 protected static function removePrefixes(array $data): array { 159 $prefixes = ['order.', 'current_product.' ];190 $prefixes = ['order.', 'current_product.', 'category.']; 160 191 $result = []; 161 192 foreach ($data as $key => $value) { -
exit-intent-popups-by-optimonk/trunk/optimonk.php
r3354485 r3400275 5 5 Description: OptiMonk, the conversion optimization toolset crafted for marketers 6 6 Author: OptiMonk 7 Version: 2.1. 27 Version: 2.1.3 8 8 Text Domain: optimonk 9 9 Domain Path: /languages … … 12 12 */ 13 13 14 define('OM_PLUGIN_VERSION', '2.1. 2');14 define('OM_PLUGIN_VERSION', '2.1.3'); 15 15 define('OPTIMONK_FRONT_DOMAIN', 'onsite.optimonk.com'); 16 16 -
exit-intent-popups-by-optimonk/trunk/readme.txt
r3354485 r3400275 4 4 Requires at least: 2.8.0 5 5 Tested up to: 6.6.1 6 Stable tag: 2.1. 26 Stable tag: 2.1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 237 237 * New: 4 new template designs 238 238 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 239 243 = 2.0.8 = 240 244 * Test up to 6.6.1
Note: See TracChangeset
for help on using the changeset viewer.