Changeset 2796280
- Timestamp:
- 10/09/2022 10:24:08 PM (3 years ago)
- Location:
- pricing-deals-for-woocommerce/trunk
- Files:
-
- 6 edited
-
admin/vtprd-license-options.php (modified) (4 diffs)
-
core/vtprd-apply-rules.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
vt-pricing-deals.php (modified) (6 diffs)
-
woo-integration/vtprd-parent-cart-validation.php (modified) (11 diffs)
-
woo-integration/vtprd-parent-functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pricing-deals-for-woocommerce/trunk/admin/vtprd-license-options.php
r2791573 r2796280 187 187 // works in conjunction with new PRO plugin update message on the plugins page, using after-nag logic 188 188 189 if ( ($vtprd_license_options['pro_plugin_version_status'] == 'Pro Version Error') && 190 ($vtprd_license_options['status'] == 'valid') && //v1.1.8.2 191 ($vtprd_license_options['state'] == 'active') ) { //v1.1.8.2 192 //FULL message for rego screen 193 $message = '<strong>Pro Plugin ** Update Required ** </strong>' ; 194 $message .= "<span style='color:grey !important;'><em> (pro plugin will not discount until updated)</em></span>" ; 195 196 $message .= '<br><br> Your Pro Version = ' .$vtprd_license_options['pro_version'] .' <strong> Required Pro Version = ' .VTPRD_MINIMUM_PRO_VERSION .'</strong>'; 197 198 //v1.1.8.2 begin 199 $message .= '<br><br> <em>** Only MANUAL updates are available **</em>'; //v1.1.8.2 200 /* //v2.0.3 201 if ($vtprd_license_options['prod_or_test'] == 'test') { 202 $message .= '<br><br> <em>In a TEST environment, only MANUAL updates are available:</em>'; //v1.1.8.2 203 } else { 204 $message .= '<br><br> 1. <em>For Plugin update, CLICK HERE: </em>'; //v1.1.8.2 205 //$message .= ' <a style="text-decoration: underline;font-size:18px;" href="'.esc_url(VTPRD_ADMIN_URL).'edit.php?post_type=vtprd-rule&page=vtprd_license_options_page&action=force_plugin_updates_check">Check for Plugin Updates</a>'; //v1.1.8.2 - removed home_url, also bounces to license page, which then sets the transient and goes on to the plugins page. 206 $message .= '<br><br> 2. <em>If no Plugin update is available, please update manually:</em>'; //v1.1.8.2 207 } 208 */ 209 210 //(1) 211 $message .= '<br><br> <strong>1) Log into the </strong> '; 212 $homeURL = 'https://www.varktech.com/your-account/your-login/'; 213 214 $message .= '<a target="_blank" href="' .esc_url($homeURL). '">Varktech.com - Your Login</a> page'; 215 216 217 //(2) 218 $message .= '<br><br> <strong>2) Download the new PRO zip file version</strong> from '; 219 $homeURL = 'https://www.varktech.com/checkout/purchase-history/'; 220 221 $message .= 'your <a target="_blank" href="' .esc_url($homeURL). '">Varktech.com - Purchase History</a> page '; 222 223 224 //(3) 225 $homeURL1 = VTPRD_ADMIN_URL.'plugins.php'; 226 $homeURL2 = $this->vtprd_strip_out_http($homeURL1); 227 $homeNAME = str_replace( '/wp-admin/plugins.php', '', $homeURL2 ?? '' ); //v2.0.3 228 229 230 231 $homeURL = VTPRD_ADMIN_URL.'plugin-install.php'; 232 $message .= '<br><br> <strong>3) Go to your </strong> <a target="_blank" href="' .esc_url($homeURL1). '">' .esc_textarea($homeNAME). ' - Plugins Page</a> , '; 233 $message .= ' and use <a target="_blank" href="' .esc_url($homeURL). '">Add New</a>'; 234 $message .= '<strong> to upload and activate the new zip file </strong>' ; 235 236 $message .= '<span style="color:grey !important">'; 237 238 $message .= '<br><br> • In your website back end Plugins Page, delete the old version of the * Pro Plugin * <em>(no settings will be lost)</em>. '; 239 $message .= '<br> • In your website back end ADD NEW Page, UPload and Activate the Pro Plugin <em>Using the new zip file downloaded from Varktech!</em> '; 240 $message .= '</strong>'; 241 242 $message .= '<br> '; 243 $message .= '</span>'; 244 245 //$message .= "<span style='color:grey !important;'><br><br><em> (This message displays when the Pro version is installed, regardless of whether it's active)</em></span>" ; 246 247 $admin_notices = '<div id="message" class="error fade" style="background-color: #FFEBE8 !important;"> <p style="font-size: 18px; !important;">' . $message . ' </p></div>'; 248 //echo $admin_notices; //v2.0.3 189 if ($vtprd_license_options['pro_plugin_version_status'] == 'Pro Version Error') { 190 //v2.0.0a end 191 $admin_notices = vtprd_full_pro_upd_msg(); //V2.0.0.1 MSG move to functions.php 192 $allowed_html = vtprd_get_allowed_html(); //v2.0.3 249 193 echo wp_kses($admin_notices ,$allowed_html ); //v2.0.3 194 //v2.0.0 end 250 195 } 251 196 … … 746 691 747 692 $url = esc_url( home_url() ); //SET URL 748 $url_no_http = $this->vtprd_strip_out_http($url); //v1.1.6.1693 $url_no_http = vtprd_strip_out_http($url); //v2.0.3.2 moved to functions.php 749 694 750 695 //TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST v1.1.8.2 … … 1676 1621 1677 1622 1678 1623 //v2.0.3.2 moved to functions.php 1624 /* 1679 1625 //from http://stackoverflow.com/questions/15699101/get-client-ip-address-using-php 1680 1626 public function vtprd_strip_out_http($url) { … … 1689 1635 return $url; 1690 1636 } 1637 */ 1691 1638 1692 1639 -
pricing-deals-for-woocommerce/trunk/core/vtprd-apply-rules.php
r2791573 r2796280 93 93 94 94 //error_log( print_r( ' ', true ) ); 95 //error_log( print_r( 'TOP OF CLASS VTPRD_Apply_Rules ', true ) );95 //error_log( print_r( 'TOP OF CLASS VTPRD_Apply_Rules ', true ) ); 96 96 //error_log( print_r( 'REQUEST_URI= ' .$_SERVER["REQUEST_URI"], true ) ); 97 97 … … 223 223 // when JUST a catalog discount was processed, CART still needs loading 224 224 //Move parent cart contents to vtprd_cart 225 //error_log( print_r( 'vtprd_load_vtprd_cart_for_processing - CART rule', true ) ); 225 226 vtprd_load_vtprd_cart_for_processing(); 226 227 … … 538 539 539 540 //RELOAD vtprd_cart in this situation - it'll be because Catalog rules were just processed... 541 //error_log( print_r( 'vtprd_load_vtprd_cart_for_processing - CART rule RELOAD', true ) ); 540 542 vtprd_load_vtprd_cart_for_processing(); 541 543 -
pricing-deals-for-woocommerce/trunk/readme.txt
r2795847 r2796280 5 5 Requires at least: 3.3 6 6 Tested up to: 6.0.2 7 Stable tag: 2.0.3. 17 Stable tag: 2.0.3.2 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 422 422 423 423 == Changelog == 424 425 = 2.0.3.2 - 2022-10-08 = 426 * Fix - Cart deal discount type - by default supplies crossouts in the cart, checkout and emails. 427 In rare cases, the crossout was not supplied. This fix repairs this issue. 428 * Enhancement - Changed Pro update nag to have full message on plugins page 424 429 425 430 -
pricing-deals-for-woocommerce/trunk/vt-pricing-deals.php
r2795847 r2796280 4 4 Plugin URI: http://varktech.com 5 5 Description: A discounting e-commerce add-on for WooCommerce, php8.1+ compatible. 6 Version: 2.0.3. 16 Version: 2.0.3.2 7 7 Author: Vark 8 8 Author URI: http://varktech.com … … 65 65 //v2.0.2.02 end 66 66 67 define('VTPRD_VERSION', '2.0.3. 1'); //v2.0.3.1 no change, just for version control67 define('VTPRD_VERSION', '2.0.3.2'); //v2.0.3.2 fix for cart deal crossouts 68 68 define('VTPRD_MINIMUM_PRO_VERSION', '2.0.3'); 69 69 define('VTPRD_LAST_UPDATE_DATE', '2022-10-05'); … … 1409 1409 1410 1410 global $vtprd_license_options; 1411 1411 1412 1412 //$pageURL = $_SERVER["REQUEST_URI"]; //v2.0.3 1413 1413 $pageURL = sanitize_url($_SERVER["REQUEST_URI"]); //v2.0.3 … … 1430 1430 return; 1431 1431 break; 1432 //v2.0.3.2 begin 1433 case (strpos($pageURL,'plugins.php') !== false ): 1434 $admin_notices = vtprd_full_pro_upd_msg(); //V2.0.0.1 MSG move to functions.php 1435 $allowed_html = vtprd_get_allowed_html(); //v2.0.3 1436 echo wp_kses($admin_notices ,$allowed_html ); //v2.0.3 1437 1438 return; 1439 break; 1440 1432 1441 default: 1433 //v1.1.8.2 re-coded1434 //IF PROD, don't show on plugins page, there's already an update msg after the pro plugin entry!!1435 1436 //v2.0.3 begin upload-plugin1437 /*1438 if ( ($vtprd_license_options['prod_or_test'] == 'prod') &&1439 (strpos($pageURL,'plugins.php') !== false ) ) {1440 return;1441 }1442 */1443 //v2.0.3 end1444 1442 1445 1443 $message = '<strong>' . __('Update Required for: ' , 'vtprd') . ' ' .VTPRD_PRO_PLUGIN_NAME . '</strong>' ; … … 1448 1446 $message .= '<br><br> ' . __('Your Pro Version = ' , 'vtprd') .$vtprd_license_options['pro_version'] .' <strong>' . __(' <em>Required</em> Pro Version = ' , 'vtprd') .VTPRD_MINIMUM_PRO_VERSION .'</strong>'; 1449 1447 1450 //***************** 1451 //v2.1.0 begin 1452 //***************** 1453 /* 1454 1455 WITH THE UPDATE TO THE INMOTION SERVER, AUTO UPDATES FOR PRICING DEALS NO LONGER FUNCTION 1456 1457 ALL UPDATES MUST NOW BE MANUAL. 1458 */ 1448 //ALL UPDATES MUST NOW BE MANUAL. 1449 1459 1450 $message .= '<br><br> • <span style="font-size:16px;font-weight:bold;">' . __('Go to the ' , 'vtprd') .' '; 1460 $homeURL = VTPRD_ADMIN_URL.'edit.php?post_type=vtprd-rule&page=vtprd_license_options_page'; 1461 $message .= '<a href="'.esc_url($homeURL).'">Register Pro License Page</a> For Instructions</span>' ; 1462 /* 1463 if ($vtprd_license_options['prod_or_test'] == 'test') { 1464 $message .= '<br><br> <em>' . __('In a TEST environment, only MANUAL updates are available:' , 'vtprd') .'</em>'; //v1.1.8.2 1465 $message .= '<br><br> • ' . __('Go to the ' , 'vtprd') .' '; 1466 $message .= '<a href="'.VTPRD_ADMIN_URL.'edit.php?post_type=vtprd-rule&page=vtprd_license_options_page">Register Pro License Page</a> For Instructions' ; 1467 } else { 1468 $message .= '<br><br> ' . __('CLICK HERE: ' , 'vtprd') .' '; 1469 $message .= '<a style="text-decoration: underline;font-size:16px;" href="'.VTPRD_ADMIN_URL.'edit.php?post_type=vtprd-rule&page=vtprd_license_options_page&action=force_plugin_updates_check"><strong>' . __('Check for Plugin Updates', 'vtprd'). '</strong></a>'; //v1.1.8.2 - bounces to license page, which then sets the transient and goes on to the plugins page. 1470 } 1471 */ 1472 //v2.1.0 END 1451 $homeURL = VTPRD_ADMIN_URL.'plugins.php?plugin_status=all&paged=1&s'; //v2.0.0.a updated 1452 $message .= '<a href="'.esc_url($homeURL).'">Plugins Page</a> For Instructions</span>' ; //v2.0.0.a updated 1453 1454 //v2.0.3.2 END 1473 1455 break; 1474 1456 } … … 1525 1507 */ 1526 1508 1527 $message .= '<br><br> • ' . __('Go to the ' , 'vtprd') .' '; 1528 $homeURL = VTPRD_ADMIN_URL.'edit.php?post_type=vtprd-rule&page=vtprd_license_options_page'; 1529 $message .= '<a href="'.esc_url($homeURL).'">Register Pro License Page</a> For Instructions' ; 1509 $message .= '<br><br> • ' . __('See Plugin update instructions above' , 'vtmin') .' '; //v2.0.3.2 1530 1510 1531 1511 /* -
pricing-deals-for-woocommerce/trunk/woo-integration/vtprd-parent-cart-validation.php
r2791573 r2796280 2093 2093 error_log( print_r( ' ', true ) ); 2094 2094 error_log( print_r( 'Function begin - vtprd_maybe_cart_item_subtotal, $subtotal= ' .$subtotal. $on_cart_Page.' $cart_item_key= ' .$cart_item_key, true ) ); 2095 error_log( print_r( ' vtprd_orig_cart_price_ = ' .$_SESSION['vtprd_orig_cart_price_'.$cart_item_key]. ' for item_key= ' .$cart_item_key , true ) ); 2096 error_log( print_r( ' vtprd_orig_cart_price_with_taxation_ = ' .$_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] . ' for item_key= ' .$cart_item_key , true ) ); 2095 2097 */ 2096 2097 //error_log( print_r( ' vtprd_orig_cart_price_ = ' .$_SESSION['vtprd_orig_cart_price_'.$cart_item_key. ' for item_key= ' .$cart_item_key , true ) );2098 //error_log( print_r( ' vtprd_orig_cart_price_with_taxation_ = ' .$_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key . ' for item_key= ' .$cart_item_key , true ) );2099 2098 2100 2099 global $post, $vtprd_info, $vtprd_setup_options, $woocommerce, $vtprd_cart; … … 2109 2108 2110 2109 //error_log( print_r( ' ', true ) ); 2111 //error_log( print_r( '$_SESSION array=', true ) );2112 //error_log( var_export($_SESSION, true ) );2110 //error_log( print_r( '$_SESSION array=', true ) ); 2111 //error_log( var_export($_SESSION, true ) ); 2113 2112 //error_log( print_r( ' ', true ) ); 2114 2113 //error_log( print_r( '$cart_item array=', true ) ); … … 2122 2121 (sanitize_text_field($_SESSION['do_no_actions'])) ) { 2123 2122 session_write_close(); //v2.0.2.02 2124 return $subtotal; 2123 //error_log( print_r( 'Function vtprd_maybe_cart_item_subtotal, exit001, $subtotal= ' .$subtotal , true ) ); 2124 return $subtotal; 2125 2125 } 2126 2126 //v1.1.1 end … … 2188 2188 remove_filter('woocommerce_cart_item_subtotal', array( &$this, 'vtprd_maybe_cart_item_subtotal' )); //v2.0.0 g solution 2189 2189 session_write_close(); //v2.0.2.02 2190 return $subtotal; 2190 //error_log( print_r( 'Function vtprd_maybe_cart_item_subtotal, exit002, $subtotal= ' .$subtotal , true ) ); 2191 return $subtotal; 2191 2192 } 2192 2193 … … 2200 2201 //****** 2201 2202 2202 //if ( $page_id == get_option ( "woocommerce_cart_page_id" ) ) { //v1.1.0.7 2203 $cart_page = get_option ( "woocommerce_cart_page_id" ); //v1.1.0.7 2204 if ( is_page($cart_page)) { //v1.1.0.7 2205 session_write_close(); //v2.0.2.02 2206 return $subtotal; 2207 } 2208 /* 2209 //v2.0.3 begin 2210 //once in a great while, this is all gone, and the crossouts don't work. 2211 switch( TRUE ) { 2212 2213 case ( (isset ($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key])) && 2214 (sanitize_text_field($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] > 0)) ) : 2215 $get_unit_price = false; 2216 break; 2217 2218 case ( (isset ($_SESSION['vtprd_orig_cart_price_'.$cart_item_key])) && 2219 (sanitize_text_field($_SESSION['vtprd_orig_cart_price_'.$cart_item_key] > 0)) ) : 2220 $get_unit_price = false; 2221 break; 2203 //v2.0.3.2 begin - removed 2204 /* 2205 $cart_page = get_option ( "woocommerce_cart_page_id" ); //v1.1.0.7 2206 if ( is_page($cart_page)) { //v1.1.0.7 2207 session_write_close(); //v2.0.2.02 2208 //error_log( print_r( 'Function vtprd_maybe_cart_item_subtotal, exit003, $subtotal= ' .$subtotal , true ) ); 2209 return $subtotal; 2210 } 2211 */ 2212 //v2.0.3.2 end 2213 2214 //************* 2215 //v2.0.3.2 begin 2216 //once in a great while, this is all gone, and the crossouts don't work. 2217 switch ( TRUE ) { 2218 2219 case ( (isset ($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key])) && 2220 (sanitize_text_field($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] > 0)) ) : 2221 2222 $oldprice_subtotal = wc_price( sanitize_text_field($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] * $cart_item['quantity']) ); 2223 2224 $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] = $oldprice_subtotal; //CANNOT be accessed by Addon and Calculator products 2225 2226 //error_log( print_r( 'vtprd_oldprice_subtotal_with_taxation = ' .$oldprice_subtotal .'$product_id= ' .$product_id, true ) ); 2227 2228 //v1.1.0.8 begin 2229 // do not display duplicate price in crossout (on checkout page, if discount coupon removed) 2230 if ($oldprice_subtotal != $subtotal) { 2231 //error_log( print_r( '<del> 003', true ) ); 2232 $subtotal = '<del>' . $oldprice_subtotal . '</del> <ins>' . $subtotal . '</ins>'; 2233 } 2234 2235 break; 2236 2237 case ( (isset ($_SESSION['vtprd_orig_cart_price_'.$cart_item_key])) && 2238 (sanitize_text_field($_SESSION['vtprd_orig_cart_price_'.$cart_item_key] > 0)) ) : 2222 2239 2223 default: 2224 $get_unit_price = true; 2225 break; 2226 2227 } 2228 */ 2229 2230 /* 2231 //v2.1.0 new 2232 $oldprice = vtprd_get_taxation_price_cart($vtprd_cart_item->product_id, $vtprd_cart_item->unit_price); //v2.1.0 2233 $_SESSION['vtprd_orig_cart_price_with_taxation_'.$vtprd_cart_item->cart_item_key] = $oldprice; //v2.1.0 used in subtotal crossout display 2240 $oldprice_subtotal = wc_price( sanitize_text_field($_SESSION['vtprd_orig_cart_price_'.$cart_item_key] * $cart_item['quantity']) ); 2234 2241 2235 error_log( print_r( ' vtprd_orig_cart_price_ = ' .$vtprd_cart_item->unit_price. ' for item_key= ' .$vtprd_cart_item->cart_item_key , true ) ); 2236 error_log( print_r( ' vtprd_orig_cart_price_with_taxation_ = ' .$oldprice. ' for item_key= ' .$vtprd_cart_item->cart_item_key , true ) ); 2237 2238 */ 2239 2240 //error_log( print_r( '$subtotal before the IF = ' .$subtotal, true ) ); 2241 2242 if (isset ($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key])) { 2243 2244 $oldprice_subtotal = wc_price( sanitize_text_field($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] * $cart_item['quantity']) ); 2245 2246 $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] = $oldprice_subtotal; //CANNOT be accessed by Addon and Calculator products 2247 2248 //error_log( print_r( 'vtprd_oldprice_subtotal_with_taxation = ' .$oldprice_subtotal .'$product_id= ' .$product_id, true ) ); 2249 2250 //v1.1.0.8 begin 2251 // do not display duplicate price in crossout (on checkout page, if discount coupon removed) 2252 if ($oldprice_subtotal != $subtotal) { 2253 //error_log( print_r( '<del> 003', true ) ); 2254 $subtotal = '<del>' . $oldprice_subtotal . '</del> <ins>' . $subtotal . '</ins>'; 2255 } 2256 } 2257 //v2.0.2.02 c - begin ELSE STRUCTURE 2258 // crossout when session variable not stored 2259 else { 2260 2261 //error_log( print_r( '$subtotal after ELSE = ' .$subtotal, true ) ); 2262 if (isset($_SESSION['vtprd_orig_cart_price_'.$cart_item_key] ) ) { //v2.0.3 2263 $oldprice_subtotal = wc_price( sanitize_text_field($_SESSION['vtprd_orig_cart_price_'.$cart_item_key] * $cart_item['quantity']) ); 2264 2265 $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] = $oldprice_subtotal; //even though this may not have taxation, subtotal is stored here to be picked up later in existing logic. 2266 2267 //error_log( print_r( 'vtprd_oldprice_subtotal_with_taxation = ' .$oldprice_subtotal .'$product_id= ' .$product_id, true ) ); 2242 $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] = $oldprice_subtotal; //even though this may not have taxation, subtotal is stored here to be picked up later in existing logic. 2243 2244 //error_log( print_r( 'vtprd_oldprice_subtotal_with_taxation = ' .$oldprice_subtotal .'$product_id= ' .$product_id, true ) ); 2245 2246 if ($oldprice_subtotal != $subtotal) { 2268 2247 2269 if ($oldprice_subtotal != $subtotal) { 2270 2271 $subtotal = '<del>' . $oldprice_subtotal . '</del> <ins>' . $subtotal . '</ins>'; 2272 //error_log( print_r( 'subtotal with crossout 002= ' .$subtotal, true ) ); 2273 } 2274 } 2275 } 2276 2277 //***************************** 2278 //v2.0.3 begin 2279 //***************************** 2280 //the checkout crossout 'old' pricing was not showing the correct taxation setting... 2281 if ( (isset($_SESSION['vtprd_product_session_info_'.$product_id])) && 2282 (vtprd_sanitize_text_or_array_field($_SESSION['vtprd_product_session_info_'.$product_id])) ) { //v2.0.3 added line for sanitize_text 2283 2284 $vtprd_product_session_info = vtprd_sanitize_text_or_array_field($_SESSION['vtprd_product_session_info_'.$product_id]); 2248 $subtotal = '<del>' . $oldprice_subtotal . '</del> <ins>' . $subtotal . '</ins>'; 2249 //error_log( print_r( 'subtotal with crossout 002= ' .$subtotal, true ) ); 2250 } 2251 break; 2285 2252 2286 //error_log( var_export($vtprd_product_session_info, true ) ); 2287 //error_log( print_r( ' ', true ) ); 2288 2289 if ( ($vtprd_product_session_info['product_discount_price_excl_tax_woo'] > 0) && // > 0 added to solve 0 oldprice issue, as session_info will occasionaly have 0 values 2290 ($vtprd_product_session_info['product_discount_price_incl_tax_woo'] > 0) ) { // > 0 added to solve 0 oldprice issue 2291 2292 2293 //error_log( print_r( ' ', true ) ); 2294 //error_log( print_r( 'setting the product_session_info, for $product_id= ' .$product_id, true ) ); 2295 //error_log( print_r( '$vtprd_info product_session_info array=', true ) ); 2296 2297 2298 if ( ( get_option( 'woocommerce_calc_taxes' ) == 'no' ) || 2299 ( get_option('woocommerce_tax_display_cart') == 'excl') || 2300 ( vtprd_maybe_customer_tax_exempt() ) ) { 2301 $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] = 2302 wc_price( $vtprd_product_session_info['product_discount_price_excl_tax_woo'] * $cart_item['quantity']); 2303 //error_log( print_r( 'excluding taxes set', true ) ); 2304 } else { 2305 $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] = 2306 wc_price( $vtprd_product_session_info['product_discount_price_incl_tax_woo'] * $cart_item['quantity']); 2307 //error_log( print_r( 'including taxes set', true ) ); 2308 } 2309 } 2310 } 2311 //v2.0.3 end 2312 //***************************** 2253 default: 2254 //create the session variable from $vtprd_cart values - 2255 //loop through $vtprd_cart to find the correct item 2256 foreach($vtprd_cart->cart_items as $vtprd_key => $vtprd_cart_item) { 2257 if ($vtprd_cart_item->cart_item_key == $cart_item_key ) { //v1.1.1 2258 $_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] = $vtprd_cart_item->product_orig_cart_unit_price; 2259 //$_SESSION['vtprd_orig_cart_price_'.$cart_item_key] = $vtprd_cart_item->product_id 2260 break; //break out of foreach 2261 } 2262 } 2263 //same as 1st case (above) from here on out 2264 if ( (isset ($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key])) && 2265 (sanitize_text_field($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] > 0)) ) { 2266 2267 $oldprice_subtotal = wc_price( sanitize_text_field($_SESSION['vtprd_orig_cart_price_with_taxation_'.$cart_item_key] * $cart_item['quantity']) ); 2268 2269 $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] = $oldprice_subtotal; //CANNOT be accessed by Addon and Calculator products 2270 2271 //error_log( print_r( 'vtprd_oldprice_subtotal_with_taxation = ' .$oldprice_subtotal .'$product_id= ' .$product_id, true ) ); 2272 2273 //v1.1.0.8 begin 2274 // do not display duplicate price in crossout (on checkout page, if discount coupon removed) 2275 if ($oldprice_subtotal != $subtotal) { 2276 //error_log( print_r( '<del> 003', true ) ); 2277 $subtotal = '<del>' . $oldprice_subtotal . '</del> <ins>' . $subtotal . '</ins>'; 2278 } 2279 } 2280 break; 2281 } 2282 2283 //v2.0.3.2 end 2284 //************* 2313 2285 2314 2286 2315 2287 //$crossout = $_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id]; 2316 //error_log( print_r( 'vtprd_oldprice_subtotal_for_order_crossouts FINAL VALUE = ' .$crossout. ' $product_id= ' .$product_id , true ) );2288 //error_log( print_r( 'vtprd_oldprice_subtotal_for_order_crossouts FINAL VALUE = ' .$crossout. ' $product_id= ' .$product_id , true ) ); 2317 2289 2318 2290 … … 2329 2301 2330 2302 } 2331 2303 2304 2332 2305 //************************************** 2333 2306 /* … … 2365 2338 vtprd_set_transient_cart_data ( 'session_data_by_ip', $serialized_session, $vtprd_info['purchaser_ip_address'] ); 2366 2339 2367 //error_log( print_r( 'vtprd_set_session_transient_with_ip_key, ip= ' .$vtprd_info['purchaser_ip_address'], true ) );2340 //error_log( print_r( 'vtprd_set_session_transient_with_ip_key, ip= ' .$vtprd_info['purchaser_ip_address'], true ) ); 2368 2341 2369 2342 session_write_close(); //v2.0.2.02 … … 2477 2450 //v1.1.1 refactored 2478 2451 //pick up the previously stored crossout info 2452 2453 2479 2454 if (isset($_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id]) ) { 2480 2455 $oldprice = wp_kses($_SESSION['vtprd_orig_cart_price_subtotal_for_order_crossouts_'.$product_id] ,$allowed_html ); //v2.0.3 - this field contains HTML, so uses wp_kses … … 5148 5123 // moved HERE so that abandoned carts are avoided in lifetime info 5149 5124 5150 //test test test5151 5125 //global $vtprd_rules_set; 5152 5126 //error_log( print_r( 'RULESET Just Before vtprd_save_lifetime_purchase_info, $log_id= ' .$log_id, true ) ); … … 5453 5427 $data_chain = unserialize($data_chain); 5454 5428 5455 //v2.0.2.0 begin 5429 //v2.0.2.0 begin TEST 5456 5430 /* 5457 //test test test5458 5431 if ($data_chain) { 5459 5432 $data_chain_found = true; … … 5833 5806 } //end if ($cart_id) 5834 5807 5835 //test test test5836 5808 //vtprd_set_transient_cart_data ( 'customer_id_for_cart_id', 'key to key lookup' ); // UPDATES INFO TO CURRENT - track relationship between CURRENT Unique_id AND customer_id 5837 5809 -
pricing-deals-for-woocommerce/trunk/woo-integration/vtprd-parent-functions.php
r2791573 r2796280 10 10 global $post, $wpdb, $woocommerce, $vtprd_cart, $vtprd_cart_item, $vtprd_setup_options, $vtprd_info; 11 11 12 //error_log( print_r( ' ', true ) );13 //error_log( print_r( 'BEGIN vtprd_load_vtprd_cart_for_processing', true ) );12 //error_log( print_r( ' ', true ) ); 13 //error_log( print_r( 'BEGIN vtprd_load_vtprd_cart_for_processing', true ) ); 14 14 15 15 // from Woocommerce/templates/cart/mini-cart.php and Woocommerce/templates/checkout/review-order.php … … 430 430 $_SESSION['vtprd_orig_cart_price_with_taxation_'.$vtprd_cart_item->cart_item_key] = $oldprice; //v2.1.0 used in subtotal crossout display 431 431 432 //error_log( print_r( ' vtprd_orig_cart_price_ = ' .$vtprd_cart_item->unit_price. ' for item_key= ' .$vtprd_cart_item->cart_item_key , true ) );433 //error_log( print_r( ' vtprd_orig_cart_price_with_taxation_ = ' .$oldprice. ' for item_key= ' .$vtprd_cart_item->cart_item_key , true ) );432 //error_log( print_r( ' vtprd_orig_cart_price_ = ' .$vtprd_cart_item->unit_price. ' for item_key= ' .$vtprd_cart_item->cart_item_key , true ) ); 433 //error_log( print_r( ' vtprd_orig_cart_price_with_taxation_ = ' .$oldprice. ' for item_key= ' .$vtprd_cart_item->cart_item_key , true ) ); 434 434 435 435 … … 6752 6752 //v2.0.3 end 6753 6753 6754 //test test 6754 6755 6755 //$transient_cart = $wpdb->get_row( "SELECT * FROM `" . VTPRD_TRANSIENT_CART_DATA . "` WHERE `cart_id` = '" . $cart_id . "' AND `transient_data_type` = '" . $transient_data_type . "' LIMIT 1", ARRAY_A ); 6756 6756 //error_log( print_r( 'vtprd_set_transient_cart_data - transient_cart at SET', true ) ); … … 6819 6819 ); 6820 6820 //v2.0.3 end 6821 //test test 6821 6822 6822 //$transient_cart = $wpdb->get_row( "SELECT * FROM `" . VTPRD_TRANSIENT_CART_DATA . "` WHERE `cart_id` = '" . $cart_id . "' AND `transient_data_type` = '" . $transient_data_type . "' LIMIT 1", ARRAY_A ); 6823 6823 //error_log( print_r( 'vtprd_set_unqiue_transient_customer_id_for_cart_id - transient_cart at SET - ', true ) ); … … 7634 7634 } 7635 7635 7636 //************************* 7637 //v2.0.3.2 new function 7638 //************************* 7639 //from http://stackoverflow.com/questions/15699101/get-client-ip-address-using-php 7640 function vtprd_full_pro_upd_msg() { 7641 7642 global $vtprd_license_options; 7643 7644 //FULL message for rego screen 7645 $message = '<strong>' . __('Pro Plugin ** Update Required ** ' , 'vtprd') .'</strong>' ; 7646 $message .= "<span style='color:grey !important;'><em> (pro plugin will not discount until updated)</em></span>" ; 7647 7648 $message .= '<br><br> ' . __('Your Pro Version = ' , 'vtprd') .$vtprd_license_options['pro_version'] .' <strong>' . __(' Required Pro Version = ' , 'vtprd') .VTPRD_MINIMUM_PRO_VERSION .'</strong>'; 7649 7650 //v2.0.0 begin 7651 7652 //(1) 7653 $message .= '<br><br> <strong>1) Log into the </strong> '; 7654 $homeURL = 'https://www.varktech.com/your-account/your-login/'; 7655 7656 $message .= '<a target="_blank" href="' .esc_url($homeURL). '">Varktech.com - Your Login</a> page'; 7657 7658 7659 //(2) 7660 $message .= '<br><br> <strong>2) Download the new PRO zip file version</strong> from '; 7661 $homeURL = 'https://www.varktech.com/checkout/purchase-history/'; 7662 7663 $message .= 'your <a target="_blank" href="' .esc_url($homeURL). '">Varktech.com - Purchase History</a> page '; 7664 7665 7666 //(3) 7667 $homeURL1 = VTPRD_ADMIN_URL.'plugins.php'; 7668 $homeURL2 = vtprd_strip_out_http($homeURL1); 7669 $homeNAME = str_replace( '/wp-admin/plugins.php', '', $homeURL2 ?? '' ); //v2.0.3 7670 7671 7672 7673 $homeURL = VTPRD_ADMIN_URL.'plugin-install.php'; 7674 $message .= '<br><br> <strong>3) Go to your </strong> <a target="_blank" href="' .esc_url($homeURL1). '">' .esc_textarea($homeNAME). ' - Plugins Page</a> , '; 7675 $message .= ' and use <a target="_blank" href="' .esc_url($homeURL). '">Add New</a>'; 7676 $message .= '<strong> to upload and activate the new zip file </strong>' ; 7677 7678 $message .= '<span style="color:grey !important">'; 7679 7680 $message .= '<br><br> • In your website back end Plugins Page, delete the old version of the * Pro Plugin * as needed <em>(no settings will be lost)</em>. '; 7681 $message .= '<br> • In your website back end ADD NEW Page, UPload and Activate the Pro Plugin <em>Using the new zip file downloaded from Varktech!</em> '; 7682 $message .= "<br> • Apple Mac Users Users: Macs often unzip files during download. <em> If the folder is delivered unzipped, you'll need to rezip the folder.</em> "; //v2.0.0a 7683 $message .= '</strong>'; 7684 7685 $message .= '<br> '; 7686 $message .= '</span>'; 7687 7688 //$message .= "<span style='color:grey !important;'><br><br><em> (This message displays when the Pro version is installed, regardless of whether it's active)</em></span>" ; 7689 7690 $admin_notices = '<div id="message" class="error fade" style="background-color: #FFEBE8 !important;"> <p style="font-size: 18px; !important;">' . $message . ' </p></div>'; 7691 return $admin_notices; 7692 } 7693 7694 //************************* 7695 //v2.0.3.2 moved here 7696 //************************* 7697 //from http://stackoverflow.com/questions/15699101/get-client-ip-address-using-php 7698 function vtprd_strip_out_http($url) { 7699 $url = str_replace( 'https://', '', $url ?? '' ); //v2.0.0 7700 $url = str_replace( 'http://', '', $url ?? '' ); //v2.0.0 7701 $url = rtrim($url, "/" ); //remove trailing slash 7702 //$url = str_replace( 'www.', '', $url ) ; //v1.1.8.2 strip out WWW 7703 return $url; 7704 } 7705 7636 7706 7637 7707 //*************************
Note: See TracChangeset
for help on using the changeset viewer.