Skip to content

Commit 626f166

Browse files
committed
Merge branch 'release/2.0.1'
2 parents e06f832 + 8f442a5 commit 626f166

6 files changed

Lines changed: 65 additions & 13 deletions

File tree

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@
1010
}
1111
],
1212
"minimum-stability": "dev",
13-
"require": {}
13+
"require": {
14+
"php": ">=5.4.0",
15+
"composer/installers": "~1.0"
16+
}
1417
}

conversion-tracking.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Plugin Name: WooCommerce Conversion Tracking
44
Plugin URI: https://wedevs.com/products/plugins/woocommerce-conversion-tracking/
55
Description: Adds various conversion tracking codes to cart, checkout, registration success and product page on WooCommerce
6-
Version: 2.0
6+
Version: 2.0.1
77
Author: Tareq Hasan
88
Author URI: https://tareq.co/
99
License: GPL2
1010
WC requires at least: 2.3
11-
WC tested up to: 3.2.6
11+
WC tested up to: 3.5.7
1212
*/
1313

1414
/**
@@ -54,7 +54,7 @@ class WeDevs_WC_Conversion_Tracking {
5454
*
5555
* @var string
5656
*/
57-
public $version = '2.0';
57+
public $version = '2.0.1';
5858

5959
/**
6060
* Holds various class instances
@@ -76,7 +76,6 @@ public function __construct() {
7676
$this->init_classes();
7777

7878
register_activation_hook( __FILE__, array( $this, 'activate' ) );
79-
8079
do_action( 'wcct_loaded' );
8180
}
8281

@@ -180,7 +179,7 @@ public function init_hooks() {
180179
add_action( 'plugins_loaded', array( $this, 'plugin_upgrades' ) );
181180
add_action( 'init', array( $this, 'localization_setup' ) );
182181
add_action( 'init', array( $this, 'init_tracker' ) );
183-
182+
add_action( 'admin_notices', array( $this, 'check_woocommerce_exist' ) );
184183
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );
185184
}
186185

@@ -273,6 +272,20 @@ function plugin_action_links( $links ) {
273272

274273
return $links;
275274
}
275+
/**
276+
* Check Woocommerce exist
277+
*
278+
* @return void
279+
*/
280+
public function check_woocommerce_exist() {
281+
if ( ! function_exists( 'WC' ) ) {
282+
?>
283+
<div class="error notice is-dismissible">
284+
<p><?php _e( '<b>Woocommerce conversion tracking</b> requires <a target="_blank" href="https://wordpress.org/plugins/woocommerce/">Woocommerce</a>', 'woocommerce-conversion-tracking' );?></p>
285+
</div>
286+
<?php
287+
}
288+
}
276289
}
277290

