Changeset 2139157
- Timestamp:
- 08/13/2019 10:36:09 PM (7 years ago)
- Location:
- subscribility
- Files:
-
- 12 edited
- 17 copied
-
tags/2.9.5 (copied) (copied from subscribility/trunk)
-
tags/2.9.5/includes/admin/controllers/class-wp99234-admin-settings-data-collection.php (modified) (1 diff)
-
tags/2.9.5/includes/admin/controllers/class-wp99234-admin.php (modified) (2 diffs)
-
tags/2.9.5/includes/admin/views/html-admin-operations-activity.php (copied) (copied from subscribility/trunk/includes/admin/views/html-admin-operations-activity.php)
-
tags/2.9.5/includes/frontend/assets/css/wp99234_frontend.css (copied) (copied from subscribility/trunk/includes/frontend/assets/css/wp99234_frontend.css)
-
tags/2.9.5/includes/frontend/assets/js/wp99234_checkout.js (copied) (copied from subscribility/trunk/includes/frontend/assets/js/wp99234_checkout.js)
-
tags/2.9.5/includes/frontend/assets/js/wp99234_frontend.js (copied) (copied from subscribility/trunk/includes/frontend/assets/js/wp99234_frontend.js)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-forms.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-forms.php)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-orders.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-orders.php)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-products.php (modified) (8 diffs)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-registration-forms.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-registration-forms.php)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-users.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-users.php)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-wc-filter.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-filter.php) (4 diffs)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-wc-payment-gateway.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-payment-gateway.php)
-
tags/2.9.5/includes/frontend/controllers/class-wp99234-wc-shipping-method.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-shipping-method.php)
-
tags/2.9.5/includes/frontend/views/newsletter_form.php (modified) (1 diff)
-
tags/2.9.5/includes/frontend/views/rating.php (copied) (copied from subscribility/trunk/includes/frontend/views/rating.php)
-
tags/2.9.5/includes/frontend/views/registration_form.php (copied) (copied from subscribility/trunk/includes/frontend/views/registration_form.php) (3 diffs)
-
tags/2.9.5/readme.txt (copied) (copied from subscribility/trunk/readme.txt) (1 diff)
-
tags/2.9.5/uninstall.php (copied) (copied from subscribility/trunk/uninstall.php)
-
tags/2.9.5/wp99234.php (copied) (copied from subscribility/trunk/wp99234.php) (1 diff)
-
trunk/includes/admin/controllers/class-wp99234-admin-settings-data-collection.php (modified) (1 diff)
-
trunk/includes/admin/controllers/class-wp99234-admin.php (modified) (2 diffs)
-
trunk/includes/frontend/controllers/class-wp99234-products.php (modified) (8 diffs)
-
trunk/includes/frontend/controllers/class-wp99234-wc-filter.php (modified) (4 diffs)
-
trunk/includes/frontend/views/newsletter_form.php (modified) (1 diff)
-
trunk/includes/frontend/views/registration_form.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp99234.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
subscribility/tags/2.9.5/includes/admin/controllers/class-wp99234-admin-settings-data-collection.php
r2069102 r2139157 95 95 'id' => 'wp99234_product_sync', 96 96 'css' => 'min-width:550px;', 97 'default' => ' ',97 'default' => 'both', 98 98 'type' => 'select', 99 99 'desc_tip' => true, -
subscribility/tags/2.9.5/includes/admin/controllers/class-wp99234-admin.php
r2048715 r2139157 46 46 add_action('woocommerce_product_options_general_product_data', array($this,'show_pack_prices')); 47 47 add_action('woocommerce_product_options_general_product_data', array($this,'show_member_prices')); 48 49 /* Customize Product Tags Labels */ 50 add_filter( 'woocommerce_taxonomy_args_product_tag', array($this, 'custom_wc_taxonomy_args_product_tag') ); 48 51 49 52 $this->admin_notices(); … … 632 635 echo '</div>'; 633 636 } 637 638 /** 639 * Display custom message for product tag 640 */ 641 function custom_wc_taxonomy_args_product_tag( $args ) { 642 // Get the Products data synchronisation option 643 $wp99234_product_sync_option = get_option('wp99234_product_sync', 'both'); 644 645 $tag_notice = 'You can remove Troly tags from the list below, however, these tags will still be present in Troly.'; 646 647 if (in_array($wp99234_product_sync_option, array('both', 'push'))) { 648 $tag_notice = 'You will not be able to remove Troly tags from the list below without disabling them in Troly first.'; 649 } 650 $args['label'] = __( 'Product Tags', 'woocommerce' ); 651 $args['labels'] = array( 652 'separate_items_with_commas' => __( "<p>$tag_notice</p><i>Separate tags with commas</i>", 'woocommerce' ), 653 ); 654 655 return $args; 656 } 634 657 } 635 658 -
subscribility/tags/2.9.5/includes/frontend/controllers/class-wp99234-products.php
r2068621 r2139157 8 8 define( 'WP99234_TAG_VISIBLE' , 105 ); 9 9 define( 'WP99234_TAG_OUT_OF_STOCK', 108 ); 10 define( 'WP99234_VARIETY_VIRTUAL', 'virtual' ); 10 11 11 12 /** … … 445 446 446 447 // Array format: (WP attribute name => SUBS attribute name) 447 function product_meta_map() {448 448 function product_meta_map() 449 { 449 450 return array( 450 451 'subs_id' => 'id', … … 453 454 'foods' => 'foods', 454 455 'cellar_until' => 'cellar_until', 455 //'price' => 'price',456 456 'price_case' => 'price_case', 457 457 'price_6pk' => 'price_6pk', … … 473 473 '_te_divider' => 'te_divider', 474 474 '_split_ols' => 'split_ols', 475 //'product_prices' => 'product_prices', 476 //'_subproducts' => 'subproducts', 477 '_variety' => 'variety', 475 '_variety' => 'variety', // default to 'wine' 478 476 'is_composite' => 'is_composite' // Used to indicate if pack or not 479 477 ); 480 481 478 } 482 479 … … 570 567 update_post_meta( $product_id, '_regular_price' , $price ); 571 568 update_post_meta( $product_id, '_is_split' , $product->is_split ); 569 570 // Set Product as Virtual 571 // see: https://wordpress.stackexchange.com/questions/137501/how-to-add-product-in-woocommerce-with-php-code 572 if ( $product->variety === WP99234_VARIETY_VIRTUAL ) { 573 update_post_meta( $product_id, '_virtual', 'yes'); 574 } 572 575 573 576 /** … … 776 779 777 780 foreach( $product->tags as $tag ){ 781 $product_biz_attributes = get_option('product_biz_attributes', array()); 782 783 // create slug for the current tag 784 $slug = sanitize_title($tag->name); 785 786 // check and set unique attribute 787 $is_attribute = array_search($slug, $product_biz_attributes); 788 if ( !$is_attribute ) { 789 $new_tag[$slug] = (array)$tag; 790 $product_biz_attributes = array_merge($product_biz_attributes, $new_tag); 791 792 // Save Troly tag ids as option 793 update_option('product_biz_attributes', $product_biz_attributes, true); 794 } 778 795 779 796 $term = get_term_by( 'name', $tag->name, $this->tag_taxonomy_name ); … … 1075 1092 if( $update ){ 1076 1093 // Get the Products data synchronisation option 1077 $wp99234_product_sync_option = get_option('wp99234_product_sync' );1094 $wp99234_product_sync_option = get_option('wp99234_product_sync', 'both'); 1078 1095 1079 1096 // Only export to `both` and `push` synchronisation … … 1136 1153 ); 1137 1154 1155 /** 1156 * Add Product business attribute 1157 */ 1158 $post_tags = get_the_terms( $product_id, 'product_tag' ); 1159 $product_biz_attributes = get_option('product_biz_attributes', array()); 1160 1161 if (!empty($post_tags)) { 1162 $product_biz_tag_ids = array(); 1163 $product_biz_tags = array(); 1164 1165 foreach ($post_tags as $tag) { 1166 $slug = sanitize_title($tag->name); 1167 $this_tag = $product_biz_attributes[$slug]; 1168 $product_biz_tag_ids[] = $this_tag['id']; 1169 $product_biz_tags[] = $this_tag; 1170 } 1171 1172 $data['tag_ids'] = $product_biz_tag_ids; 1173 $data['tags'] = $product_biz_tags; 1174 } 1138 1175 1139 1176 /** -
subscribility/tags/2.9.5/includes/frontend/controllers/class-wp99234-wc-filter.php
r2128705 r2139157 484 484 $customer_data = array( 485 485 'customer' => array( 486 'fname' => $order->get_billing_first_name(),487 'lname' => $order->get_billing_last_name(),488 'email' => $order->get_billing_email(),489 'phone' => $order->get_billing_phone(),490 'company_name' => $order->get_billing_company(),491 'delivery_address' => $order->get_billing_address_1(),492 'delivery_suburb' => $order->get_billing_city(),493 'delivery_postcode' => $order->get_billing_postcode(),494 'delivery_state' => $order->get_billing_state(),495 'delivery_country' => WC()->countries->countries[ $order->get_billing_country() ],496 'notify_shipments' => '@|mail'497 )486 'fname' => $order->get_billing_first_name(), 487 'lname' => $order->get_billing_last_name(), 488 'email' => $order->get_billing_email(), 489 'phone' => $order->get_billing_phone(), 490 'company_name' => $order->get_billing_company(), 491 'delivery_address' => $order->get_billing_address_1(), 492 'delivery_suburb' => $order->get_billing_city(), 493 'delivery_postcode' => $order->get_billing_postcode(), 494 'delivery_state' => $order->get_billing_state(), 495 'delivery_country' => WC()->countries->countries[ $order->get_billing_country() ], 496 'notify_shipments' => '@|mail' 497 ) 498 498 ); 499 499 … … 550 550 $shipping = array_values($order->get_shipping_methods()); 551 551 $shipping_method = $shipping ? explode(":", $shipping[0]->get_method_id())[0] : null; 552 // $shipping_cost = $shipping ? explode(":", $shipping[0]->get_total())[0] : null; 552 553 553 554 if($shipping_method == 'local_pickup'){ … … 581 582 ) 582 583 ); 583 } 584 585 if ($shipping_method == 'free_shipping') { 586 $order_data['shipments']['shipping_fee_override'] = 0; 587 } 588 } 584 589 585 590 $message .= '\nGetting orderlines for the order'; … … 603 608 604 609 $message .= '\nExporting order to Troly'; 605 606 610 607 611 // If we were editing an order -
subscribility/tags/2.9.5/includes/frontend/views/newsletter_form.php
r2068621 r2139157 25 25 26 26 <div class="woocommerce"> 27 <?php if ( !is_admin() ) { wc_print_notices();} ?>27 <?php if ( !is_admin() ) { if ( function_exists('wc_print_notices') ) { wc_print_notices(); } } ?> 28 28 </div> 29 29 -
subscribility/tags/2.9.5/includes/frontend/views/registration_form.php
r2102935 r2139157 46 46 border:1px solid #000; 47 47 float:left; 48 background-color: #F9F9F9; 48 49 /* Make text readable inverse background */ 50 background-color: transparent; 51 box-shadow: inset 0 0 5px #888888; 52 49 53 padding:20px; 50 54 margin-bottom:4%; … … 52 56 width: 100%; 53 57 position: relative; 58 } 59 60 /* Emphasize input fields to inverse background */ 61 .wp99234-input_field_text, #subs_birthday, 62 .wp99234-input_field_password, 63 .wp99234-input_field_textfield, 64 .wp99234-section.cc_details input[type="text"], 65 .wp99234-section.cc_details input[type="tel"] { 66 border-bottom: 1px solid gray; 54 67 } 55 68 … … 178 191 179 192 <div class="woocommerce wp99234_registration_notices"> 180 <?php if ( !is_admin() ) { wc_print_notices();} ?>193 <?php if ( !is_admin() ) { if ( function_exists('wc_print_notices') ) { wc_print_notices(); } } ?> 181 194 </div> 182 195 -
subscribility/tags/2.9.5/readme.txt
r2128705 r2139157 70 70 71 71 ## Changelog 72 ###Version 2.9.5 73 - Make Club box options readable even in inverse background/theme color 74 - Set as Virtual product if set in Troly 75 72 76 ###Version 2.9.4 73 77 - Fixed Syncing User's account to Troly after Placing Order -
subscribility/tags/2.9.5/wp99234.php
r2128705 r2139157 4 4 * Plugin URI: https://wordpress.org/plugins/subscribility/ 5 5 * Description: Manage and fulfil your sales of wine, beers and other crafted beverages, through clubs and other direct-to-consumer sales channels. 6 * Version: 2.9. 46 * Version: 2.9.5 7 7 * Author: Troly 8 8 * Author URI: https://troly.io -
subscribility/trunk/includes/admin/controllers/class-wp99234-admin-settings-data-collection.php
r2069102 r2139157 95 95 'id' => 'wp99234_product_sync', 96 96 'css' => 'min-width:550px;', 97 'default' => ' ',97 'default' => 'both', 98 98 'type' => 'select', 99 99 'desc_tip' => true, -
subscribility/trunk/includes/admin/controllers/class-wp99234-admin.php
r2048715 r2139157 46 46 add_action('woocommerce_product_options_general_product_data', array($this,'show_pack_prices')); 47 47 add_action('woocommerce_product_options_general_product_data', array($this,'show_member_prices')); 48 49 /* Customize Product Tags Labels */ 50 add_filter( 'woocommerce_taxonomy_args_product_tag', array($this, 'custom_wc_taxonomy_args_product_tag') ); 48 51 49 52 $this->admin_notices(); … … 632 635 echo '</div>'; 633 636 } 637 638 /** 639 * Display custom message for product tag 640 */ 641 function custom_wc_taxonomy_args_product_tag( $args ) { 642 // Get the Products data synchronisation option 643 $wp99234_product_sync_option = get_option('wp99234_product_sync', 'both'); 644 645 $tag_notice = 'You can remove Troly tags from the list below, however, these tags will still be present in Troly.'; 646 647 if (in_array($wp99234_product_sync_option, array('both', 'push'))) { 648 $tag_notice = 'You will not be able to remove Troly tags from the list below without disabling them in Troly first.'; 649 } 650 $args['label'] = __( 'Product Tags', 'woocommerce' ); 651 $args['labels'] = array( 652 'separate_items_with_commas' => __( "<p>$tag_notice</p><i>Separate tags with commas</i>", 'woocommerce' ), 653 ); 654 655 return $args; 656 } 634 657 } 635 658 -
subscribility/trunk/includes/frontend/controllers/class-wp99234-products.php
r2068621 r2139157 8 8 define( 'WP99234_TAG_VISIBLE' , 105 ); 9 9 define( 'WP99234_TAG_OUT_OF_STOCK', 108 ); 10 define( 'WP99234_VARIETY_VIRTUAL', 'virtual' ); 10 11 11 12 /** … … 445 446 446 447 // Array format: (WP attribute name => SUBS attribute name) 447 function product_meta_map() {448 448 function product_meta_map() 449 { 449 450 return array( 450 451 'subs_id' => 'id', … … 453 454 'foods' => 'foods', 454 455 'cellar_until' => 'cellar_until', 455 //'price' => 'price',456 456 'price_case' => 'price_case', 457 457 'price_6pk' => 'price_6pk', … … 473 473 '_te_divider' => 'te_divider', 474 474 '_split_ols' => 'split_ols', 475 //'product_prices' => 'product_prices', 476 //'_subproducts' => 'subproducts', 477 '_variety' => 'variety', 475 '_variety' => 'variety', // default to 'wine' 478 476 'is_composite' => 'is_composite' // Used to indicate if pack or not 479 477 ); 480 481 478 } 482 479 … … 570 567 update_post_meta( $product_id, '_regular_price' , $price ); 571 568 update_post_meta( $product_id, '_is_split' , $product->is_split ); 569 570 // Set Product as Virtual 571 // see: https://wordpress.stackexchange.com/questions/137501/how-to-add-product-in-woocommerce-with-php-code 572 if ( $product->variety === WP99234_VARIETY_VIRTUAL ) { 573 update_post_meta( $product_id, '_virtual', 'yes'); 574 } 572 575 573 576 /** … … 776 779 777 780 foreach( $product->tags as $tag ){ 781 $product_biz_attributes = get_option('product_biz_attributes', array()); 782 783 // create slug for the current tag 784 $slug = sanitize_title($tag->name); 785 786 // check and set unique attribute 787 $is_attribute = array_search($slug, $product_biz_attributes); 788 if ( !$is_attribute ) { 789 $new_tag[$slug] = (array)$tag; 790 $product_biz_attributes = array_merge($product_biz_attributes, $new_tag); 791 792 // Save Troly tag ids as option 793 update_option('product_biz_attributes', $product_biz_attributes, true); 794 } 778 795 779 796 $term = get_term_by( 'name', $tag->name, $this->tag_taxonomy_name ); … … 1075 1092 if( $update ){ 1076 1093 // Get the Products data synchronisation option 1077 $wp99234_product_sync_option = get_option('wp99234_product_sync' );1094 $wp99234_product_sync_option = get_option('wp99234_product_sync', 'both'); 1078 1095 1079 1096 // Only export to `both` and `push` synchronisation … … 1136 1153 ); 1137 1154 1155 /** 1156 * Add Product business attribute 1157 */ 1158 $post_tags = get_the_terms( $product_id, 'product_tag' ); 1159 $product_biz_attributes = get_option('product_biz_attributes', array()); 1160 1161 if (!empty($post_tags)) { 1162 $product_biz_tag_ids = array(); 1163 $product_biz_tags = array(); 1164 1165 foreach ($post_tags as $tag) { 1166 $slug = sanitize_title($tag->name); 1167 $this_tag = $product_biz_attributes[$slug]; 1168 $product_biz_tag_ids[] = $this_tag['id']; 1169 $product_biz_tags[] = $this_tag; 1170 } 1171 1172 $data['tag_ids'] = $product_biz_tag_ids; 1173 $data['tags'] = $product_biz_tags; 1174 } 1138 1175 1139 1176 /** -
subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-filter.php
r2128705 r2139157 484 484 $customer_data = array( 485 485 'customer' => array( 486 'fname' => $order->get_billing_first_name(),487 'lname' => $order->get_billing_last_name(),488 'email' => $order->get_billing_email(),489 'phone' => $order->get_billing_phone(),490 'company_name' => $order->get_billing_company(),491 'delivery_address' => $order->get_billing_address_1(),492 'delivery_suburb' => $order->get_billing_city(),493 'delivery_postcode' => $order->get_billing_postcode(),494 'delivery_state' => $order->get_billing_state(),495 'delivery_country' => WC()->countries->countries[ $order->get_billing_country() ],496 'notify_shipments' => '@|mail'497 )486 'fname' => $order->get_billing_first_name(), 487 'lname' => $order->get_billing_last_name(), 488 'email' => $order->get_billing_email(), 489 'phone' => $order->get_billing_phone(), 490 'company_name' => $order->get_billing_company(), 491 'delivery_address' => $order->get_billing_address_1(), 492 'delivery_suburb' => $order->get_billing_city(), 493 'delivery_postcode' => $order->get_billing_postcode(), 494 'delivery_state' => $order->get_billing_state(), 495 'delivery_country' => WC()->countries->countries[ $order->get_billing_country() ], 496 'notify_shipments' => '@|mail' 497 ) 498 498 ); 499 499 … … 550 550 $shipping = array_values($order->get_shipping_methods()); 551 551 $shipping_method = $shipping ? explode(":", $shipping[0]->get_method_id())[0] : null; 552 // $shipping_cost = $shipping ? explode(":", $shipping[0]->get_total())[0] : null; 552 553 553 554 if($shipping_method == 'local_pickup'){ … … 581 582 ) 582 583 ); 583 } 584 585 if ($shipping_method == 'free_shipping') { 586 $order_data['shipments']['shipping_fee_override'] = 0; 587 } 588 } 584 589 585 590 $message .= '\nGetting orderlines for the order'; … … 603 608 604 609 $message .= '\nExporting order to Troly'; 605 606 610 607 611 // If we were editing an order -
subscribility/trunk/includes/frontend/views/newsletter_form.php
r2068621 r2139157 25 25 26 26 <div class="woocommerce"> 27 <?php if ( !is_admin() ) { wc_print_notices();} ?>27 <?php if ( !is_admin() ) { if ( function_exists('wc_print_notices') ) { wc_print_notices(); } } ?> 28 28 </div> 29 29 -
subscribility/trunk/includes/frontend/views/registration_form.php
r2102935 r2139157 46 46 border:1px solid #000; 47 47 float:left; 48 background-color: #F9F9F9; 48 49 /* Make text readable inverse background */ 50 background-color: transparent; 51 box-shadow: inset 0 0 5px #888888; 52 49 53 padding:20px; 50 54 margin-bottom:4%; … … 52 56 width: 100%; 53 57 position: relative; 58 } 59 60 /* Emphasize input fields to inverse background */ 61 .wp99234-input_field_text, #subs_birthday, 62 .wp99234-input_field_password, 63 .wp99234-input_field_textfield, 64 .wp99234-section.cc_details input[type="text"], 65 .wp99234-section.cc_details input[type="tel"] { 66 border-bottom: 1px solid gray; 54 67 } 55 68 … … 178 191 179 192 <div class="woocommerce wp99234_registration_notices"> 180 <?php if ( !is_admin() ) { wc_print_notices();} ?>193 <?php if ( !is_admin() ) { if ( function_exists('wc_print_notices') ) { wc_print_notices(); } } ?> 181 194 </div> 182 195 -
subscribility/trunk/readme.txt
r2128705 r2139157 70 70 71 71 ## Changelog 72 ###Version 2.9.5 73 - Make Club box options readable even in inverse background/theme color 74 - Set as Virtual product if set in Troly 75 72 76 ###Version 2.9.4 73 77 - Fixed Syncing User's account to Troly after Placing Order -
subscribility/trunk/wp99234.php
r2128705 r2139157 4 4 * Plugin URI: https://wordpress.org/plugins/subscribility/ 5 5 * Description: Manage and fulfil your sales of wine, beers and other crafted beverages, through clubs and other direct-to-consumer sales channels. 6 * Version: 2.9. 46 * Version: 2.9.5 7 7 * Author: Troly 8 8 * Author URI: https://troly.io
Note: See TracChangeset
for help on using the changeset viewer.