PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.7.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.7.0
2.7.0 2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 All 43 releases
← All changes | includes/funnel/analytics/data-updater.php +36 -1 1.2.12.7.0 View file →
@@ -27,14 +27,21 @@
27 27 */
28 28 public $today_min_time;
29 29
30 30 /**
31 + * Current query.
32 + *
33 + * @var boolean.
34 + */
35 + public $check_current_query;
36 +
37 + /**
31 38 * Data_Updater constructor.
32 39 *
33 40 * @since 1.1.0
34 41 */
35 42 public function __construct() {
36 - $this->today_min_time = strtotime( date( 'Y-m-d 0:0:0' ) );
43 + $this->today_min_time = strtotime( gmdate( 'Y-m-d 0:0:0' ) );
37 44 }
38 45
39 46 /**
40 47 * Sets funnel id.
@@ -205,7 +212,35 @@
205 212 $wpdb->prepare( "UPDATE `$table` SET upsell_revenue = %s WHERE funnel_id = %d AND applied_at > %s", $data[ 'upsell_revenue' ] + $order->get_total(), $this->funnel_id, $this->today_min_time )
206 213 );
207 214 }
208 215
216 + //phpcs:enable
217 + }
218 +
219 + /**
220 + * Adds new order log for accepted upsell.
221 + *
222 + * @since 1.9.2
223 + * @param double|int $total Upsell total price.
224 + */
225 + public function add_new_upsell_revenue_log( $total ) {
226 + $data = self::has_funnel_data();
227 +
228 + if ( empty( $data ) ) {
229 + return;
230 + }
231 +
232 + global $wpdb;
233 +
234 + $table = $wpdb->prefix . Database::DATABASE_PREFIX . 'applied_funnel';
235 +
236 + if ( empty( $data['revenue'] ) ) {
237 + $data['revenue'] = 0;
238 + }
239 +
240 + //phpcs:disable
241 + $wpdb->query(
242 + $wpdb->prepare( "UPDATE `$table` SET upsell_revenue = %s WHERE funnel_id = %d AND applied_at > %s", $data[ 'upsell_revenue' ] + $total, $this->funnel_id, $this->today_min_time )
243 + );
209 244 //phpcs:enable
210 245 }
211 246 }