Changeset 2264115
- Timestamp:
- 03/19/2020 07:43:06 PM (6 years ago)
- Location:
- transact
- Files:
-
- 12 edited
- 1 copied
-
tags/4.2.0 (copied) (copied from transact/trunk)
-
tags/4.2.0/admin/controllers/transact-admin-settings-post.php (modified) (4 diffs)
-
tags/4.2.0/frontend/assets/style.css (modified) (1 diff)
-
tags/4.2.0/frontend/assets/transact_post.js (modified) (1 diff)
-
tags/4.2.0/frontend/controllers/transact-handle-buttons.php (modified) (1 diff)
-
tags/4.2.0/readme.txt (modified) (2 diffs)
-
tags/4.2.0/transact-plugin.php (modified) (1 diff)
-
trunk/admin/controllers/transact-admin-settings-post.php (modified) (4 diffs)
-
trunk/frontend/assets/style.css (modified) (1 diff)
-
trunk/frontend/assets/transact_post.js (modified) (1 diff)
-
trunk/frontend/controllers/transact-handle-buttons.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/transact-plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
transact/tags/4.2.0/admin/controllers/transact-admin-settings-post.php
r2262712 r2264115 132 132 $price = sanitize_text_field( $_POST['transact_price'] ); 133 133 // Update the meta field. 134 update_post_meta( $post_id, 'transact_price', $price );134 update_post_meta( $post_id, 'transact_price', $price * 100); 135 135 } 136 136 … … 274 274 function check_transact_price(event) { 275 275 console.log("check_transact_price", event); 276 let price = document.getElementById('transact_price').value ;276 let price = document.getElementById('transact_price').value * 100; 277 277 278 278 if (price.length > 0 && Number.isInteger(parseInt(price))) { 279 279 price = parseInt(price); // will set 0 if input is 0.1 280 280 console.log('check_transact_price IS valid', price) 281 document.getElementById('transact_price').value = price.toString();281 document.getElementById('transact_price').value = (price / 100).toString(); 282 282 } else { 283 283 alert('price is not valid'); … … 453 453 </div> 454 454 <div class="transact_meta_field"> 455 <input type="number" min="1" max="99999" id="transact_price" 456 onchange="check_transact_price()" 457 name="transact_price" value="<?php echo esc_attr( $value[1] ); ?>" <?php echo esc_attr($price_disabled); ?> /> 455 <span class="transact-price-input"> 456 <input type="number" min="0.01" step="0.01" id="transact_price" class="transact-price-input__field" 457 onchange="check_transact_price()" 458 name="transact_price" value="<?php echo esc_attr( $value[1] ) / 100; ?>" <?php echo esc_attr($price_disabled); ?> /> 459 </span> 458 460 <span id="price_alert" style="color: red; display: none;"><?php esc_html_e('You need to set a price!', 'transact');?></span> 459 461 </div> … … 483 485 public function set_transact_style() 484 486 { 487 wp_enqueue_style('transact', FRONTEND_ASSETS_URL . 'style.css'); 485 488 wp_enqueue_style( 486 489 'transact-admin', -
transact/tags/4.2.0/frontend/assets/style.css
r2245834 r2264115 178 178 } 179 179 180 .transact-price-input { 181 position: relative; 182 display: block; 183 font-size: 15px; 184 } 185 .transact-price-input::before { 186 content: '$'; 187 position: absolute; 188 top: 50%; 189 left: 10px; 190 line-height: 0; 191 z-index: 10; 192 } 193 .transact-price-input input.transact-price-input__field { 194 padding-left: 20px !important; 195 } 196 180 197 /* SQUARE BUTTON 181 198 background-color: #19a5ae; -
transact/tags/4.2.0/frontend/assets/transact_post.js
r2262712 r2264115 165 165 */ 166 166 function setDonateAmount() { 167 var donate = jQuery('#donate_val').val() ;168 if (!donate ) {167 var donate = jQuery('#donate_val').val() * 100; 168 if (!donate || donate < 1) { 169 169 alert('Invalid Donation Amount'); 170 170 return; -
transact/tags/4.2.0/frontend/controllers/transact-handle-buttons.php
r2262712 r2264115 99 99 $price = get_post_meta($this->post_id, 'transact_price', true ); 100 100 $button = $this->print_donate_button($this->options, $number_of_words); 101 $input = '<input type="number" name="donate" class="transact-donate_amount" id="donate_val" onchange="TransactWP.setDonateAmount()" value="'.($price ? $price : 1).'"/>'; 101 $input = '<span class="transact-price-input"><input type="number" step="0.01" min="0.01" name="donate" class="transact-donate_amount transact-price-input__field" ' . 102 'id="donate_val" onchange="TransactWP.setDonateAmount()" value="' . 103 ($price ? ($price / 100) : 0.01) . 104 '"/></span>'; 102 105 return $input . $button; 103 106 } -
transact/tags/4.2.0/readme.txt
r2262712 r2264115 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.3.2 8 Stable tag: 4. 1.18 Stable tag: 4.2.0 9 9 License: APACHE-2.0 10 10 License URI: https://www.apache.org/licenses/LICENSE-2.0 … … 81 81 == Changelog == 82 82 83 = 4.2.0 = 84 * Display pricing as dollars and cents. 85 83 86 = 4.1.1 = 84 87 * Fix for donation pages. -
transact/tags/4.2.0/transact-plugin.php
r2262712 r2264115 3 3 * Plugin Name: transact.io 4 4 * Description: Integrates transact.io services into WP 5 * Version: 4. 1.15 * Version: 4.2.0 6 6 * Author: transact.io 7 7 * Author URI: https://transact.io -
transact/trunk/admin/controllers/transact-admin-settings-post.php
r2262712 r2264115 132 132 $price = sanitize_text_field( $_POST['transact_price'] ); 133 133 // Update the meta field. 134 update_post_meta( $post_id, 'transact_price', $price );134 update_post_meta( $post_id, 'transact_price', $price * 100); 135 135 } 136 136 … … 274 274 function check_transact_price(event) { 275 275 console.log("check_transact_price", event); 276 let price = document.getElementById('transact_price').value ;276 let price = document.getElementById('transact_price').value * 100; 277 277 278 278 if (price.length > 0 && Number.isInteger(parseInt(price))) { 279 279 price = parseInt(price); // will set 0 if input is 0.1 280 280 console.log('check_transact_price IS valid', price) 281 document.getElementById('transact_price').value = price.toString();281 document.getElementById('transact_price').value = (price / 100).toString(); 282 282 } else { 283 283 alert('price is not valid'); … … 453 453 </div> 454 454 <div class="transact_meta_field"> 455 <input type="number" min="1" max="99999" id="transact_price" 456 onchange="check_transact_price()" 457 name="transact_price" value="<?php echo esc_attr( $value[1] ); ?>" <?php echo esc_attr($price_disabled); ?> /> 455 <span class="transact-price-input"> 456 <input type="number" min="0.01" step="0.01" id="transact_price" class="transact-price-input__field" 457 onchange="check_transact_price()" 458 name="transact_price" value="<?php echo esc_attr( $value[1] ) / 100; ?>" <?php echo esc_attr($price_disabled); ?> /> 459 </span> 458 460 <span id="price_alert" style="color: red; display: none;"><?php esc_html_e('You need to set a price!', 'transact');?></span> 459 461 </div> … … 483 485 public function set_transact_style() 484 486 { 487 wp_enqueue_style('transact', FRONTEND_ASSETS_URL . 'style.css'); 485 488 wp_enqueue_style( 486 489 'transact-admin', -
transact/trunk/frontend/assets/style.css
r2245834 r2264115 178 178 } 179 179 180 .transact-price-input { 181 position: relative; 182 display: block; 183 font-size: 15px; 184 } 185 .transact-price-input::before { 186 content: '$'; 187 position: absolute; 188 top: 50%; 189 left: 10px; 190 line-height: 0; 191 z-index: 10; 192 } 193 .transact-price-input input.transact-price-input__field { 194 padding-left: 20px !important; 195 } 196 180 197 /* SQUARE BUTTON 181 198 background-color: #19a5ae; -
transact/trunk/frontend/assets/transact_post.js
r2262712 r2264115 165 165 */ 166 166 function setDonateAmount() { 167 var donate = jQuery('#donate_val').val() ;168 if (!donate ) {167 var donate = jQuery('#donate_val').val() * 100; 168 if (!donate || donate < 1) { 169 169 alert('Invalid Donation Amount'); 170 170 return; -
transact/trunk/frontend/controllers/transact-handle-buttons.php
r2262712 r2264115 99 99 $price = get_post_meta($this->post_id, 'transact_price', true ); 100 100 $button = $this->print_donate_button($this->options, $number_of_words); 101 $input = '<input type="number" name="donate" class="transact-donate_amount" id="donate_val" onchange="TransactWP.setDonateAmount()" value="'.($price ? $price : 1).'"/>'; 101 $input = '<span class="transact-price-input"><input type="number" step="0.01" min="0.01" name="donate" class="transact-donate_amount transact-price-input__field" ' . 102 'id="donate_val" onchange="TransactWP.setDonateAmount()" value="' . 103 ($price ? ($price / 100) : 0.01) . 104 '"/></span>'; 102 105 return $input . $button; 103 106 } -
transact/trunk/readme.txt
r2262712 r2264115 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.3.2 8 Stable tag: 4. 1.18 Stable tag: 4.2.0 9 9 License: APACHE-2.0 10 10 License URI: https://www.apache.org/licenses/LICENSE-2.0 … … 81 81 == Changelog == 82 82 83 = 4.2.0 = 84 * Display pricing as dollars and cents. 85 83 86 = 4.1.1 = 84 87 * Fix for donation pages. -
transact/trunk/transact-plugin.php
r2262712 r2264115 3 3 * Plugin Name: transact.io 4 4 * Description: Integrates transact.io services into WP 5 * Version: 4. 1.15 * Version: 4.2.0 6 6 * Author: transact.io 7 7 * Author URI: https://transact.io
Note: See TracChangeset
for help on using the changeset viewer.