[ 'label' => __( 'Example Product 2', 'wpforms-lite' ), 'quantity' => 2, 'amount' => wpforms_format_amount( 20, true ), 'is_hidden' => false, ], [ 'label' => __( 'Example Product 3', 'wpforms-lite' ), 'quantity' => 1, 'amount' => wpforms_format_amount( 10, true ), 'is_hidden' => false, ], ]; $total = 60; /** * Allow to filter items in the footer on the order summary table (builder screen). * * @since 1.8.7 * * @param array $fields Order summary footer. * @param int $total Fields total. */ $foot = (array) apply_filters( 'wpforms_forms_fields_payment_total_field_builder_order_summary_preview_foot', [], $total ); /** * Allow to filter builder order summary fields total. * * @since 1.8.7 * * @param string $total Fields total. */ $total = apply_filters( 'wpforms_forms_fields_payment_total_field_builder_order_summary_preview_total', $total ); $total = wpforms_format_amount( $total, true ); $foot[] = [ 'label' => __( 'Total', 'wpforms-lite' ), 'quantity' => '', 'amount' => $total, 'class' => 'wpforms-order-summary-preview-total', ]; $total_width = strlen( html_entity_decode( $total, ENT_COMPAT, 'UTF-8' ) ) + 4; /** * Allow to filter builder order summary total column width. * * @since 1.8.7 * * @param int $total_width Total column width. */ $total_width = (int) apply_filters( 'wpforms_forms_fields_payment_total_field_builder_order_summary_preview_total_width', $total_width ); return [ $items, $foot, $total_width ]; } /** * Prepare payment fields data for summary preview. * * @since 1.8.7 * * @param array $form_data Form data. * * @return array */ private function prepare_payment_fields_data( array $form_data ): array { $payment_fields = wpforms_payment_fields(); $fields = []; $foot = []; $total = 0; foreach ( $form_data['fields'] as $field ) { if ( ( ! isset( $field['price'] ) && empty( $field['choices'] ) ) || ! in_array( $field['type'], $payment_fields, true ) ) { continue; } $this->prepare_payment_field_choices( $field, $fields, $total ); $this->prepare_payment_field_single( $field, $fields, $total ); } /** * Allow to filter items in the order summary footer. * * @since 1.8.7 * * @param array $fields Fields. */ $foot = (array) apply_filters( 'wpforms_forms_fields_payment_total_field_order_summary_preview_foot', $foot ); $total = wpforms_format_amount( $total, true ); $foot[] = [ 'label' => __( 'Total', 'wpforms-lite' ), 'quantity' => '', 'amount' => $total, 'class' => 'wpforms-order-summary-preview-total', ]; return [ $fields, $foot, strlen( html_entity_decode( $total, ENT_COMPAT, 'UTF-8' ) ) + 3 ]; } /** * Prepare payment single data for summary preview. * * @since 1.8.7 * * @param array $field Field data. * @param array $fields Fields data. * @param float $total Fields total. */ private function prepare_payment_field_single( array $field, array &$fields, float &$total ) { if ( ! empty( $field['choices'] ) ) { return; } $quantity = $this->get_payment_field_min_quantity( $field ); $field_amount = ! empty( $field['price'] ) ? wpforms_sanitize_amount( $field['price'] ) * $quantity : 0; $fields[] = [ 'label' => $field['label'], 'quantity' => $this->get_payment_field_min_quantity( $field ), 'amount' => wpforms_format_amount( $field_amount, true ), 'is_hidden' => ! $quantity, 'class' => 'wpforms-order-summary-field', 'data' => [ 'field' => $field['id'], ], ]; $total += $field_amount; } /** * Prepare payment field choices data for summary preview. * * @since 1.8.7 * * @param array $field Field data. * @param array $fields Fields data. * @param float $total Fields total. */ private function prepare_payment_field_choices( array $field, array &$fields, float &$total ) { if ( empty( $field['choices'] ) ) { return; } $quantity = $this->get_payment_field_min_quantity( $field ); $default_choice_key = $this->get_classic_dropdown_default_choice_key( $field ); foreach ( $field['choices'] as $key => $choice ) { $choice_amount = ! empty( $choice['value'] ) ? wpforms_sanitize_amount( $choice['value'] ) * $quantity : 0; $is_default = ! empty( $choice['default'] ) || ( isset( $default_choice_key ) && (int) $key === $default_choice_key ); $fields[] = [ 'label' => $field['label'] . ' - ' . $choice['label'], 'quantity' => $quantity, 'amount' => wpforms_format_amount( $choice_amount, true ), 'is_hidden' => ! $is_default || ! $quantity, 'class' => 'wpforms-order-summary-field', 'data' => [ 'field' => $field['id'], 'choice' => $key, ], ]; if ( $is_default ) { $total += $choice_amount; } } } /** * Get classic dropdown default choice key. * * @since 1.8.7 * * @param array $field Field Settings. * * @return int|null */ private function get_classic_dropdown_default_choice_key( array $field ) { if ( $field['type'] !== 'payment-select' || $field['style'] !== 'classic' || ! empty( $field['placeholder'] ) ) { return null; } foreach ( $field['choices'] as $key => $choice ) { if ( ! isset( $choice['default'] ) ) { continue; } return (int) $key; } return array_key_first( $field['choices'] ); } /** * Get payment field minimum quantity. * * @since 1.8.7 * * @param array $field Field data. * * @return int */ private function get_payment_field_min_quantity( array $field ): int { if ( ! wpforms_payment_has_quantity( $field, $this->form_data ) || ! isset( $field['min_quantity'] ) ) { return 1; } return (int) $field['min_quantity']; } /** * Add class to the builder field preview. * * @since 1.8.7 * * @param string $css Class names. * @param array $field Field properties. * * @return string */ public function preview_field_class( $css, $field ) { if ( $field['type'] !== $this->type ) { return $css; } if ( $this->is_summary_enabled( $field ) ) { $css .= ' wpforms-summary-enabled'; } return $css; } /** * Add order summary to the confirmation settings. * * @since 1.8.7 * * @param WPForms_Builder_Panel_Settings $settings Settings. * @param int $field_id Field ID. */ public function add_confirmation_setting( $settings, int $field_id ) { wpforms_panel_field( 'toggle', 'confirmations', 'message_order_summary', $settings->form_data, esc_html__( 'Show order summary after confirmation message', 'wpforms-lite' ), [ 'input_id' => 'wpforms-panel-field-confirmations-message_order_summary-' . $field_id, 'input_class' => 'wpforms-panel-field-confirmations-message_order_summary', 'parent' => 'settings', 'subsection' => $field_id, ] ); } /** * Show order summary on the confirmation page. * * @since 1.8.7 * * @param array $confirmation Current confirmation data. * @param array $form_data Form data and settings. * @param array $fields Sanitized field data. * @param int $entry_id Entry id. */ public function order_summary_confirmation( array $confirmation, array $form_data, array $fields, int $entry_id ) { if ( empty( $confirmation['message_order_summary'] ) ) { return; } $total_exists = false; foreach ( $fields as $field ) { if ( $field['type'] !== $this->type ) { continue; } $total_exists = true; break; } // Check if total field exists on the form. if ( ! $total_exists ) { return; } echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo wpforms_process_smart_tags( '{order_summary}', $form_data, $fields, $entry_id ); echo '
'; } } Scumpiri generalizate la benzină şi motorină în weekend - Main News
Tuesday, May 21, 2024
Jurnalism corect


Scumpiri generalizate la benzină şi motorină în weekend

By news.ro , in Stirile zilei , at 22 ianuarie 2023

Liderul pieţei distribuitoare de carburanţi, OMV Petrom, a majorat în acest weekend preţul benzinei cu 5 bani/l, după cele 4 scumpiri repetate la carburanţi efectuate săptămâna trecută. Şi concurenţa a crescut preţurile, în special la motorină, aliniindu-le la cele rezultate în urma mişcărilor efectuate de liderului pieţei vineri, relevă date analizate de Profit.ro.

Faţă de ultima zi a anului trecut, în care a fost eliminată reducerea de 50 de bani convenită de Guvern şi companii, dar şi redusă acciza la nivelul minim UE, benzina s-a scumpit cu 49 de bani/l, iar motorina cu 51 de bani/l, în urma evoluţiei cotaţiilor internaţionale ale petrolului şi produselor petroliere.

În urma scumpirilor de sâmbătă, preţul benzinei standard a ajuns la staţiile Petrom din capitală la 6,44-6,505 lei/l, iar cel al motorinei standard la 7,60-7,63 lei/l, iar în cele OMV, la 6,55-6,59 lei/l, respectiv, 7,68-7,71 lei/l.

La rândul său, Lukoil a scumpit sâmbătă benzina cu un ban/l şi motorina cu 3 bani/l, iar MOL şi Rompetrol au majorat preţul motorinei standard cu 5 bani/l în ultimele 24 de ore, notează Profit.ro, prezentând şi un tabel cu evoluţia preţurilor.

Foto: Uniunea Europeană

Comentarii


    MainNews

    FREE
    VIEW