Changeset 1934735
- Timestamp:
- 09/03/2018 01:12:12 AM (8 years ago)
- Location:
- devnet-eantrm/trunk
- Files:
-
- 1 added
- 10 edited
-
app/ctrs/BackEnd.php (modified) (13 diffs)
-
app/ctrs/FrondEnd.php (modified) (2 diffs)
-
app/views/ViewManageFormOrder.php (modified) (1 diff)
-
app/views/ViewPrice.php (modified) (2 diffs)
-
app/views/ViewTagInfusion.php (added)
-
assets/js/devnet.js (modified) (1 diff)
-
assets/js/infusionTags.js (modified) (1 diff)
-
assets/js/manageOrder.js (modified) (1 diff)
-
assets/js/viewlead.js (modified) (1 diff)
-
assets/js/viewprice.js (modified) (3 diffs)
-
enatrm.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
devnet-eantrm/trunk/app/ctrs/BackEnd.php
r1905131 r1934735 22 22 use DevNET\eAntRmConnector; 23 23 use EantRm\views\ViewDynamicField; 24 use EantRm\views\ViewTagInfusion; 24 25 25 26 class BackEnd … … 46 47 // add metadata of product item in an order added_{$meta_type}_meta 47 48 add_action ('added_order_item_meta',array(&$this,'add_order_product_bonus'),10,4); 49 add_action ('added_order_item_meta',array(&$this,'add_order_infusion_tags'),10,4); 48 50 add_action( 'woocommerce_checkout_order_processed', array(&$this, 'hooking_woocommerce_order_status_completed'), 10, 1 ); 49 51 } … … 85 87 wp_enqueue_script( 'devnet-infusion_tags', EANT_URL . '/assets/js/infusionTags.js', true ); 86 88 } 87 88 89 89 } 90 90 … … 105 105 return ViewManageFormOrder::manageformorder(); 106 106 } 107 107 108 function settings_page_google_shortlink(){ 108 109 return ViewGoogleShortLink::googleshortlink(); … … 124 125 return ViewCustomCss::customcss(); 125 126 } 126 127 127 128 128 function register_mysettings() { … … 145 145 } 146 146 147 148 147 function meta_boxs_register(){ 149 148 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 150 149 add_meta_box('earnt_product_config','Cấu hình hoa hồng CTV - eAntRM',array(&$this,'earnt_product_config'),'product'); 151 150 add_meta_box('earnt_order_info','eAntRM Referral Information',array(&$this,'earnt_order_info'),'shop_order'); 151 add_meta_box('earnt_infusion_tags','eAntRM Tag Infusion',array(&$this,'earnt_infusion_tags'),'product'); 152 152 } 153 153 … … 189 189 return ViewEarnt::earnt_view($post); 190 190 } 191 function earnt_infusion_tags($post){ 192 return ViewTagInfusion::earnt_tag_infusion_view($post); 193 } 191 194 192 195 function add_affiliate_order( $post_id, $post, $update ) { … … 211 214 if($products){ 212 215 $items = array(); 216 $customer['infusion_tags'] = ''; 213 217 foreach ($products as $product){ 214 218 $properties = json_decode($product->properties); 219 if($properties->productmethod_id=="flat_rate" || $properties->productmethod_id=="free_shipping" || $properties->productmethod_id=="local_pickup") 220 continue; 215 221 216 222 $item['sale_amount']= $properties->product_line_subtotal/$properties->product_qty; … … 220 226 $item['product']=$product->name; 221 227 $item['bonus']= intval($properties->product_bonus); 228 $infusion = explode('|',$properties->product_infusion); 229 $customer['infusion_tags'] .= $infusion[0].'|'.$infusion[1] . ';'; 222 230 $item['quantity'] = $properties->product_qty; 223 231 $items[]= $item; 232 224 233 } 225 226 234 $customer['fullname'] = get_post_meta($post_id,'_billing_first_name',true).' '.get_post_meta($post_id,'_billing_last_name',true) ; 227 235 $customer['email'] = get_post_meta($post_id,'_billing_email',true) ; … … 229 237 $ctm_address = get_post_meta($post_id,'_billing_address_1',true) ; 230 238 $ctm_address?$customer['address']=$ctm_address:$customer['address']='Chưa cập nhật'; 239 //var_dump($customer); die(); 231 240 $customer['message'] = 'test' ; 232 241 $website = $_SERVER['SERVER_NAME']; … … 253 262 update_post_meta( $post_id, '_rm_sent', true ); 254 263 } 255 256 257 264 } 258 265 } … … 269 276 $bonus = $_POST['earnt_bonus']; 270 277 update_post_meta( $post_id, '_earnt_bonus', intval($bonus)); 271 return; 272 } 278 } 279 if('product' == $post_type){ 280 $infusion = $_POST['infusion_tags']; 281 update_post_meta( $post_id, '_infusion_tags', $infusion); 282 } 283 284 return; 273 285 } 274 286 … … 283 295 } 284 296 297 function add_order_infusion_tags($mid, $object_id, $meta_key, $_meta_value) 298 { 299 if('_product_id'==$meta_key){ 300 $infusion = get_post_meta($_meta_value,'_infusion_tags', true); 301 $infusion = $infusion?$infusion:0; 302 add_metadata( 'order_item', $object_id, '_infusion', $infusion, true); 303 } 304 } 305 285 306 } -
devnet-eantrm/trunk/app/ctrs/FrondEnd.php
r1832075 r1934735 51 51 $goto = $items->redirect; 52 52 $submit = $items->submit_btn; 53 $textGC= $items->textGC; 53 54 $style = $items->style; 54 55 $popupnotification = $items->popupsuccess; … … 72 73 )); 73 74 } 74 return ViewPrice::price_rm_devnet($name,$price,$commission,$bonus,$goto,$submit,$ popupnotification,$style,$coupon,$phone,$address,$note,$infusion_tags);75 return ViewPrice::price_rm_devnet($name,$price,$commission,$bonus,$goto,$submit,$textGC,$popupnotification,$style,$coupon,$phone,$address,$note,$infusion_tags); 75 76 } 76 77 -
devnet-eantrm/trunk/app/views/ViewManageFormOrder.php
r1909392 r1934735 109 109 <td> 110 110 <input class="successinp" type="checkbox" value="1" name="note" <?php if(get_data($setting,'note')==1) echo 'checked'; ?>> 111 </td> 112 </tr> 113 <tr> 114 <td class="typeform">Tùy chỉnh nội dung ghi chú:</td> 115 <td> 116 <input type="text" style="width: 190px;" required maxlength="250" placeholder="Ghi chú:" value="<?php echo get_data($setting,'textGC'); ?>" id="textGC" name="textGC"> 111 117 </td> 112 118 </tr> -
devnet-eantrm/trunk/app/views/ViewPrice.php
r1905131 r1934735 4 4 class ViewPrice{ 5 5 6 static function price_rm_devnet($name,$price,$commission,$bonus,$goto,$submit,$ popupnotification,$style,$coupon,$phone,$address,$note,$infusion_tags){6 static function price_rm_devnet($name,$price,$commission,$bonus,$goto,$submit,$textGC,$popupnotification,$style,$coupon,$phone,$address,$note,$infusion_tags){ 7 7 ob_start(); 8 8 ?> … … 40 40 </div> 41 41 <div class="rm-form-group txt-note" <?php if($note!=1) echo 'style="display: none"';?>> 42 <textarea type="text" name="note_rm" placeholder=" Ghi chú:" class="rm-form-control note_rm ma-15"></textarea>42 <textarea type="text" name="note_rm" placeholder="<?php echo $textGC ?>" class="rm-form-control note_rm ma-15"></textarea> 43 43 </div> 44 44 </div> -
devnet-eantrm/trunk/assets/js/devnet.js
r1691665 r1934735 42 42 ordering: false, 43 43 language:{ 44 "sProcessing": "Đang xử lý ...",44 "sProcessing": "Đang xử lý", 45 45 "sLengthMenu": "Xem _MENU_ mục", 46 46 "sZeroRecords": "Không tìm thấy dòng nào phù hợp", -
devnet-eantrm/trunk/assets/js/infusionTags.js
r1909392 r1934735 21 21 22 22 } else { 23 $('#infusion_tags').append('<option value=" abc">Chưa có tag</option>');23 $('#infusion_tags').append('<option value="">Chưa có tag</option>'); 24 24 } 25 25 } -
devnet-eantrm/trunk/assets/js/manageOrder.js
r1727882 r1934735 45 45 $frm.addClass('eant-order').addClass(classCss) 46 46 }); 47 48 49 // e.submit.keyup(function () {50 // $('.btn_eant_submit').text(e.submit.val());51 // }).change(function () {52 // $('.btn_eant_submit').text(e.submit.val());53 // });54 47 }; 55 48 -
devnet-eantrm/trunk/assets/js/viewlead.js
r1913917 r1934735 83 83 var check_href = a_href.indexOf(get_domain); 84 84 var tempaff = a_href.indexOf('/'); 85 if (!/\?eant=/g.test(href) && (check_href < 0 && tempaff !==0)) { 85 var tempref = a_href.indexOf('#'); 86 if (!/\?eant=/g.test(href) && (check_href < 0 && tempaff !==0 && tempref !==0)) { 86 87 var sym = (/\?/g.test(href) ? '&' : '?') + 'eant='; 87 88 $(this).attr('href', href + sym + eant); -
devnet-eantrm/trunk/assets/js/viewprice.js
r1797457 r1934735 20 20 $(e).attr('disabled','disabled'); 21 21 }); 22 $(form).find(".order_btn").val('Đang mua hàng...');22 $(form).find(".order_btn").val('Đang đăng ký'); 23 23 var goto = $(form).find(".goto").val(); 24 24 … … 65 65 } 66 66 else{ 67 alert("Đã mua hàngthành công!")67 alert("Đã đăng ký thành công!") 68 68 if(goto == ''){ 69 69 location.reload(); … … 82 82 $(e).removeAttr('disabled'); 83 83 }); 84 $(form).find('.order_btn').val(' Mua hàng');84 $(form).find('.order_btn').val('Đăng ký'); 85 85 } 86 86 }); -
devnet-eantrm/trunk/enatrm.php
r1913917 r1934735 4 4 Plugin URI: http://devnet.vn 5 5 Description: 6 Version: 6.4. 26 Version: 6.4.3 7 7 Author: DevNet Vietnam 8 8 */ … … 119 119 price int(11) NOT NULL, 120 120 popupsuccess text NOT NULL, 121 textGC text NOT NULL, 121 122 style varchar(50) DEFAULT 'default' NOT NULL, 122 123 submit_btn varchar(50) DEFAULT '' NOT NULL, … … 125 126 address int(1), 126 127 note int(1), 127 infusion_tags varchar(50 ) DEFAULT '' NOT NULL,128 infusion_tags varchar(500) DEFAULT '' NOT NULL, 128 129 PRIMARY KEY (id) 129 130 ) $charset_collate;";
Note: See TracChangeset
for help on using the changeset viewer.