278291
function wcct_init() {

includes/class-event-dispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ private function dispatch_event( $event, $value = '' ) {
185185
*/
186186
public function enqueue_scripts() {
187187

188-
echo '<!------ Starting: WooCommerce Conversion Tracking (https://wordpress.org/plugins/woocommerce-conversion-tracking/) ----->' . PHP_EOL;
188+
echo '<!-- Starting: WooCommerce Conversion Tracking (https://wordpress.org/plugins/woocommerce-conversion-tracking/) -->' . PHP_EOL;
189189
foreach ( $this->integrations as $integration ) {
190190
$integration->enqueue_script();
191191
}
192-
echo '<!------ End: WooCommerce Conversion Tracking Codes ----->' . PHP_EOL;
192+
echo '<!-- End: WooCommerce Conversion Tracking Codes -->' . PHP_EOL;
193193
}
194194
}

includes/integrations/class-integration-custom.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function get_settings() {
3232
'value' => '',
3333
'help' => sprintf( /* translators: %s: dynamic values */
3434
__( 'Put your JavaScript tracking scripts here. You can use dynamic values: %s', 'woocommerce-conversion-tracking' ),
35-
'<code>{customer_id}</code>, <code>{customer_email}</code>, <code>{customer_first_name}</code>, <code>{customer_last_name}</code>, <code>{order_number}</code>, <code>{order_total}</code>, <code>{order_subtotal}</code>, <code>{currency}</code>, <code>{payment_method}</code>'
35+
'<code>{customer_id}</code>, <code>{customer_email}</code>, <code>{customer_first_name}</code>, <code>{customer_last_name}</code>, <code>{order_number}</code>, <code>{order_total}</code>, <code>{order_subtotal}</code>, <code>{order_discount}</code>, <code>{order_shipping}</code>, <code>{currency}</code>, <code>{payment_method}</code>'
3636
),
3737
),
3838
array(
@@ -123,6 +123,9 @@ function process_order_markdown( $code, $order_id ) {
123123
$order_total = $order->get_total();
124124
$order_number = $order->get_order_number();
125125
$order_subtotal = $order->get_subtotal();
126+
$order_discount = $order->get_total_discount();
127+
$order_shipping = $order->get_total_shipping();
128+
126129

127130
// customer details
128131
if ( $customer ) {
@@ -139,6 +142,8 @@ function process_order_markdown( $code, $order_id ) {
139142
$code = str_replace( '{order_total}', $order_total, $code );
140143
$code = str_replace( '{order_number}', $order_number, $code );
141144
$code = str_replace( '{order_subtotal}', $order_subtotal, $code );
145+
$code = str_replace( '{order_discount}', $order_discount, $code );
146+
$code = str_replace( '{order_shipping}', $order_shipping, $code );
142147

143148
return $code;
144149
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Woocommerce-Conversion-Tracking",
3-
"version": "1.0.0",
3+
"version": "2.0.1",
44
"description": "Conversion tracking plugin for WooCommerce",
55
"author": "Tareq Hasan",
66
"license": "GPL",

readme.txt

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Contributors: tareq1988
33
Tags: ecommerce, e-commerce, commerce, woocommerce, tracking, facebook, google, adwords, tracking-pixel
44
Donate link: https://tareq.co/donate/
55
Requires at least: 4.0
6-
Tested up to: 4.9.4
7-
Stable tag: 2.0
6+
Tested up to: 5.1.1
7+
Stable tag: 2.0.1
88
License: GPLv3
99
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -16,6 +16,29 @@ When you are integrating any advertising campaigns, they provide various trackin
1616

1717
This plugin inserts those codes on WooCommerce cart page, checkout success page and after user registration. So you can track who are adding your products to cart, who are buying them and who are registering to your site.
1818

19+
= Supported Integrations =
20+
21+
* [Facebook](https://wedevs.com/docs/woocommerce-conversion-tracking/facebook/?utm_source=wporg&utm_medium=Readme&utm_campaign=wcct-lite&utm_content=facebook)
22+
* [Twitter](https://wedevs.com/docs/woocommerce-conversion-tracking/twitter/?utm_source=wporg&utm_medium=Readme&utm_campaign=wcct-lite&utm_content=twitter)
23+
* [Google Adwords](https://wedevs.com/docs/woocommerce-conversion-tracking/google-adwords/?utm_source=wporg&utm_medium=Readme&utm_campaign=wcct-lite&utm_content=google_adwords)
24+
* [Custom Tracking](https://wedevs.com/docs/woocommerce-conversion-tracking/custom/?utm_source=wporg&utm_medium=Readme&utm_campaign=wcct-lite&utm_content=custom)
25+
26+
= Pro Features =
27+
28+
* More Facebook Events
29+
* Multiple Facebook Pixels
30+
* [Facebook Product Catalog](https://wedevs.com/docs/woocommerce-conversion-tracking/facebook/facebook-product-catalog/?utm_source=wporg&utm_medium=Readme&utm_campaign=wcct-lite&utm_content=product_catalog)
31+
* [Perfect Audience](https://wedevs.com/docs/woocommerce-conversion-tracking/perfect-audience/?utm_source=wporg&utm_medium=Readme&utm_campaign=wcct-lite&utm_content=perfect_audience)
32+
* More Twitter and Google Adwords Events
33+
34+
[**Get Pro Version**](https://wedevs.com/woocommerce-conversion-tracking/pricing/?utm_source=wporg&utm_medium=Readme&utm_campaign=wcct-lite&utm_content=pricing)
35+
36+
= Videos =
37+
[youtube http://www.youtube.com/watch?v=PZN883xb51c]
38+
[youtube http://www.youtube.com/watch?v=6QMWzM9decU]
39+
40+
[**All Videos**](https://www.youtube.com/watch?v=b3BHJwQ7Q70&list=PLJorZsV2RVv_7zV2I1_X_xJODZklXHQtS)
41+
1942
= Contribute =
2043
[Github](https://github.com/tareq1988/woocommerce-conversion-tracking)
2144

@@ -58,10 +81,18 @@ We put the JavaScript scripts provided by you in the page and it fires a convers
5881
== Screenshots ==
5982

6083
1. Settings Panel
61-
2. Tracking code on single product.
84+
2. Facebook Pixel Setup
85+
3. Google Adwords Conversion Tracking Settings
86+
4. Twitter Purchase Tracking Setup
87+
5. Custom Codes
6288

6389
== Changelog ==
6490

91+
= Version 2.0.1 (04-April-2019) =
92+
93+
* [fix] Added plugin require notice
94+
95+
6596
= Version 2.0 (22-February-2018) =
6697

6798
* Major version released

0 commit comments

Comments
 (0)