Changeset 2891545
- Timestamp:
- 03/31/2023 07:36:35 PM (3 years ago)
- Location:
- racar-clear-cart-for-woocommerce/trunk
- Files:
-
- 4 edited
-
includes/admin/class-rccwoo_Admin_Options.php (modified) (5 diffs)
-
includes/class-rccwoo-plugin.php (modified) (1 diff)
-
racar-clear-cart-for-woocommerce.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
racar-clear-cart-for-woocommerce/trunk/includes/admin/class-rccwoo_Admin_Options.php
r2891518 r2891545 202 202 'rccwoo_section_1' 203 203 ); 204 205 add_settings_field( 206 'rccwoo_redirection_url', 207 '<span class="option-name">' . __( 'Redirection after clearing cart', 'racar-clear-cart-for-woocommerce' ) . '<span class="quick-exp">(' . __( 'Type in the whole URL address you\'d like<br>to send customers if not to the cart itself', 'racar-clear-cart-for-woocommerce' ) . ')</span></span>', 208 array( $this, 'rccwoo_redirection_url_render' ), 209 'rccwoo-options-page', 210 'rccwoo_section_1' 211 ); 204 212 205 213 add_settings_field( … … 246 254 if ( ! empty( $_POST ) && check_admin_referer( 'rccwoo_update_options', 'nonce_rccwoo_settings' ) ) { 247 255 if( isset( $input['rccwoo_button_text'] ) ) 248 $new_input['rccwoo_button_text'] = sanitize_text_field( $input['rccwoo_button_text'] );256 $new_input['rccwoo_button_text'] = sanitize_text_field( $input['rccwoo_button_text'] ); 249 257 250 258 if( isset( $input['rccwoo_confirm_text'] ) ) 251 $new_input['rccwoo_confirm_text'] = sanitize_text_field( $input['rccwoo_confirm_text'] );259 $new_input['rccwoo_confirm_text'] = sanitize_text_field( $input['rccwoo_confirm_text'] ); 252 260 253 261 /*if( isset( $input['rccwoo_enabled'] ) ) … … 255 263 256 264 if( isset( $input['rccwoo_use_default_css_class'] ) ) 257 $new_input['rccwoo_use_default_css_class'] = absint( $input['rccwoo_use_default_css_class'] );265 $new_input['rccwoo_use_default_css_class'] = absint( $input['rccwoo_use_default_css_class'] ); 258 266 259 267 if( isset( $input['rccwoo_button_css_classes'] ) ) { … … 325 333 $new_input['rccwoo_hover_text_color'] = sanitize_hex_color( $textcolor ); 326 334 } 335 336 if( isset( $input['rccwoo_redirection_url'] ) ) 337 $new_input['rccwoo_redirection_url'] = sanitize_url( $input['rccwoo_redirection_url'] , array('http', 'https') ); 327 338 328 339 } … … 446 457 } 447 458 459 public function rccwoo_redirection_url_render() { 460 printf( 461 '<input type="text" id="button-css-classes" name="rccwoo_settings[rccwoo_redirection_url]" value="%s" placeholder="%s"/>', 462 isset( $this->options['rccwoo_redirection_url'] ) ? esc_attr( $this->options['rccwoo_redirection_url']) : '', 463 __( 'https://mysite.com/shop' , 'racar-clear-cart-for-woocommerce' ) 464 ); 465 echo '<div>'. __('Leave blank to keep customer in cart page after cart deletion' , 'racar-clear-cart-for-woocommerce' ) . '</div>'; 466 } 467 448 468 public function rccwoo_rate_render() { 449 469 global $allowed_html; -
racar-clear-cart-for-woocommerce/trunk/includes/class-rccwoo-plugin.php
r2490150 r2891545 143 143 public static function woocommerce_clear_cart_url() { 144 144 global $woocommerce; 145 $options = get_option( 'rccwoo_settings' ); 145 146 if( isset( $_REQUEST['clear-cart'] ) ) { 146 147 $woocommerce->cart->empty_cart(); 148 if( isset( $options['rccwoo_redirection_url'] ) ) { 149 wp_redirect( $options['rccwoo_redirection_url'] , 302 , 'Shop Clear Cart' ); 150 } 147 151 } 148 152 } -
racar-clear-cart-for-woocommerce/trunk/racar-clear-cart-for-woocommerce.php
r2891518 r2891545 4 4 * Plugin URI: https://github.com/rafacarvalhido/racar-clear-cart-woo 5 5 * Description: This plugin adds a convenient button to empty the shopping cart. Clear the entire cart with one click. 6 * Version: 2. 0.46 * Version: 2.1.0 7 7 * Author: Rafa Carvalhido 8 8 * Author URI: https://programawordpress.pro.br/blog/contato/rafa-carvalhido/ … … 56 56 $rccwoo_basename = plugin_basename(__FILE__);//racar-clear-cart-for-woocommerce/racar-clear-cart-for-woocommerce.php 57 57 58 $rccwoo_VERSION = '2. 0.4';58 $rccwoo_VERSION = '2.1.0'; 59 59 60 60 $rccwoo_NOME_STYLESHEET = 'rccwoo-stylesheet'; -
racar-clear-cart-for-woocommerce/trunk/readme.txt
r2891518 r2891545 5 5 Requires at least: 4.9.8 6 6 Tested up to: 6.1.1 7 Stable tag: 2. 0.47 Stable tag: 2.1.0 8 8 WC tested up to: 7.5.1 9 9 Requires PHP: 7.0 … … 116 116 117 117 == Changelog == 118 = 2. 0.4- 2023-03-31 =119 * Fix - Support and donation links were exchanged.118 = 2.1.0 - 2023-03-31 = 119 * Enhancement - Added redirection option as per @trondandre1962's request. 120 120 121 121 = 2.0.3 - 2023-03-31 =
Note: See TracChangeset
for help on using the changeset viewer.