usk_is_edit_mode() ) { return ['usk-all-styles']; } else { return ['usk-font', 'usk-add-to-cart', 'usk-page-order']; } } public function has_widget_inner_wrapper(): bool { return !\Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); } protected function register_controls() { $this->start_controls_section( 'section_layout_thankyou_orders', [ 'label' => __( 'ThankYou Order', 'ultimate-store-kit' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_responsive_control( 'thankyou_spacing', [ 'label' => __( 'Spacing', 'ultimate-store-kit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}}' => '--usk-order-page-spacing: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'thankyou_show_order_id', [ 'label' => __( 'Show Order ID', 'ultimate-store-kit' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'separator' => 'after', ] ); $this->add_control( 'thankyou_order_received_text', [ 'label' => __( 'Description', 'ultimate-store-kit' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => ['active' => true], 'rows' => 5, 'default' => __( 'Thank you. Your order has been received.', 'ultimate-store-kit' ), 'placeholder' => __( 'Thank you. Your order has been received.', 'ultimate-store-kit' ), ] ); $this->add_control( 'thankyour_order_alignment', [ 'label' => __( 'Alignment', 'ultimate-store-kit' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'ultimate-store-kit' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'ultimate-store-kit' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'ultimate-store-kit' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => 'center', 'toggle' => false, 'selectors' => [ '{{WRAPPER}} .usk-page-order .usk-page-order-heading' => 'text-align:{{VALUE}}; display:block;', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_thankyou_orders_style', [ 'label' => __( 'Order Heading', 'ultimate-store-kit' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'thankyou_orders_background', 'label' => esc_html__( 'Background', 'ultimate-store-kit' ), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .usk-page-order .usk-page-order-heading', ] ); $this->add_control( 'thankyou_orders_border_color', [ 'label' => esc_html__( 'Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .usk-page-order-heading' => 'border-color: {{VALUE}};', ], ] ); $this->start_controls_tabs( 'tabs_style_thankyou_order' ); $this->start_controls_tab( 'tab_style_thankyou_order_heading', [ 'label' => __( 'Title', 'ultimate-store-kit' ), ] ); $this->add_control( 'heading_color', [ 'label' => __( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .usk-page-order-heading .thankyou-order-heading' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'heading_typography', 'label' => __( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .thankyou-order-heading', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_style_thankyou_order_desc', [ 'label' => __( 'Description', 'ultimate-store-kit' ), ] ); $this->add_control( 'desc_color', [ 'label' => __( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .thankyou-order-desc ' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'desc_typography', 'label' => __( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .thankyou-order-desc', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); // Order Details List Style Section $this->start_controls_section( 'section_style_order_details_list', [ 'label' => esc_html__( 'Order Card', 'ultimate-store-kit' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); // Container Style $this->add_control( 'order_list_container_heading', [ 'label' => esc_html__( 'Container', 'ultimate-store-kit' ), 'type' => Controls_Manager::HEADING, ] ); $this->add_responsive_control( 'order_list_columns', [ 'label' => esc_html__( 'Columns', 'ultimate-store-kit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 1, 'max' => 6, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .order_details' => 'grid-template-columns: repeat({{SIZE}}, 1fr);', ], ] ); $this->add_responsive_control( 'order_list_gap', [ 'label' => esc_html__( 'Gap', 'ultimate-store-kit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'default' => [ 'unit' => 'px', 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} .order_details' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); // Typography Style $this->add_control( 'order_list_typography_heading', [ 'label' => esc_html__( 'Items', 'ultimate-store-kit' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->start_controls_tabs( 'order_list_typography_tabs' ); $this->start_controls_tab( 'order_list_typography_wrapper', [ 'label' => esc_html__( 'Wrapper', 'ultimate-store-kit' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'order_list_item_background', 'label' => esc_html__( 'Background', 'ultimate-store-kit' ), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .order_details li', 'separator' => 'before', ] ); $this->add_control( 'order_list_item_border_color', [ 'label' => esc_html__( 'Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .order_details li' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'order_list_icon_color_style-border', [ 'label' => esc_html__( 'Style Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .order_details li, {{WRAPPER}} .usk-page-order .order_details li:last-of-type' => 'border-left-color: {{VALUE}} !important;', ], ] ); $this->end_controls_tab(); // Label Typography Tab $this->start_controls_tab( 'order_list_typography_label', [ 'label' => esc_html__( 'Label', 'ultimate-store-kit' ), ] ); $this->add_control( 'order_list_label_color', [ 'label' => esc_html__( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .order_details li .usk-label' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'order_list_label_typography', 'selector' => '{{WRAPPER}} .order_details li .usk-label', ] ); $this->end_controls_tab(); // Value Typography Tab $this->start_controls_tab( 'order_list_typography_value', [ 'label' => esc_html__( 'Value', 'ultimate-store-kit' ), ] ); $this->add_control( 'order_list_value_color', [ 'label' => esc_html__( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .order_details li .usk-value' => 'color: {{VALUE}};', ], 'default' => '#1e293b', ] ); $this->add_control( 'order_list_total_value_color', [ 'label' => esc_html__( 'Total Value Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .order_details li.total .usk-value' => 'color: {{VALUE}};', ], 'default' => '#0f766e', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'order_list_value_typography', 'selector' => '{{WRAPPER}} .order_details li .usk-value', ] ); $this->end_controls_tab(); // Icon Typography Tab $this->start_controls_tab( 'order_list_typography_icon', [ 'label' => esc_html__( 'Icon', 'ultimate-store-kit' ), ] ); $this->add_responsive_control( 'order_list_icon_size', [ 'label' => esc_html__( 'Size', 'ultimate-store-kit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 50, ], ], 'default' => [ 'unit' => 'px', 'size' => 24, ], 'selectors' => [ '{{WRAPPER}} .order_details li .usk-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'order_list_icon_global_color', [ 'label' => esc_html__( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .order_details li .usk-icon' => 'stroke: {{VALUE}}', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'style_section_order_details', [ 'label' => esc_html__( 'Order Details', 'ultimate-store-kit' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( 'order_details_title_tabs' ); $this->start_controls_tab( 'order_details_wrap_tab', [ 'label' => esc_html__( 'Wrapper', 'ultimate-store-kit' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'order_details_wrap_background', 'label' => esc_html__( 'Background', 'ultimate-store-kit' ), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-order-details', ] ); $this->add_control( 'order_details_wrap_border_color', [ 'label' => esc_html__( 'Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'order_details_heading_tab', [ 'label' => esc_html__( 'Title', 'ultimate-store-kit' ), ] ); $this->add_control( 'order_details_title_color', [ 'label' => esc_html__( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details__title' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'order_details_title_border_color', [ 'label' => esc_html__( 'Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details__title::after' => 'background: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'order_details_title_typography', 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-order-details__title', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'order_details_tabs_heading', [ 'label' => esc_html__( 'Table', 'ultimate-store-kit' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->start_controls_tabs( 'order_details_tabs_tables' ); $this->start_controls_tab( 'order_details_tabs_table_header', [ 'label' => esc_html__( 'Header', 'ultimate-store-kit' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'table_header_background', 'label' => esc_html__( 'Background', 'ultimate-store-kit' ), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-table thead , {{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tfoot tr:last-child', ] ); $this->add_control( 'table_header_color', [ 'label' => esc_html__( 'Text Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-table thead th, {{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tfoot tr:last-child th' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'table_header_typography', 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-table thead th', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'order_details_tabs_table_body', [ 'label' => esc_html__( 'Body', 'ultimate-store-kit' ), ] ); $this->add_control( 'table_body_odd_row', [ 'label' => esc_html__( 'Odd Row', 'ultimate-store-kit' ), 'type' => Controls_Manager::HEADING, ] ); $this->add_control( 'table_body_odd_row_bg_color', [ 'label' => esc_html__( 'Background Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-table tbody tr:nth-child(odd)' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'table_body_odd_row_text_color', [ 'label' => esc_html__( 'Text Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tbody tr:nth-child(odd) td.product-name a' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tbody tr:nth-child(odd) td .product-quantity' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tbody tr:nth-child(odd) td.product-total .amount' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'table_body_even_row', [ 'label' => esc_html__( 'Even Row', 'ultimate-store-kit' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'table_body_even_row_bg_color', [ 'label' => esc_html__( 'Background Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-table tbody tr:nth-child(even)' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'table_body_even_row_text_color', [ 'label' => esc_html__( 'Text Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tbody tr:nth-child(even) td.product-name a' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tbody tr:nth-child(even) td .product-quantity' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tbody tr:nth-child(even) td.product-total .amount' => 'color: {{VALUE}};', ], 'separator' => 'after', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'table_body_typography', 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-table tbody td', ] ); $this->add_control( 'table_body_meta_heading', [ 'label' => esc_html__( 'Meta Data', 'ultimate-store-kit' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'table_body_meta_color', [ 'label' => esc_html__( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name dl dt' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name dl dd' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name .wc-item-meta li' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name .wc-item-meta li p' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'table_body_meta_typography', 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name dl dt, {{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name dl dd, {{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name .wc-item-meta li, {{WRAPPER}} .usk-page-order .woocommerce-table tbody td.product-name .wc-item-meta li p', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'order_details_tabs_table_footer', [ 'label' => esc_html__( 'Footer', 'ultimate-store-kit' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'table_footer_background', 'label' => esc_html__( 'Background', 'ultimate-store-kit' ), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-table tfoot', ] ); $this->add_control( 'table_footer_text_color', [ 'label' => esc_html__( 'Text Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-table tfoot tr th' => 'color: {{VALUE}};', '{{WRAPPER}} .usk-page-order .woocommerce-table tfoot tr td' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'table_footer_total_color', [ 'label' => esc_html__( 'Total Amount Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .woocommerce-table tfoot tr:last-child td .amount' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'table_footer_typography', 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-table tfoot tr th, {{WRAPPER}} .usk-page-order .woocommerce-table tfoot tr td', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'order_again_button_heading', [ 'label' => esc_html__( 'Order Button', 'ultimate-store-kit' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->start_controls_tabs( 'order_again_button_tabs' ); $this->start_controls_tab( 'tab_order_again_button_normal', [ 'label' => __( 'Normal', 'ultimate-store-kit' ), ] ); $this->add_control( 'order_again_button_text_color', [ 'label' => __( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'order_again_button_background', 'label' => __( 'Background', 'ultimate-store-kit' ), 'types' => ['classic', 'gradient'], 'exclude' => ['image'], 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => '#1E87F0', ], ], 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'order_again_button_border', 'label' => __( 'Border', 'ultimate-store-kit' ), 'default' => 'n', 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button', ] ); $this->add_control( 'order_again_button_border_radius', [ 'label' => __( 'Border Radius', 'ultimate-store-kit' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'rem', '%'], 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'order_again_button_padding', [ 'label' => __( 'Padding', 'ultimate-store-kit' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'rem', '%'], 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'order_again_button_typography', 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'order_again_button_box_shadow', 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_order_again_button_hover', [ 'label' => __( 'Hover', 'ultimate-store-kit' ), ] ); $this->add_control( 'order_again_button_hover_color', [ 'label' => __( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button:hover' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'order_again_button_hover_border_color', [ 'label' => __( 'Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'order_again_button_border_border!' => 'none', ], 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button:hover' => 'border-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'order_again_button_hover_background', 'label' => __( 'Background', 'ultimate-store-kit' ), 'exclude' => ['image'], 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-order-details .order-again .button:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'styles_section_thankyou_address_details', [ 'label' => esc_html__( 'Address Details', 'ultimate-store-kit' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( 'thankyou_address_details_tabs' ); $this->start_controls_tab( 'thankyou_address_details_wrapper', [ 'label' => esc_html__( 'Wrapper', 'ultimate-store-kit' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'thankyou_address_details_background', 'label' => esc_html__( 'Background', 'ultimate-store-kit' ), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column', ] ); $this->add_control( 'thankyou_address_details_border_color', [ 'label' => esc_html__( 'Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'thankyou_address_details_title_tab', [ 'label' => esc_html__( 'Title', 'ultimate-store-kit' ), ] ); $this->add_control( 'thankyou_address_details_title_color', [ 'label' => esc_html__( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column__title' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'thankyou_address_details_title_border_color', [ 'label' => esc_html__( 'Border Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column__title::after' => 'background: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'thankyou_address_details_title_typography', 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column__title', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'thankyou_address_details_address_tab', [ 'label' => esc_html__( 'Address', 'ultimate-store-kit' ), ] ); $this->add_control( 'thankyou_address_details_address_color', [ 'label' => esc_html__( 'Color', 'ultimate-store-kit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column address, {{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column p' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'thankyou_address_details_address_typography', 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ), 'selector' => '{{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column address, {{WRAPPER}} .usk-page-order .woocommerce-customer-details .woocommerce-columns .woocommerce-column p', ] ); $this->end_controls_tabs(); $this->end_controls_section(); } protected function get_last_order_id() { global $wpdb; $statuses = array_keys( wc_get_order_statuses() ); if ( empty( $statuses ) ) { return 0; } // The status list is variable-length, so the placeholders are generated from // its count; every value itself still goes through prepare(). $placeholders = implode( ', ', array_fill( 0, count( $statuses ), '%s' ) ); // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare -- Editor-preview helper run once per preview render. $placeholders is a generated run of %s, never data; the values are bound by prepare(). $results = $wpdb->get_col( $wpdb->prepare( "SELECT MAX(ID) FROM {$wpdb->posts} WHERE post_type = 'shop_order' AND post_status IN ({$placeholders})", $statuses ) ); // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare return $results ? reset( $results ) : 0; } public function order_thank_you( $order ) { $settings = $this->get_settings_for_display(); $order_received_text = $settings['thankyou_order_received_text']; ?>
%1$s # %2$s', esc_html__( 'Order', 'ultimate-store-kit' ), esc_html( $order->get_order_number() ) ); endif; ?>

has_status( 'failed' ) ): echo esc_html__( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'ultimate-store-kit' ); ?>

get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) ); $show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', [ 'completed', 'processing' ] ) ); $downloads = $order->get_downloadable_items(); $show_downloads = $order->has_downloadable_item() && $order->is_download_permitted(); ?> $downloads, 'show_title' => true, ] ); } ?>

$item ) { $product = $item->get_product(); wc_get_template( 'order/order-details-item.php', [ 'order' => $order, 'item_id' => $item_id, 'item' => $item, 'show_purchase_note' => $show_purchase_note, 'purchase_note' => $product ? $product->get_purchase_note() : '', 'product' => $product, ] ); } do_action( 'woocommerce_order_details_after_order_table_items', $order ); ?> get_order_item_totals() as $key => $total ) { ?> get_customer_note() ): ?>
get_customer_note() ) ) ); ?>
get_user_id() === get_current_user_id(); if ( $show_customer_details ) { $show_shipping = !wc_ship_to_billing_address_only() && $order->needs_shipping_address(); ?>

get_formatted_billing_address( esc_html__( 'N/A', 'ultimate-store-kit' ) ) ); ?> get_billing_phone() ): ?>

get_billing_phone() ); ?>

get_billing_email() ): ?>

get_formatted_shipping_address( esc_html__( 'N/A', 'ultimate-store-kit' ) ) ); ?> get_shipping_phone() ): ?>

get_shipping_phone() ); ?>

editor->is_edit_mode() ) { // Get last order for preview $orders = wc_get_orders( [ 'limit' => 1 ] ); if ( !empty( $orders ) ) { $order = $orders[0]; } else { echo esc_html__( 'No orders found. Please create a test order to preview this widget.', 'ultimate-store-kit' ); return; } } else { // Normal frontend rendering global $wp; $order_id = isset( $wp->query_vars['order-received'] ) ? $wp->query_vars['order-received'] : $this->get_last_order_id(); if ( !$order_id ) { return; } $order = wc_get_order( $order_id ); } if ( !$order ) { return; } ?>
order_thank_you( $order ); $this->thank_you_order_confirmation( $order ); $this->thank_your_order_details( $order ); $this->thank_you_customer_address( $order ); ?>