Changeset 1525828
- Timestamp:
- 11/01/2016 09:27:49 AM (9 years ago)
- File:
-
- 1 edited
-
boxrunner/trunk/ichain.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boxrunner/trunk/ichain.php
r1462268 r1525828 298 298 <?php 299 299 } 300 301 /*function wc_bxr_add_product_cat_api_call($tag_name,$description) {302 $user_admin=current_user_can('administrator');303 if($user_admin){304 if (did_action('init') === 1) {305 global $wpdb;306 $result = wc_bxr_get_boxrunner_meta();307 $party_id = filter_var($result->party_id,FILTER_SANITIZE_STRING);308 $results = $wpdb->get_results('SELECT * FROM wp_term_taxonomy ORDER BY term_id DESC LIMIT 1', OBJECT);309 310 311 if (isset($party_id) && isset($results)) {312 foreach ($results as $row) {313 $new_id = (int) $row->term_id;314 }315 $ExternalID = $new_id;316 317 $category_info = array(318 "ProductCategoryID" => 0,319 "CategoryName" => $tag_name,320 "Description" => $description,321 "ExternalID" => (string) $ExternalID,322 "PartyID" => (int) $party_id,323 "Token" => wc_bxr_getiChain_token_auth()324 );325 326 $data_string = json_encode($category_info);327 $ch = curl_init($result->url . "/productCategory.create");328 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");329 curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);330 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);331 curl_setopt($ch, CURLOPT_HTTPHEADER, array(332 'Content-Type: application/json',333 'Content-Length: ' . strlen($data_string))334 );335 $res = curl_exec($ch);336 $info = json_decode($res);337 if ($info->Success) {338 339 }340 }341 }342 }343 }*/344 300 345 301 /* Added function */ … … 877 833 </th> 878 834 <td> 879 <input readonly name="consumer-key" type="text" id="consumer-key" aria-describedby="tagline-description" value="<?php print_r($consumer_key); ?>" class="regular-text">835 <input name="consumer-key" type="text" id="consumer-key" aria-describedby="tagline-description" value="" class="regular-text"> 880 836 </td> 881 837 </tr> … … 885 841 </th> 886 842 <td> 887 <input readonly name="consumer-secret" type="text" id="consumer-secret" aria-describedby="tagline-description" value="<?php print_r($consumer_secret); ?>" class="regular-text">843 <input name="consumer-secret" type="text" id="consumer-secret" aria-describedby="tagline-description" value="" class="regular-text"> 888 844 </td> 889 845 </tr>
Note: See TracChangeset
for help on using the changeset viewer.