_alignments.scss 0000666 00000000675 15213352765 0007766 0 ustar 00 .alignleft { /*rtl:ignore*/ float: left; /*rtl:ignore*/ margin-right: $size__spacing-unit; @include media(tablet) { /*rtl:ignore*/ margin-right: calc(2 * #{$size__spacing-unit}); } } .alignright { /*rtl:ignore*/ float: right; /*rtl:ignore*/ margin-left: $size__spacing-unit; @include media(tablet) { /*rtl:ignore*/ margin-left: calc(2 * #{$size__spacing-unit}); } } .aligncenter { clear: both; @include center-block; } _clearings.scss 0000666 00000000646 15213352765 0007572 0 ustar 00 .clear:before, .clear:after, .entry-content:before, .entry-content:after, .comment-content:before, .comment-content:after, .site-header:before, .site-header:after, .site-content:before, .site-content:after, .site-footer:before, .site-footer:after { @include clearfix; } .clear:after, .entry-content:after, .comment-content:after, .site-header:after, .site-content:after, .site-footer:after { @include clearfix-after; } _accessibility.scss 0000666 00000001626 15213352765 0010451 0 ustar 00 /* Text meant only for screen readers. */ .screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */ &:focus { background-color: $color__background-screen; border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto !important; clip-path: none; color: $color__text-screen; display: block; font-size: 0.875rem; font-weight: bold; height: auto; left: 5px; line-height: normal; padding: 15px 23px 14px; text-decoration: none; top: 5px; width: auto; z-index: 100000; /* Above WP toolbar. */ } } /* Do not show the outline on the skip link target. */ #content[tabindex="-1"]:focus { outline: 0; } thankyou/class-cartflows-thankyou.php 0000666 00000001630 15214030017 0014063 0 ustar 00 utils->get_step_post_type(), // Post_type. 'normal', // Context. 'high' // Priority. ); } } /** * Metabox Markup * * @param object $post Post object. * @return void */ public function markup_meta_box( $post ) { wp_nonce_field( 'save-nonce-thankyou-step-meta', 'nonce-thankyou-step-meta' ); $stored = get_post_meta( $post->ID ); $checkout_meta = self::get_meta_option( $post->ID ); // Set stored and override defaults. foreach ( $stored as $key => $value ) { if ( array_key_exists( $key, $checkout_meta ) ) { self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : ''; } else { self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : ''; } } // Get defaults. $meta = self::get_meta_option( $post->ID ); /** * Get options */ $thankyou_data = array(); foreach ( $meta as $key => $value ) { $thankyou_data[ $key ] = $meta[ $key ]['default']; } do_action( 'wcf_thankyou_settings_markup_before', $meta ); $this->page_header_tab( $thankyou_data, $post->ID ); do_action( 'wcf_thankyou_settings_markup_after', $meta ); } /** * Page Header Tabs * * @param array $options Post meta. * @param int $post_id Post ID. */ public function page_header_tab( $options, $post_id ) { $active_tab = get_post_meta( $post_id, 'wcf-active-tab', true ); if ( empty( $active_tab ) ) { $active_tab = 'wcf-thankyou-shortcodes'; } $tabs = array( array( 'title' => __( 'Shortcodes', 'cartflows' ), 'id' => 'wcf-thankyou-shortcodes', 'class' => 'wcf-thankyou-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-editor-code', ), array( 'title' => __( 'Design', 'cartflows' ), 'id' => 'wcf-thankyou-design', 'class' => 'wcf-thankyou-design' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-admin-customizer', ), array( 'title' => __( 'Edit Fields', 'cartflows' ), 'id' => 'wcf-thankyou-fields', 'class' => 'wcf-thankyou-fields' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-welcome-widgets-menus', ), array( 'title' => __( 'Settings', 'cartflows' ), 'id' => 'wcf-thankyou-redirect', 'class' => 'wcf-thankyou-redirect' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-randomize', ), array( 'title' => __( 'Custom Script', 'cartflows' ), 'id' => 'wcf-thankyou-custom-script-header', 'class' => 'wcf-thankyou-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab', 'icon' => 'dashicons-format-aside', ), ); ?>
options->get_thankyou_fields( $post_id ); } return self::$meta_option; } /** * Metabox Save * * @param number $post_id Post ID. * @return void */ public function save_meta_box( $post_id ) { // Checks save status. $is_autosave = wp_is_post_autosave( $post_id ); $is_revision = wp_is_post_revision( $post_id ); $is_valid_nonce = ( isset( $_POST['nonce-thankyou-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-thankyou-step-meta'] ) ), 'save-nonce-thankyou-step-meta' ) ) ? true : false; // Exits script depending on save status. if ( $is_autosave || $is_revision || ! $is_valid_nonce ) { return; } wcf()->options->save_thankyou_fields( $post_id ); } } /** * Kicking this off by calling 'get_instance()' method */ Cartflows_Thankyou_Meta::get_instance(); thankyou/classes/class-cartflows-thankyou-markup.php 0000666 00000023422 15214030017 0017020 0 ustar 00 ID; $enable_redirection = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-tq-redirect-section' ); $redirect_link = wp_http_validate_url( wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-redirect-link' ) ); if ( 'yes' === $enable_redirection && ! empty( $redirect_link ) ) { exit( wp_redirect( $redirect_link ) ); //phpcs:ignore } } } /** * Order shortcode markup * * @param array $atts attributes. * @since 1.0.0 */ public function cartflows_order_details_shortcode_markup( $atts ) { $output = ''; if ( _is_wcf_thankyou_type() ) { /* Remove order item link */ add_filter( 'woocommerce_order_item_permalink', '__return_false' ); /* Change order text */ add_filter( 'woocommerce_thankyou_order_received_text', array( $this, 'custom_tq_text' ), 10, 2 ); if ( ! function_exists( 'wc_print_notices' ) ) { $notice_out = '' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '
'; $notice_out .= ''; return $notice_out; } $order = false; $id_param = 'wcf-order'; $key_param = 'wcf-key'; if ( isset( $_GET['wcf-opt-order'] ) ) { //phpcs:ignore $id_param = 'wcf-opt-order'; $key_param = 'wcf-opt-key'; } if ( ! isset( $_GET[ $id_param ] ) && wcf()->flow->is_flow_testmode() ) { //phpcs:ignore $args = array( 'limit' => 1, 'order' => 'DESC', 'post_type' => 'shop_order', 'status' => array( 'completed', 'processing' ), ); $latest_order = wc_get_orders( $args ); $order_id = ( ! empty( $latest_order ) ) ? current( $latest_order )->get_id() : 0; if ( $order_id > 0 ) { $order = wc_get_order( $order_id ); if ( ! $order ) { $order = false; } } } else { if ( ! isset( $_GET[ $id_param ] ) ) { //phpcs:ignore return 'Order not found. You cannot access this page directly.
'; } // Get the order. $order_id = apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET[ $id_param ] ) ? 0 : intval( $_GET[ $id_param ] ) ); //phpcs:ignore $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET[ $key_param ] ) ? '' : wc_clean( wp_unslash( $_GET[ $key_param ] ) ) ); //phpcs:ignore if ( $order_id > 0 ) { $order = wc_get_order( $order_id ); if ( ! $order || $order->get_order_key() !== $order_key ) { $order = false; } } } // Empty awaiting payment session. unset( WC()->session->order_awaiting_payment ); if ( null !== WC()->session ) { if ( ! isset( WC()->cart ) || '' === WC()->cart ) { WC()->cart = new WC_Cart(); } if ( ! WC()->cart->is_empty() ) { // wc_empty_cart(); // Empty current cart. WC()->cart->empty_cart( true ); wc_clear_notices(); } wc_print_notices(); } ob_start(); echo "