Changeset 3283660
- Timestamp:
- 04/28/2025 08:12:02 PM (11 months ago)
- Location:
- universam-demo/trunk
- Files:
-
- 19 deleted
- 32 edited
-
admin/assets/css/admin.css (modified) (1 diff)
-
admin/assets/js/setup-wizard.js (modified) (2 diffs)
-
admin/assets/js/tabs/files.js (modified) (2 diffs)
-
admin/includes/admin_ajax.php (modified) (1 diff)
-
admin/includes/form/import-form.php (modified) (2 diffs)
-
admin/includes/product/product-metabox.class.php (modified) (1 diff)
-
admin/includes/setup-wizard.class.php (modified) (2 diffs)
-
admin/includes/user_profile_fields.class.php (modified) (2 diffs)
-
admin/pages/files.php (deleted)
-
admin/tabs/files.php (modified) (1 diff)
-
admin/tabs/general.php (modified) (1 diff)
-
admin/tabs/my_files.php (modified) (1 diff)
-
admin/templates/template-parts/type-option.php (modified) (1 diff)
-
assets/images/deals-bg.png (deleted)
-
assets/images/descript.png (deleted)
-
assets/images/feat-ite.png (deleted)
-
assets/images/featured.png (deleted)
-
assets/images/featuree.png (deleted)
-
includes/application.class.php (modified) (1 diff)
-
includes/constants.php (modified) (2 diffs)
-
includes/crm/company_importer.class.php (modified) (1 diff)
-
includes/crm/contact_importer.class.php (modified) (1 diff)
-
includes/document/document-importer.class.php (modified) (1 diff)
-
includes/exchange/API/register_rest_route.php (modified) (2 diffs)
-
includes/exchange/API/rest_route/API.php (modified) (3 diffs)
-
includes/exchange/data_exchange.class.php (modified) (1 diff)
-
includes/exchange/exchange_rule.class.php (modified) (4 diffs)
-
includes/exchange/integration_service.class.php (modified) (3 diffs)
-
includes/integration/applications/sokolov.php (modified) (1 diff)
-
includes/integration/applications/vavto.php (modified) (1 diff)
-
includes/personnel/personnel.php (modified) (1 diff)
-
includes/post-types.class.php (modified) (1 diff)
-
includes/product/product-template.php (modified) (1 diff)
-
includes/product/product.class.php (modified) (1 diff)
-
includes/product/product_importer.class.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
-
resources/PhpSpreadsheet/CHANGELOG.md (deleted)
-
resources/PhpSpreadsheet/CONTRIBUTING.md (deleted)
-
resources/PhpSpreadsheet/vendor/composer/pcre/README.md (deleted)
-
resources/PhpSpreadsheet/vendor/maennchen/zipstream-php/README.md (deleted)
-
resources/PhpSpreadsheet/vendor/markbaker/complex/README.md (deleted)
-
resources/PhpSpreadsheet/vendor/markbaker/matrix/README.md (deleted)
-
resources/PhpSpreadsheet/vendor/psr/http-client/README.md (deleted)
-
resources/PhpSpreadsheet/vendor/psr/http-factory/README.md (deleted)
-
resources/PhpSpreadsheet/vendor/psr/http-message/README.md (deleted)
-
resources/PhpSpreadsheet/vendor/psr/simple-cache/README.md (deleted)
-
resources/dompdf/CONTRIBUTING.md (deleted)
-
resources/dompdf/SECURITY.md (deleted)
-
resources/dompdf/lib/fonts/mustRead.html (deleted)
-
theme/usam-global-style.css (modified) (1 diff)
-
universam.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
universam-demo/trunk/admin/assets/css/admin.css
r3282898 r3283660 92 92 .site-slider{overflow-x:hidden;} 93 93 94 .sticky-section-tabs{position:sticky; top:0; background:#fff; z-index:1; padding-top:20px;} 94 95 .section_tabs{display:flex; margin-bottom:20px; gap:10px} 95 96 .section_tab{padding:5px 10px; background-color:#fff; border-radius:5px; cursor:pointer; border:1px solid #ddd; white-space:nowrap; -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none;} -
universam-demo/trunk/admin/assets/js/setup-wizard.js
r3234981 r3283660 11 11 delivery_services:[], 12 12 payment_services:[], 13 applications:[], 13 14 tracker:true 14 15 } … … 100 101 } 101 102 break; 103 case 'applications': 104 for (let j in this.options[i].value) 105 usam_api('application', {active:0, service_code:this.options[i].value[j]}, 'POST'); 106 break; 102 107 default: 103 108 if( !this.options[i].option ) -
universam-demo/trunk/admin/assets/js/tabs/files.js
r3201974 r3283660 317 317 downloadFolder(){ 318 318 usam_active_loader(); 319 usam_ send({action: 'download_folder', 'id': this.folders[this.folder_menu].id, nonce: USAM_Page_files.download_folder_nonce});319 usam_api('folder/'+this.folders[this.folder_menu].id+'/download', 'GET'); 320 320 }, 321 321 renameFolder(e){ … … 324 324 fileDownload(e){ 325 325 usam_active_loader(); 326 usam_ send({action: 'download_file', 'id': this.files[this.file_menu].id, nonce: USAM_Page_files.download_file_nonce});326 usam_api('file/'+this.files[this.file_menu].id+'/download', 'GET'); 327 327 }, 328 328 restoreFile(e) -
universam-demo/trunk/admin/includes/admin_ajax.php
r3269096 r3283660 318 318 } 319 319 return false; 320 }321 322 protected function controller_download_folder()323 {324 $folder_id = sanitize_text_field( $_REQUEST['id'] );325 $folder = usam_get_folder( $folder_id );326 usam_get_folders(['child_of' => $folder_id, 'cache_results' => true]); // КЕШИРОВАНИЕ327 $folder_path = usam_zip_archive_folder( $folder_id );328 ob_start();329 readfile($folder_path);330 $data = ob_get_clean();331 unlink( $folder_path );332 return ["download" => "data:application/octet-stream;base64,".base64_encode($data), 'title' => $folder['name'].".zip"];333 }334 335 protected function controller_download_file()336 {337 $id = sanitize_text_field( $_REQUEST['id'] );338 $file = usam_get_file( $id );339 ob_start();340 readfile(USAM_UPLOAD_DIR.$file['file_path']);341 $data = ob_get_clean();342 return ["download" => "data:application/octet-stream;base64,".base64_encode($data), 'title' => $file['title']];343 320 } 344 321 -
universam-demo/trunk/admin/includes/form/import-form.php
r3261943 r3283660 26 26 protected function get_data_tab() 27 27 { 28 $default = ['id' => 0, 'name' => __('Новый шаблон', 'usam'), 'existence_check' => 'code', 'manager_id' => 0, 'bank_account_id' => 0, 'status' => '', 'headings' => 0, 'type_import' => '', 'encoding' => '', 's plitting_array' => '|', 'schedule' => '', 'exchange_option' => '', 'file_data' => '', 'type' => $this->rule_type, 'type_file' => 'csv3', 'time' => '00:00', 'start_line' => 0, 'end_line' => 0, 'delete_file' => 1, 'columns' => [], 'columns2' => [], 'exception' => [], 'processing_rules' => [], 'data' => [], 'to_email' => '', 'subject' => '', 'groups' => [], 'after_exchange' => 0, 'check_data' => ['row' => '', 'column' => '', 'condition' => 'like', 'value' => '']];28 $default = ['id' => 0, 'name' => __('Новый шаблон', 'usam'), 'existence_check' => 'code', 'manager_id' => 0, 'bank_account_id' => 0, 'status' => '', 'headings' => 0, 'type_import' => '', 'encoding' => '', 'schedule' => '', 'exchange_option' => '', 'file_data' => '', 'type' => $this->rule_type, 'type_file' => 'csv3', 'time' => '00:00', 'start_line' => 0, 'end_line' => 0, 'delete_file' => 1, 'columns' => [], 'columns2' => [], 'exception' => [], 'processing_rules' => [], 'data' => [], 'to_email' => '', 'subject' => '', 'groups' => [], 'after_exchange' => 0, 'check_data' => ['row' => '', 'column' => '', 'condition' => 'like', 'value' => '']]; 29 29 $this->js_args['existence_check'] = ['code' => __( 'По внешнему коду', 'usam')]; 30 30 $product_existence_check = ['code' => __( 'По внешнему коду', 'usam'), 'sku' => __( 'По артикулу', 'usam'), 'barcode' => __( 'По штрихкоду', 'usam'), 'url' => __( 'По ссылке', 'usam')]; … … 209 209 </select> 210 210 </div> 211 </div>212 <div class ="edit_form__item">213 <div class ="edit_form__item_name"><?php esc_html_e( 'Разделение массивов', 'usam'); ?>:</div>214 <div class ="edit_form__item_option">215 <input id='splitting_arrays' type="text" v-model="data.splitting_array">216 </div>217 211 </div> 218 212 <div class ="edit_form__item"> -
universam-demo/trunk/admin/includes/product/product-metabox.class.php
r3282898 r3283660 99 99 $types_product = usam_get_types_products_sold(); 100 100 ?> 101 <site-slider >101 <site-slider classes="site-slider sticky-section-tabs"> 102 102 <template v-slot:body="sliderProps"> 103 103 <div class="section_tabs"> -
universam-demo/trunk/admin/includes/setup-wizard.class.php
r3234981 r3283660 96 96 ]); 97 97 } 98 $applications = [['id' => 'ozon', 'name' => 'Ozon'], ['id' => 'wildberries', 'name' => 'Wildberries'], ['id' => 'telphin', 'name' => 'АТС «Телфин.Офис»'], ['id' => 'moysklad', 'name' => 'Мой склад'], ['id' => 'evotor', 'name' => 'Эвотор'], ['id' => 'dadata', 'name' => 'DaData.ru']]; 99 if( !$demo_data ) 100 $selected_applications = ['ozon', 'wildberries', 'telphin', 'moysklad', 'evotor', 'dadata']; 98 101 $settings = array_merge( $settings, [ 99 102 /* ['tab' => 'information', 'field_type' => 'buttons', 'name' => __('Как вы работаете?', 'usam'), 'code' => 'installation', 'options' => [ … … 117 120 ['tab' => 'shipping_payments', 'field_type' => 'route', 'name' => __('Способы доставки', 'usam'), 'code' => 'delivery_services', 'multiple' => 1, 'route' => 'delivery_services', 'vars' => '{"active":"all"}', 'value' => $delivery_service], 118 121 ['tab' => 'shipping_payments', 'field_type' => 'route', 'name' => __('Варианты оплаты', 'usam'), 'code' => 'payment_services', 'multiple' => 1, 'route' => 'payment_services', 'vars' => '{"active":"all"}', 'value' => $gateways], 122 ['tab' => 'shipping_payments', 'field_type' => 'select', 'name' => __('Установить приложения', 'usam'), 'code' => 'applications', 'multiple' => 1, 'value' => $selected_applications, 'options' => $applications], 119 123 ]); 120 124 if ( ! current_user_can( 'install_themes' ) || ! current_user_can( 'switch_themes' ) || is_multisite() ) { -
universam-demo/trunk/admin/includes/user_profile_fields.class.php
r3282898 r3283660 16 16 { 17 17 if ( usam_check_current_user_role( 'administrator' ) || usam_check_current_user_role('editor') || usam_check_current_user_role('shop_manager') || usam_check_current_user_role('shop_crm') ) 18 { 19 $phone = get_the_author_meta('usam_phone', $user->ID); 20 $phone = usam_get_phone_format( $phone ); 21 18 { 22 19 $sip = get_the_author_meta('usam_sip', $user->ID); 23 20 ?> 24 21 <h3><?php _e('IP телефония', 'usam'); ?></h3> 25 <table class="form-table"> 26 <tr> 27 <th><?php esc_html_e( 'Телефон', 'usam'); ?></th> 28 <td> 29 <input type='text' value='<?php echo $phone; ?>' name='phone' /> 30 </td> 31 </tr> 22 <table class="form-table"> 32 23 <tr> 33 24 <th><?php esc_html_e( 'SIP (добавочный номер)', 'usam'); ?></th> … … 38 29 </table> 39 30 <?php 40 $mailboxes = usam_get_mailboxes( array( 'fields' => array( 'id','name'), 'user_id' => $user->ID ));31 $mailboxes = usam_get_mailboxes(['fields' => ['id','name'], 'user_id' => $user->ID]); 41 32 $email_default = esc_attr(get_the_author_meta('usam_email_default', $user->ID)); 42 33 ?> -
universam-demo/trunk/admin/tabs/files.php
r3218365 r3283660 1 1 <?php 2 class USAM_Tab_files extends USAM_ Tab2 class USAM_Tab_files extends USAM_Page_Tab 3 3 { 4 4 protected $views = ['grid', 'table', 'report', 'settings']; -
universam-demo/trunk/admin/tabs/general.php
r3269096 r3283660 57 57 'price_platform' => __('Прайс-площадка', 'usam') 58 58 ]], 59 ['block' => 'option_work', 'field_type' => 'select', 'name' => __('Продаваемые товары ', 'usam'), 'code' => 'types_products_sold', 'multiple' => 1, 'default' => ['product', 'services'], 'options' => $types_product_option],59 ['block' => 'option_work', 'field_type' => 'select', 'name' => __('Продаваемые товары/услуги', 'usam'), 'code' => 'types_products_sold', 'multiple' => 1, 'default' => ['product', 'services'], 'options' => $types_product_option], 60 60 ['block' => 'checkout_consent_processing_personal_data', 'field_type' => 'tinymce', 'name' => '', 'code' => 'consent_processing_personal_data', 'default' => ''], 61 61 ['block' => 'cookie_notice', 'field_type' => 'tinymce', 'name' => '', 'code' => 'cookie_notice', 'default' => ''], -
universam-demo/trunk/admin/tabs/my_files.php
r3168104 r3283660 1 1 <?php 2 class USAM_Tab_my_files extends USAM_ Tab2 class USAM_Tab_my_files extends USAM_Page_Tab 3 3 { 4 4 protected $views = ['grid', 'table']; -
universam-demo/trunk/admin/templates/template-parts/type-option.php
r3282898 r3283660 8 8 <size v-model="property.value" v-else-if="property.field_type=='size-css'"></size> 9 9 <border v-model="property.value" v-else-if="property.field_type=='border'"></border> 10 <color-picker :type="'hex'" v-model="property.value" :vars="siteColors" v-else-if="property.field_type=='color'" />10 <color-picker :type="'hex'" v-model="property.value" :vars="siteColors" v-else-if="property.field_type=='color'"></color-picker> 11 11 <div class="object_property attribute_buttons" v-else-if="property.field_type=='buttons' || property.field_type=='check'"> 12 12 <selector v-model="property.value" :items="property.options"></selector> -
universam-demo/trunk/includes/application.class.php
r3282898 r3283660 107 107 } 108 108 $result = json_decode($data['body'], true); 109 110 111 $Log = new USAM_Log_File( 'send_request' );112 $Log->fwrite_array( $url );113 $Log->fwrite_array( $params );114 $Log->fwrite_array( $result );115 116 109 return $this->handle_request( $result, $function, $params ); 117 110 } -
universam-demo/trunk/includes/constants.php
r3282898 r3283660 565 565 } 566 566 567 function usam_get_types_products_sold( )567 function usam_get_types_products_sold() 568 568 { 569 569 $products = [ … … 571 571 'service' => ['single' => __('Услуга', 'usam'), 'plural' => __('Услуги', 'usam')], 572 572 'subscription' => ['single' => __('Подписка', 'usam'), 'plural' => __('Подписки', 'usam')], 573 'tour' => ['single' => __('Тур', 'usam'), 'plural' => __('Туры', 'usam')], 573 574 'electronic_product' => ['single' => __('Электронный товар', 'usam'), 'plural' => __('Электронные товары', 'usam')] 574 575 ]; -
universam-demo/trunk/includes/crm/company_importer.class.php
r3234981 r3283660 68 68 if ( isset($row['group']) ) 69 69 { 70 $groups = explode($this->rule['splitting_array'], $row['group']);70 $groups = is_array($row['groups']) ? $row['groups'] : [$row['groups']]; 71 71 require_once( USAM_FILE_PATH.'/includes/crm/groups_query.class.php' ); 72 72 $groups = usam_get_groups(['type' => 'company', 'fields' => 'id', 'code' => $groups]); -
universam-demo/trunk/includes/crm/contact_importer.class.php
r3201974 r3283660 69 69 if ( isset($row['group']) ) 70 70 { 71 $groups = explode($this->rule['splitting_array'], $row['group']);71 $groups = is_array($row['groups']) ? $row['groups'] : [$row['groups']]; 72 72 require_once( USAM_FILE_PATH.'/includes/crm/groups_query.class.php' ); 73 73 $groups = usam_get_groups(['type' => 'contact', 'fields' => 'id', 'code' => $groups]); -
universam-demo/trunk/includes/document/document-importer.class.php
r3261943 r3283660 138 138 $groups = []; 139 139 if ( isset($new_data['groups']) ) 140 $groups = explode($new_data['groups'], $this->rule['splitting_array']);140 $groups = is_array($new_data['groups']) ? $new_data['groups'] : [$new_data['groups']]; 141 141 elseif( !empty($this->rule['groups']) ) 142 142 $groups = $this->rule['groups']; -
universam-demo/trunk/includes/exchange/API/register_rest_route.php
r3282898 r3283660 158 158 ], 159 159 ]); 160 register_rest_route( $this->namespace, '/file/(?P<id>\d+)/download', [ 161 [ 162 'methods' => 'GET', 163 'callback' => ['USAM_API', 'download_file'], 164 'permission_callback' => function( $request ){ 165 return current_user_can('universam_api') || current_user_can('view_all_files') || current_user_can('view_my_files'); 166 } 167 ] 168 ]); 160 169 register_rest_route( $this->namespace, '/upload', [ 161 170 [ … … 233 242 ], 234 243 ]); 244 register_rest_route( $this->namespace, '/folder/(?P<id>\d+)/download', [ 245 [ 246 'methods' => 'GET', 247 'callback' => ['USAM_API', 'download_folder'], 248 'permission_callback' => function( $request ){ 249 return current_user_can('universam_api') || current_user_can('view_all_files') || current_user_can('view_my_files'); 250 } 251 ] 252 ]); 253 235 254 register_rest_route( $this->namespace, '/notifications', [ 236 255 [ -
universam-demo/trunk/includes/exchange/API/rest_route/API.php
r3282898 r3283660 2029 2029 return usam_delete_file( $id ); 2030 2030 } 2031 2032 public static function download_file( WP_REST_Request $request ) 2033 { 2034 $id = $request->get_param( 'id' ); 2035 $file = usam_get_file( $id ); 2036 ob_start(); 2037 readfile(USAM_UPLOAD_DIR.$file['file_path']); 2038 $data = ob_get_clean(); 2039 return ["download" => "data:application/octet-stream;base64,".base64_encode($data), 'title' => $file['title']]; 2040 } 2031 2041 2032 2042 public static function get_folders( WP_REST_Request $request ) … … 2125 2135 $id = $request->get_param( 'id' ); 2126 2136 return usam_delete_folder( $id ); 2137 } 2138 2139 public static function download_folder( WP_REST_Request $request ) 2140 { 2141 $id = $request->get_param( 'id' ); 2142 $folder = usam_get_folder( $id ); 2143 usam_get_folders(['child_of' => $id, 'cache_results' => true]); // КЕШИРОВАНИЕ 2144 $folder_path = usam_zip_archive_folder( $id ); 2145 ob_start(); 2146 readfile($folder_path); 2147 $data = ob_get_clean(); 2148 unlink( $folder_path ); 2149 return ["download" => "data:application/octet-stream;base64,".base64_encode($data), 'title' => $folder['name'].".zip"]; 2127 2150 } 2128 2151 … … 3870 3893 if ( !$parameters ) 3871 3894 $parameters = $request->get_body_params(); 3872 $parameters = $request->get_json_params(); 3873 $integrations = usam_get_data_integrations( 'applications', ['name' => 'Name', 'icon' => 'Icon', 'group' => 'Group'] ); 3874 if ( isset($integrations[$parameters['service_code']]) ) 3875 $parameters['group_code'] = $integrations[$parameters['service_code']]['group']; 3895 $parameters = $request->get_json_params(); 3876 3896 $id = usam_insert_application( $parameters ); 3877 3897 $class = usam_get_class_application( $id ); -
universam-demo/trunk/includes/exchange/data_exchange.class.php
r3234981 r3283660 107 107 if( isset($this->rule['exception'][$key]['value']) && $this->rule['exception'][$key]['value'] !== '' ) 108 108 { 109 $data = explode( $this->rule['splitting_array'],$this->rule['exception'][$key]['value']);109 $data = explode('|', $this->rule['exception'][$key]['value']); 110 110 foreach( $data as $r ) 111 111 { -
universam-demo/trunk/includes/exchange/exchange_rule.class.php
r3261943 r3283660 498 498 if ( is_array($value) ) 499 499 $value = array_map('strip_tags', $value); 500 else 500 elseif ( $value ) 501 501 $value = strip_tags( $value ); 502 502 break; … … 525 525 $value[$k] = rtrim($v, $rule['replace']); 526 526 } 527 else 527 elseif ( $value ) 528 528 $value = rtrim($value, $rule['replace']); 529 529 break; … … 532 532 { 533 533 foreach ($value as $k => $v) 534 $value[$k] = explode($ v, $rule['replace']);535 } 536 else 537 $value = explode($ value, $rule['replace']);534 $value[$k] = explode($rule['replace'], $v); 535 } 536 elseif ( $value ) 537 $value = explode($rule['replace'], $value); 538 538 break; 539 539 case 'float' : … … 552 552 $value[$k] = trim($v); 553 553 } 554 else 554 elseif ( $value ) 555 555 $value = trim($value); 556 556 break; -
universam-demo/trunk/includes/exchange/integration_service.class.php
r3201974 r3283660 212 212 global $wpdb; 213 213 214 do_action( 'usam_application_pre_save', $this ); 215 $where_col = $this->args['col']; 216 214 do_action( 'usam_application_pre_save', $this ); 217 215 $result = false; 218 if ( $ where_col)216 if ( $this->args['col'] ) 219 217 { 220 $where_val = $this->args['value']; 221 $where_format = self::get_column_format( $where_col ); 222 do_action( 'usam_application_pre_update', $this ); 223 $where = array( $this->args['col'] => $where_val); 218 $where_format = self::get_column_format( $this->args['col'] ); 219 do_action( 'usam_application_pre_update', $this ); 224 220 225 221 $this->data = apply_filters( 'usam_application_update_data', $this->data ); … … 228 224 $data = $this->data; 229 225 230 $result = $wpdb->update( USAM_TABLE_APPLICATIONS, $this->data, $where, $formats, array( $where_format ) );226 $result = $wpdb->update( USAM_TABLE_APPLICATIONS, $this->data, [$this->args['col'] => $this->args['value']], $formats, array( $where_format ) ); 231 227 if ( $result ) 232 228 $this->delete_cache( ); … … 237 233 do_action( 'usam_application_pre_insert' ); 238 234 if ( isset($this->data['id']) ) 239 unset( $this->data['id'] ); 235 unset( $this->data['id'] ); 236 237 if( empty($this->data['service_code']) ) 238 return false; 239 240 $integrations = usam_get_data_integrations( 'applications', ['name' => 'Name', 'icon' => 'Icon', 'group' => 'Group'] ); 241 if ( isset($integrations[$this->data['service_code']]) ) 242 $this->data['group_code'] = $integrations[$this->data['service_code']]['group']; 240 243 241 244 $this->data = apply_filters( 'usam_application_insert_data', $this->data ); -
universam-demo/trunk/includes/integration/applications/sokolov.php
r3201974 r3283660 1 1 <?php 2 2 /* 3 Name: API сайта Соколов4 Description: Загружает товары с сайта Соколовна ваш сайт.3 Name: sokolov.ru 4 Description: Загружает товары с сайта sokolov.ru на ваш сайт. 5 5 Price: paid 6 6 Group: import_products -
universam-demo/trunk/includes/integration/applications/vavto.php
r3218365 r3283660 1 1 <?php 2 2 /* 3 Name: API сайтаv-avto.ru3 Name: v-avto.ru 4 4 Description: Загружает товары с сайта v-avto.ru на ваш сайт. 5 5 Price: paid -
universam-demo/trunk/includes/personnel/personnel.php
r3133815 r3283660 16 16 return $name; 17 17 } 18 19 function usam_get_manager_phone( $user_id = null )20 {21 if ( $user_id == null )22 $user_id = get_current_user_id();23 24 $phone = (int)get_the_author_meta('usam_phone', $user_id);25 return $phone;26 }27 28 18 29 19 function usam_get_manager_type_price( $user_id = null ) -
universam-demo/trunk/includes/post-types.class.php
r3099887 r3283660 64 64 $permalinks = get_option( 'usam_permalinks' ); 65 65 // Товары 66 $labels = [ 67 'name' => __('Товары' , 'usam'), 68 'singular_name' => __('Товар' , 'usam'), 69 'add_new' => __('Добавить товар' , 'usam'), 70 'add_new_item' => __('Добавить новый товар' , 'usam'), 71 'edit_item' => __('Изменить товар' , 'usam'), 72 'new_item' => __('Новый товар' , 'usam'), 73 'view_item' => __('Посмотреть товар' , 'usam'), 74 'search_items' => __('Поиск товаров' , 'usam'), 75 'not_found' => __('Товары не найдены' , 'usam'), 66 $types_product = usam_get_types_products_sold(); 67 $select_types_product = get_option('usam_types_products_sold', ['product', 'services'] ); 68 $singular_name = __('Товар', 'usam'); 69 if( count($select_types_product) == 1 ) 70 { 71 $key = array_shift($select_types_product); 72 if( $key == 'product' || $key == 'electronic_product' ) 73 $plural_name = __('Товары', 'usam'); 74 else 75 { 76 $plural_name = $types_product[$key]['plural']; 77 $singular_name = $types_product[$key]['single']; 78 } 79 } 80 else 81 $plural_name = __('Товары/услуги', 'usam'); 82 83 $add_new = sprintf(__('Добавить %s', 'usam'), $singular_name); 84 85 $labels = [ 86 'name' => $plural_name, 87 'singular_name' => $singular_name, 88 'add_new' => $add_new, 89 'add_new_item' => $add_new, 90 'edit_item' => __('Изменить товар', 'usam'), 91 'new_item' => __('Новый товар', 'usam'), 92 'view_item' => __('Посмотреть товар', 'usam'), 93 'search_items' => __('Поиск товаров', 'usam'), 94 'not_found' => __('Товары не найдены', 'usam'), 76 95 'not_found_in_trash' => __('Товары не найдены в корзине', 'usam'), 77 'menu_name' => __('Товары' , 'usam'),96 'menu_name' => $plural_name, 78 97 'featured_image' => __( 'Изображение товара', 'usam' ), 79 98 'set_featured_image' => __( 'Задать изображение товара', 'usam' ), -
universam-demo/trunk/includes/product/product-template.php
r3269096 r3283660 762 762 $do_not_show_in_features = usam_get_term_metadata($attribute['term_id'], 'do_not_show_in_features'); 763 763 if ( !empty($do_not_show_in_features) ) 764 continue; 765 $text = implode(', ', $attribute['value']);766 if ( usam_get_term_metadata($attribute['term_id'], 'switch_to_selection') )764 continue; 765 766 if( usam_get_term_metadata($attribute['term_id'], 'switch_to_selection') ) 767 767 { 768 $k = array_key_first($attribute['value']); 769 $text = "<a href='".rtrim(home_url( $attribute['slug'] ), '/')."/$k'>$text</a>"; 768 $text = []; 769 foreach( $attribute['value'] as $code => $value ) 770 $text[] = "<a href='".rtrim(home_url( $attribute['slug'] ), '/')."/$code'>$value</a>"; 771 $text = implode(', ',$text); 770 772 } 773 else 774 $text = implode(', ', $attribute['value']); 771 775 $i++; 772 776 $output .= "<div class='product_characteristics__attribute product_characteristic_".$attribute['slug']."'> -
universam-demo/trunk/includes/product/product.class.php
r3282898 r3283660 562 562 foreach( $attribute_value as $attribute) 563 563 { 564 if ( !is_numeric($attribute) && usam_attribute_stores_values( $field_type ) ) 565 $attribute = usam_insert_product_attribute_variant(['value' => $attribute, 'attribute_id' => $terms[$slug]]); 564 566 if ( !isset($attributes_bd[$slug]) || !in_array($attribute, $attributes_bd[$slug]) ) 565 { 566 if ( !is_numeric($attribute) && usam_attribute_stores_values( $field_type ) ) 567 $attribute = usam_insert_product_attribute_variant(['value' => $attribute, 'attribute_id' => $terms[$slug]]); 567 { 568 568 if ( $field_type == 'several_options' || $field_type == 'several_colors' ) 569 569 usam_add_product_attribute($this->product_id, $slug, $attribute, false ); -
universam-demo/trunk/includes/product/product_importer.class.php
r3255608 r3283660 24 24 $this->rule[$metadata->meta_key] = maybe_unserialize( $metadata->meta_value ); 25 25 } 26 $default = ['splitting_array' => '|'];27 $this->rule = array_merge( $default, $this->rule );28 if ( !$this->rule['splitting_array'] )29 $this->rule['splitting_array'] = '|';30 26 } 31 27 … … 193 189 $product['thumbnail'] = $row['thumbnail']; 194 190 if ( !empty($row['images']) ) 195 $product['media_url'] = explode($this->rule['splitting_array'],$row['images']);191 $product['media_url'] = is_array($row['images']) ? $row['images'] : [$row['images']]; 196 192 if ( !empty($row['not_limited']) ) 197 193 { … … 274 270 if ( !empty($row[$name]) ) 275 271 { 276 $terms = explode($this->rule['splitting_array'],$row[$name]);272 $terms = is_array($row[$name]) ? $row[$name] : [$row[$name]]; 277 273 if ( $name == 'category' ) 278 274 $terms = apply_filters( 'usam_product_import_categories', $terms, $this->rule, $row ); … … 301 297 $field_type = usam_get_term_metadata($attribute->term_id, 'field_type'); 302 298 if ( $field_type == 'several_options' || $field_type == 'several_colors' ) 303 $attribute_values[$attribute->slug] = explode($this->rule['splitting_array'], $row[$column]); 299 { 300 if( is_array($row[$column]) ) 301 $attribute_values[$attribute->slug] = $row[$column]; 302 else 303 $attribute_values[$attribute->slug] = [ $row[$column] ]; 304 } 304 305 else 305 306 $attribute_values[$attribute->slug] = $row[$column]; … … 326 327 $parent_term_id = $parent_term->term_id; 327 328 $product['variations'][$parent_term_id] = []; 328 $variations = explode( $this->rule['splitting_array'], $strings[1] );329 $variations = explode('|', $strings[1] ); 329 330 foreach ( $variations as $variation ) 330 331 { … … 384 385 if ( $product_id ) 385 386 { 386 if( !empty($row['crosssell']) ) 387 $related_products[$product_id]['crosssell'] = explode($this->rule['splitting_array'],$row['crosssell']); 388 if( !empty($row['similar']) ) 389 $related_products[$product_id]['similar'] = explode($this->rule['splitting_array'],$row['similar']); 387 foreach ( ['crosssell', 'similar'] as $name ) 388 if( !empty($row[$name]) ) 389 $related_products[$product_id][$name] = is_array($row[$name]) ? $row[$name] : [$row[$name]]; 390 390 if ( !empty($row['codes_additional_unit']) ) 391 391 { 392 392 $product_additional_units = []; 393 $codes_additional_unit = explode($this->rule['splitting_array'],$row['codes_additional_unit']);393 $codes_additional_unit = is_array($row['codes_additional_unit']) ? $row['codes_additional_unit'] : [$row['codes_additional_unit']]; 394 394 if ( !empty($row['additional_units']) ) 395 $additional_units = explode($this->rule['splitting_array'],$row['additional_units']);395 $additional_units = is_array($row['additional_units']) ? $row['additional_units'] : [$row['additional_units']]; 396 396 $p_unit_measure = usam_get_product_meta($product_id,'unit_measure'); 397 397 $p_unit = usam_get_product_meta( $product_id, 'unit' ); -
universam-demo/trunk/readme.txt
r3282898 r3283660 3 3 Tags: online store, ecommerce, shop, shopping cart, sell online 4 4 Requires at least: 6.6 5 Tested up to: 6. 66 Stable tag: 8.71.1 65 Tested up to: 6.8 6 Stable tag: 8.71.17 7 7 Requires PHP: 7.4 8 8 License: GPLv1 -
universam-demo/trunk/theme/usam-global-style.css
r3282898 r3283660 2235 2235 .html_block_search__panel_product_image{margin-right:20px; width:90px; display:flex; justify-content:center; align-items:center;} 2236 2236 .html_block_search__panel_product_name{font-size:14px; font-weight:400; line-height:17px; margin-bottom:5px;} 2237 .html_block_search__panel .html_block_search__panel_product_name a{color:var(--main-text-color)} 2237 2238 .html_block_search__panel_product_description{font-size:13px; line-height:16px; margin-bottom:4px} 2238 2239 .html_block_search__panel_product_content{width:100%} -
universam-demo/trunk/universam.php
r3282898 r3283660 4 4 * Plugin URI: https://wp-universam.ru 5 5 * Description: Платформа для управления бизнесом и интернет-магазином. Встроенный парсинг, CRM, соц. сети, мессенджеры, карты, план продаж, управление остатками, контакт-центр, коммерческие предложения, счета, акты, инструменты для продвижения сайта, конструктор отчетов, файлы, рассылки, СМС. 6 * Version: 8.71.1 66 * Version: 8.71.17 7 7 * Author: universam 8 8 * Author URI: https://wp-universam.ru … … 14 14 { 15 15 protected static $_instance = null; 16 private $version = '8.71.1 6';16 private $version = '8.71.17'; 17 17 public function __construct() 18 18 {
Note: See TracChangeset
for help on using the changeset viewer.