Changeset 2715199
- Timestamp:
- 04/27/2022 04:15:08 AM (4 years ago)
- Location:
- codup-woocommerce-custom-fields
- Files:
-
- 39 added
- 9 edited
-
tags/1.1.1.12 (added)
-
tags/1.1.1.12/assets (added)
-
tags/1.1.1.12/assets/css (added)
-
tags/1.1.1.12/assets/css/admin (added)
-
tags/1.1.1.12/assets/css/admin/wc-product-custom-fields.css (added)
-
tags/1.1.1.12/assets/css/frontend (added)
-
tags/1.1.1.12/assets/css/frontend/wc-product-custom-fields.css (added)
-
tags/1.1.1.12/assets/images (added)
-
tags/1.1.1.12/assets/images/admin (added)
-
tags/1.1.1.12/assets/images/admin/add.png (added)
-
tags/1.1.1.12/assets/images/admin/delete.png (added)
-
tags/1.1.1.12/assets/js (added)
-
tags/1.1.1.12/assets/js/admin (added)
-
tags/1.1.1.12/assets/js/admin/wc-product-custom-fields.js (added)
-
tags/1.1.1.12/assets/js/front (added)
-
tags/1.1.1.12/assets/js/front/wc-product-custom-fields-front.js (added)
-
tags/1.1.1.12/codup-woocommerce-custom-fields.php (added)
-
tags/1.1.1.12/includes (added)
-
tags/1.1.1.12/includes/class-codup-wc-custom-fields.php (added)
-
tags/1.1.1.12/includes/helper.php (added)
-
tags/1.1.1.12/lib (added)
-
tags/1.1.1.12/lib/codupads (added)
-
tags/1.1.1.12/lib/codupads/codupads.php (added)
-
tags/1.1.1.12/lib/codupads/scripts (added)
-
tags/1.1.1.12/lib/codupads/scripts/adscript.js (added)
-
tags/1.1.1.12/lib/codupads/styles (added)
-
tags/1.1.1.12/lib/codupads/styles/style.css (added)
-
tags/1.1.1.12/readme.txt (added)
-
tags/1.1.1.12/templates (added)
-
tags/1.1.1.12/templates/admin (added)
-
tags/1.1.1.12/templates/admin/custom-fields-item-meta.php (added)
-
tags/1.1.1.12/templates/admin/product-custom-field-checkbox.php (added)
-
tags/1.1.1.12/templates/admin/product-custom-field-dropdown.php (added)
-
tags/1.1.1.12/templates/admin/product-custom-field-radio.php (added)
-
tags/1.1.1.12/templates/admin/product-custom-field-text.php (added)
-
tags/1.1.1.12/templates/admin/product-custom-field-textarea.php (added)
-
tags/1.1.1.12/templates/admin/product-custom-fields.php (added)
-
tags/1.1.1.12/templates/frontend (added)
-
tags/1.1.1.12/templates/frontend/product-custom-fields.php (added)
-
trunk/codup-woocommerce-custom-fields.php (modified) (2 diffs)
-
trunk/includes/class-codup-wc-custom-fields.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/templates/admin/product-custom-field-checkbox.php (modified) (1 diff)
-
trunk/templates/admin/product-custom-field-dropdown.php (modified) (1 diff)
-
trunk/templates/admin/product-custom-field-radio.php (modified) (1 diff)
-
trunk/templates/admin/product-custom-field-text.php (modified) (1 diff)
-
trunk/templates/admin/product-custom-field-textarea.php (modified) (1 diff)
-
trunk/templates/frontend/product-custom-fields.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
codup-woocommerce-custom-fields/trunk/codup-woocommerce-custom-fields.php
r2700999 r2715199 4 4 Plugin Name: Codup Woocommerce Custom Fields 5 5 Description: Add custom fields in Woocommerce Products 6 Version: 1.1.1.1 26 Version: 1.1.1.13 7 7 Author: codup.io 8 8 Author URI: http://codup.io/ … … 12 12 WC requires at least: 3.0 13 13 WC tested up to: 6.3.1 14 Tested up to: 5.9. 214 Tested up to: 5.9.3 15 15 */ 16 16 -
codup-woocommerce-custom-fields/trunk/includes/class-codup-wc-custom-fields.php
r2700999 r2715199 75 75 global $woocommerce, $post; 76 76 $last_field_id = get_post_meta( $post->ID, 'cwcf_last_field_id', false ); 77 $last_field_id = count( $last_field_id[0] ); 77 if(!empty($last_field_id)){ 78 $last_field_id = count( $last_field_id[0] ); 79 } 78 80 if ( ! $last_field_id ) { 79 81 $last_field_id = 0; … … 167 169 public function add_custom_field_data_to_cart_item( $cart_item_data, $product_id, $variation_id ) { 168 170 if ( isset( $_POST['cwcf_fields'] ) ) { 169 170 171 $product_custom_fields = get_post_meta( $product_id, 'cwcf_product_custom_fields', true ); 171 172 172 foreach ( $_POST['cwcf_fields'] as $field_id => $field ) { 173 173 $cart_item_data['cwcf_fields'][ $field_id ]['label'] = $product_custom_fields[ $field_id ]['cwcf_field_label']; 174 175 174 if ( is_array( $field ) ) { 176 175 $cart_item_data['cwcf_fields'][ $field_id ]['value'] = implode( ',', $field ); -
codup-woocommerce-custom-fields/trunk/readme.txt
r2700999 r2715199 3 3 Contributors: Codup 4 4 Tags: Woocommerce, Products, Custom Fields, Orders 5 Tested up to: 5.9. 25 Tested up to: 5.9.3 6 6 Requires PHP: 5.6 or later 7 Stable tag: 1.1.1.13 7 8 License: GPLv2 or later 8 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
codup-woocommerce-custom-fields/trunk/templates/admin/product-custom-field-checkbox.php
r2700999 r2715199 112 112 ?> 113 113 <?php 114 if(isset($field)){ 114 115 if ( $field['cwcf_field_required'] != null ) { 115 116 echo 'checked'; } 117 } 116 118 ?> 117 119 > -
codup-woocommerce-custom-fields/trunk/templates/admin/product-custom-field-dropdown.php
r2700999 r2715199 116 116 ?> 117 117 <?php 118 if(isset($field)){ 118 119 if ( $field['cwcf_field_required'] != null ) { 119 120 echo 'checked'; } 121 } 120 122 ?> 121 123 > -
codup-woocommerce-custom-fields/trunk/templates/admin/product-custom-field-radio.php
r2700999 r2715199 112 112 ?> 113 113 <?php 114 if(isset($field)){ 114 115 if ( $field['cwcf_field_required'] != null ) { 115 116 echo 'checked'; } 117 } 116 118 ?> 117 119 > -
codup-woocommerce-custom-fields/trunk/templates/admin/product-custom-field-text.php
r2700999 r2715199 44 44 ?> 45 45 <?php 46 if(isset($field)){ 46 47 if ( $field['cwcf_field_required'] != null ) { 47 48 echo 'checked'; } 49 } 48 50 ?> 49 51 > -
codup-woocommerce-custom-fields/trunk/templates/admin/product-custom-field-textarea.php
r2700999 r2715199 44 44 ?> 45 45 <?php 46 if(isset($field)){ 46 47 if ( $field['cwcf_field_required'] != null ) { 47 48 echo 'checked'; } 49 } 48 50 ?> 49 51 > -
codup-woocommerce-custom-fields/trunk/templates/frontend/product-custom-fields.php
r2700999 r2715199 16 16 17 17 <div class="cwcf_field_label"> 18 <label><?php echo $field['cwcf_field_label'];?></label>18 <label><?php _e( $field['cwcf_field_label']) ?></label> 19 19 </div> 20 20 … … 24 24 25 25 case 'text': 26 echo '<input ' . $required . ' class="cwcf_text_field" type="text" value="" name="cwcf_fields[' . $field_id . ']">';26 _e( '<input ' . $required . ' class="cwcf_text_field" type="text" value="" name="cwcf_fields[' . $field_id . ']">' ); 27 27 break; 28 28 29 29 case 'textarea': 30 echo '<textarea ' . $required . ' class="cwcf_textarea_field" name="cwcf_fields[' . $field_id . ']"></textarea>';30 _e( '<textarea ' . $required . ' class="cwcf_textarea_field" name="cwcf_fields[' . $field_id . ']"></textarea>'); 31 31 break; 32 32 33 33 case 'dropdown': 34 34 if ( $field['cwcf_option'] ) { 35 echo '<select ' . $required . ' class="cwcf_dropdown" name="cwcf_fields[' . $field_id . ']">';35 _e( '<select ' . $required . ' class="cwcf_dropdown" name="cwcf_fields[' . $field_id . ']">'); 36 36 foreach ( $field['cwcf_option'] as $option ) { 37 echo '<option value="' . $option['value'] . '">' . $option['label'] . '</option>';37 _e( '<option value="' . $option['value'] . '">' . $option['label'] . '</option>'); 38 38 } 39 echo '</select>';39 _e( '</select>'); 40 40 } 41 41 break; 42 42 case 'checkbox': 43 43 if ( $field['cwcf_option'] ) { 44 echo '<input type="hidden" value=' . $field_id . ' class="hide_field" />';44 _e( '<input type="hidden" value=' . $field_id . ' class="hide_field" />'); 45 45 foreach ( $field['cwcf_option'] as $option ) { 46 echo '<input ' . $required . ' name="cwcf_fields[' . $field_id . '][]" type="checkbox" class="cb_custom_fields' . $field_id . '" value="' . $option['value'] . '">';47 echo '<label>' . $option['label'] . '</label>';48 echo '<br>';46 _e( '<input ' . $required . ' name="cwcf_fields[' . $field_id . '][]" type="checkbox" class="cb_custom_fields' . $field_id . '" value="' . $option['value'] . '">'); 47 _e( '<label>' . $option['label'] . '</label>'); 48 _e( '<br>'); 49 49 50 50 } … … 54 54 if ( $field['cwcf_option'] ) { 55 55 foreach ( $field['cwcf_option'] as $option ) { 56 echo '<input ' . $required . ' name="cwcf_fields[' . $field_id . ']" type="radio" value="' . $option['value'] . '">';57 echo '<label>' . $option['label'] . '</label>';58 echo '<br>';56 _e( '<input ' . $required . ' name="cwcf_fields[' . $field_id . ']" type="radio" value="' . $option['value'] . '">' ); 57 _e( '<label>' . $option['label'] . '</label>' ); 58 _e( '<br>' ); 59 59 } 60 60 } … … 64 64 </div> 65 65 66 <div class="cwcf_field_description"><?php echo $field['cwcf_field_description'];?></div>66 <div class="cwcf_field_description"><?php _e( $field['cwcf_field_description'] ) ?></div> 67 67 <?php } ?> 68 68 </div>
Note: See TracChangeset
for help on using the changeset viewer.