Plugin Directory

Changeset 1934735


Ignore:
Timestamp:
09/03/2018 01:12:12 AM (8 years ago)
Author:
devnetvietnam
Message:

update view tag infusion in woo

Location:
devnet-eantrm/trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • devnet-eantrm/trunk/app/ctrs/BackEnd.php

    r1905131 r1934735  
    2222use DevNET\eAntRmConnector;
    2323use EantRm\views\ViewDynamicField;
     24use EantRm\views\ViewTagInfusion;
    2425
    2526class BackEnd
     
    4647            // add metadata of product item in an order added_{$meta_type}_meta
    4748            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);
    4850            add_action( 'woocommerce_checkout_order_processed', array(&$this, 'hooking_woocommerce_order_status_completed'), 10, 1 );
    4951        }
     
    8587            wp_enqueue_script( 'devnet-infusion_tags', EANT_URL . '/assets/js/infusionTags.js', true );
    8688        }
    87 
    88 
    8989    }
    9090
     
    105105        return ViewManageFormOrder::manageformorder();
    106106    }
     107
    107108    function settings_page_google_shortlink(){
    108109        return ViewGoogleShortLink::googleshortlink();
     
    124125        return ViewCustomCss::customcss();
    125126    }
    126 
    127127
    128128    function register_mysettings() {
     
    145145    }
    146146
    147 
    148147    function meta_boxs_register(){
    149148        if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    150149            add_meta_box('earnt_product_config','Cấu hình hoa hồng CTV - eAntRM',array(&$this,'earnt_product_config'),'product');
    151150            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');
    152152        }
    153153
     
    189189        return ViewEarnt::earnt_view($post);
    190190    }
     191    function earnt_infusion_tags($post){
     192        return ViewTagInfusion::earnt_tag_infusion_view($post);
     193    }
    191194
    192195    function add_affiliate_order( $post_id, $post, $update ) {
     
    211214            if($products){
    212215                $items = array();
     216                $customer['infusion_tags'] = '';
    213217                foreach ($products as $product){
    214218                    $properties = json_decode($product->properties);
     219                    if($properties->productmethod_id=="flat_rate" || $properties->productmethod_id=="free_shipping"  ||  $properties->productmethod_id=="local_pickup")
     220                        continue;
    215221
    216222                    $item['sale_amount']= $properties->product_line_subtotal/$properties->product_qty;
     
    220226                    $item['product']=$product->name;
    221227                    $item['bonus']= intval($properties->product_bonus);
     228                    $infusion = explode('|',$properties->product_infusion);
     229                    $customer['infusion_tags'] .= $infusion[0].'|'.$infusion[1] . ';';
    222230                    $item['quantity'] = $properties->product_qty;
    223231                    $items[]= $item;
     232
    224233                }
    225 
    226234                $customer['fullname'] = get_post_meta($post_id,'_billing_first_name',true).' '.get_post_meta($post_id,'_billing_last_name',true) ;
    227235                $customer['email'] = get_post_meta($post_id,'_billing_email',true) ;
     
    229237                $ctm_address = get_post_meta($post_id,'_billing_address_1',true) ;
    230238                $ctm_address?$customer['address']=$ctm_address:$customer['address']='Chưa cập nhật';
     239                //var_dump($customer);                die();
    231240                $customer['message'] = 'test' ;
    232241                $website = $_SERVER['SERVER_NAME'];
     
    253262                update_post_meta( $post_id, '_rm_sent', true );
    254263            }
    255 
    256 
    257264        }
    258265    }
     
    269276            $bonus = $_POST['earnt_bonus'];
    270277            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;
    273285    }
    274286
     
    283295    }
    284296
     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
    285306}
  • devnet-eantrm/trunk/app/ctrs/FrondEnd.php

    r1832075 r1934735  
    5151            $goto = $items->redirect;
    5252            $submit = $items->submit_btn;
     53            $textGC= $items->textGC;
    5354            $style = $items->style;
    5455            $popupnotification = $items->popupsuccess;
     
    7273                    ));
    7374            }
    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);
    7576        }
    7677
  • devnet-eantrm/trunk/app/views/ViewManageFormOrder.php

    r1909392 r1934735  
    109109                            <td>
    110110                                <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">
    111117                            </td>
    112118                        </tr>
  • devnet-eantrm/trunk/app/views/ViewPrice.php

    r1905131 r1934735  
    44class ViewPrice{
    55
    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){
    77       ob_start();
    88       ?>
     
    4040                                    </div>
    4141                                    <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>
    4343                                    </div>
    4444                                </div>
  • devnet-eantrm/trunk/assets/js/devnet.js

    r1691665 r1934735  
    4242        ordering: false,
    4343        language:{
    44             "sProcessing":   "Đang xử lý...",
     44            "sProcessing":   "Đang xử lý",
    4545            "sLengthMenu":   "Xem _MENU_ mục",
    4646            "sZeroRecords":  "Không tìm thấy dòng nào phù hợp",
  • devnet-eantrm/trunk/assets/js/infusionTags.js

    r1909392 r1934735  
    2121
    2222            } else {
    23                 $('#infusion_tags').append('<option value="abc">Chưa có tag</option>');
     23                $('#infusion_tags').append('<option value="">Chưa có tag</option>');
    2424            }
    2525        }
  • devnet-eantrm/trunk/assets/js/manageOrder.js

    r1727882 r1934735  
    4545                $frm.addClass('eant-order').addClass(classCss)
    4646            });
    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             // });
    5447        };
    5548
  • devnet-eantrm/trunk/assets/js/viewlead.js

    r1913917 r1934735  
    8383                var check_href = a_href.indexOf(get_domain);
    8484                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)) {
    8687                    var sym = (/\?/g.test(href) ? '&' : '?') + 'eant=';
    8788                    $(this).attr('href', href + sym + eant);
  • devnet-eantrm/trunk/assets/js/viewprice.js

    r1797457 r1934735  
    2020            $(e).attr('disabled','disabled');
    2121        });
    22         $(form).find(".order_btn").val('Đang mua hàng...');
     22        $(form).find(".order_btn").val('Đang đăng ký');
    2323        var goto = $(form).find(".goto").val();
    2424
     
    6565                        }
    6666                        else{
    67                             alert("Đã mua hàng thành công!")
     67                            alert("Đã đăng ký thành công!")
    6868                            if(goto == ''){
    6969                                location.reload();
     
    8282                    $(e).removeAttr('disabled');
    8383                });
    84                 $(form).find('.order_btn').val('Mua hàng');
     84                $(form).find('.order_btn').val('Đăng ký');
    8585            }
    8686        });
  • devnet-eantrm/trunk/enatrm.php

    r1913917 r1934735  
    44Plugin URI: http://devnet.vn
    55Description:
    6 Version: 6.4.2
     6Version: 6.4.3
    77Author: DevNet Vietnam
    88*/
     
    119119          price int(11) NOT NULL,
    120120          popupsuccess text NOT NULL,
     121          textGC text NOT NULL,
    121122          style varchar(50) DEFAULT 'default' NOT NULL,
    122123          submit_btn varchar(50) DEFAULT '' NOT NULL,
     
    125126          address int(1),
    126127          note int(1),
    127           infusion_tags varchar(50) DEFAULT '' NOT NULL,
     128          infusion_tags varchar(500) DEFAULT '' NOT NULL,
    128129          PRIMARY KEY  (id)
    129130        ) $charset_collate;";
Note: See TracChangeset for help on using the changeset viewer.