erce' ), array( 'status' => 404 ) ); } $method = $this->update_fields( $instance_id, $method, $request ); if ( is_wp_error( $method ) ) { return $method; } $data = $this->prepare_item_for_response( $method, $request ); return rest_ensure_response( $data ); } /** * Updates settings, order, and enabled status on create. * * @param int $instance_id Instance ID. * @param WC_Shipping_Method $method Shipping method data. * @param WP_REST_Request $request Request data. * * @return WC_Shipping_Method */ public function update_fields( $instance_id, $method, $request ) { global $wpdb; // Update settings if present. if ( isset( $request['settings'] ) ) { $method->init_instance_settings(); $instance_settings = $method->instance_settings; $errors_found = false; foreach ( $method->get_instance_form_fields() as $key => $field ) { if ( isset( $request['settings'][ $key ] ) ) { if ( is_callable( array( $this, 'validate_setting_' . $field['type'] . '_field' ) ) ) { $value = $this->{'validate_setting_' . $field['type'] . '_field'}( $request['settings'][ $key ], $field ); } else { $value = $this->validate_setting_text_field( $request['settings'][ $key ], $field ); } if ( is_wp_error( $value ) ) { $errors_found = true; break; } $instance_settings[ $key ] = $value; } } if ( $errors_found ) { return new WP_Error( 'rest_setting_value_invalid', __( 'An invalid setting value was passed.', 'woocommerce' ), array( 'status' => 400 ) ); } update_option( $method->get_instance_option_key(), apply_filters( 'woocommerce_shipping_' . $method->id . '_instance_settings_values', $instance_settings, $method ) ); } // Update order. if ( isset( $request['order'] ) ) { $wpdb->update( "{$wpdb->prefix}woocommerce_shipping_zone_methods", array( 'method_order' => absint( $request['order'] ) ), array( 'instance_id' => absint( $instance_id ) ) ); $method->method_order = absint( $request['order'] ); } // Update if this method is enabled or not. if ( isset( $request['enabled'] ) ) { if ( $wpdb->update( "{$wpdb->prefix}woocommerce_shipping_zone_methods", array( 'is_enabled' => $request['enabled'] ), array( 'instance_id' => absint( $instance_id ) ) ) ) { do_action( 'woocommerce_shipping_zone_method_status_toggled', $instance_id, $method->id, $request['zone_id'], $request['enabled'] ); $method->enabled = ( true === $request['enabled'] ? 'yes' : 'no' ); } } return $method; } /** * Prepare the Shipping Zone Method for the REST response. * * @param array $item Shipping Zone Method. * @param WP_REST_Request $request Request object. * @return WP_REST_Response $response */ public function prepare_item_for_response( $item, $request ) { $method = array( 'id' => $item->instance_id, 'instance_id' => $item->instance_id, 'title' => $item->instance_settings['title'] ?? $item->method_title, 'order' => $item->method_order, 'enabled' => ( 'yes' === $item->enabled ), 'method_id' => $item->id, 'method_title' => $item->method_title, 'method_description' => $item->method_description, 'settings' => $this->get_settings( $item ), ); $context = empty( $request['context'] ) ? 'view' : $request['context']; $data = $this->add_additional_fields_to_object( $method, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $request['zone_id'], $item->instance_id ) ); $response = $this->prepare_response_for_collection( $response ); return $response; } /** * Return settings associated with this shipping zone method instance. * * @param WC_Shipping_Method $item Shipping method data. * * @return array */ public function get_settings( $item ) { $item->init_instance_settings(); $settings = array(); foreach ( $item->get_instance_form_fields() as $id => $field ) { $data = array( 'id' => $id, 'label' => $field['title'], 'description' => empty( $field['description'] ) ? '' : $field['description'], 'type' => $field['type'], 'value' => $item->instance_settings[ $id ], 'default' => empty( $field['default'] ) ? '' : $field['default'], 'tip' => empty( $field['description'] ) ? '' : $field['description'], 'placeholder' => empty( $field['placeholder'] ) ? '' : $field['placeholder'], ); if ( ! empty( $field['options'] ) ) { $data['options'] = $field['options']; } $settings[ $id ] = $data; } return $settings; } /** * Prepare links for the request. * * @param int $zone_id Given Shipping Zone ID. * @param int $instance_id Given Shipping Zone Method Instance ID. * @return array Links for the given Shipping Zone Method. */ protected function prepare_links( $zone_id, $instance_id ) { $base = '/' . $this->namespace . '/' . $this->rest_base . '/' . $zone_id; $links = array( 'self' => array( 'href' => rest_url( $base . '/methods/' . $instance_id ), ), 'collection' => array( 'href' => rest_url( $base . '/methods' ), ), 'describes' => array( 'href' => rest_url( $base ), ), ); return $links; } /** * Get the Shipping Zone Methods schema, conforming to JSON Schema * * @return array */ public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'shipping_zone_method', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Shipping method instance ID.', 'woocommerce' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'instance_id' => array( 'description' => __( 'Shipping method instance ID.', 'woocommerce' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'title' => array( 'description' => __( 'Shipping method customer facing title.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'order' => array( 'description' => __( 'Shipping method sort order.', 'woocommerce' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), ), 'enabled' => array( 'description' => __( 'Shipping method enabled status.', 'woocommerce' ), 'type' => 'boolean', 'context' => array( 'view', 'edit' ), ), 'method_id' => array( 'description' => __( 'Shipping method ID.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'method_title' => array( 'description' => __( 'Shipping method title.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'method_description' => array( 'description' => __( 'Shipping method description.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'settings' => array( 'description' => __( 'Shipping method settings.', 'woocommerce' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'properties' => array( 'id' => array( 'description' => __( 'A unique identifier for the setting.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'label' => array( 'description' => __( 'A human readable label for the setting used in interfaces.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'A human readable description for the setting used in interfaces.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'type' => array( 'description' => __( 'Type of setting.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'enum' => array( 'text', 'email', 'number', 'color', 'password', 'textarea', 'select', 'multiselect', 'radio', 'image_width', 'checkbox' ), 'readonly' => true, ), 'value' => array( 'description' => __( 'Setting value.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), ), 'default' => array( 'description' => __( 'Default value for the setting.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'tip' => array( 'description' => __( 'Additional help text shown to the user about the setting.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'placeholder' => array( 'description' => __( 'Placeholder text to be displayed in text inputs.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), ), ), ); return $this->add_additional_fields_schema( $schema ); } } Коло-підкладка прозоре під свічник для підлоги купити в Україні у Дім Віри

Коло-підкладка прозоре під свічник для підлоги

250,00 

Коло-підкладка з термопластику (ПЕТ-поліефір) під свічники підлоги в декількох варіантах розмірів. Матеріал: ПЕТ-поліефір (термопластик).Розміри: товщина 1 мм, Ø на вибір.’>Коло-підкладка з термопластику (ПЕТ-поліефір) під свічники підлоги в декількох варіантах розмірів. Матеріал: ПЕТ-поліефір (термопластик).Розміри: товщина 1 мм, Ø на вибір.

SKU: 11c484ea9305
Category:

Опис

Коло-підкладка з термопластику (ПЕТ-поліефір) під свічники підлоги в декількох варіантах розмірів.

Матеріал: ПЕТ-поліефір (термопластик).
Розміри: товщина 1 мм, Ø на вибір.’>Коло-підкладка з термопластику (ПЕТ-поліефір) під свічники підлоги в декількох варіантах розмірів.

Матеріал: ПЕТ-поліефір (термопластик).
Розміри: товщина 1 мм, Ø на вибір.