Wsparcie » Zaawansowane » zbublowane „podsumowanie koszyka”, „

  • Witam,

    po problemach z przenosinami strony w Wordpresie na inny serwer, wydawało mi sie, że wszystko działa już dobrze, wszystko poaktualizowane. Jednak zauważyłem że mam zdublowane (jeden pod drugim) „podsumowanie koszyka” i przyciski „przejdź do kasy”, a na następnej stronie zdublowane formy płatności. Jeden zestaw jest w tabelce ze wszystkimi innymi podsumowaniami, a drugi pod tabelką. Dobrze działa ten pod tabelką. Gdzie mam szukać przyczyny? Z góry dziękuję.
    WP: 4.7.2
    Motyw: Butiko
    Wtyczka WooCommerce

Viewing 4 replies - 1 through 4 (of 4 total)
  • Wejdź do edycji odpowiednich stron i sprawdź czy w ich treściach nie ma zdublowanych shortcode-ów.

    Thread Starter mattkary

    (@mattkary)

    Dzięki, tylko która to strona, bo nieraz pokazuje sie po wejściu do koszyka komunikat, który za drugim wejściem juz sie nie pojawia.

    Warning: Invalid argument supplied for foreach() in /wp-content/themes/butiko/functions.php on line 220

    Wskazuje zdaje sie na funkcję ukrywania np. przelewów w przypadku wyboru płatnosci za pobraniem.
    A to cały plik function.php:

    <?php
    /**
    * butiko functions and definitions
    *
    * @package butiko
    */

    define(’BUTIKO_GOOGLE_FONT_KEY’, 'your_keys’);
    define(’BUTIKO_THEME_NAME’, 'butiko’);
    define(’BUTIKO_TEMPLATE_PATH’, get_template_directory());
    define(’BUTIKO_INC_DIRECTORY’, get_template_directory_uri(). „/inc”);
    define(’BUTIKO_FRAMEWORK_DIRECTORY’, get_template_directory_uri(). „/inc/reduxFramework”);

    /**
    * Set the content width based on the theme’s design and stylesheet.
    */
    if ( ! isset( $content_width ) ) {
    $content_width = 850; /* pixels */
    }

    if ( ! function_exists( 'butiko_setup’ ) ) :
    /**
    * Sets up theme defaults and registers support for various WordPress features.
    *
    * Note that this function is hooked into the after_setup_theme hook, which
    * runs before the init hook. The init hook is too late for some features, such
    * as indicating support for post thumbnails.
    */
    function butiko_setup() {

    /*
    * Make theme available for translation.
    * Translations can be filed in the /languages/ directory.
    * If you’re building a theme based on butiko, use a find and replace
    * to change 'butiko’ to the name of your theme in all the template files
    */
    load_theme_textdomain( 'butiko’, get_template_directory() . '/languages’ );

    // Add default posts and comments RSS feed links to head.
    add_theme_support( 'automatic-feed-links’ );

    /*
    * Enable support for Post Thumbnails on posts and pages.
    *
    * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
    */
    add_theme_support( 'post-thumbnails’ );

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    'primary’ => __( 'Primary Menu’, 'butiko’ ),
    ) );

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    'secondary’ => __( 'Secondary Menu’, 'butiko’ ),
    ) );

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    'mobile’ => __( 'Mobile Menu’, 'butiko’ ),
    ) );

    /*
    * Switch default core markup for search form, comment form, and comments
    * to output valid HTML5.
    */
    add_theme_support( 'html5′, array(
    'search-form’, 'comment-form’, 'comment-list’, 'gallery’, 'caption’,
    ) );

    /*
    * Enable support for Post Formats.
    * See http://codex.wordpress.org/Post_Formats
    */
    add_theme_support( 'post-formats’, array(
    'gallery’, 'video’, 'audio’, 'quote’
    ) );

    // Setup the WordPress core custom background feature.
    add_theme_support( 'custom-background’, apply_filters( 'butiko_custom_background_args’, array(
    'default-color’ => 'ffffff’,
    'default-image’ => ”,
    ) ) );
    }
    endif; // butiko_setup
    add_action( 'after_setup_theme’, 'butiko_setup’ );

    /**
    * Register widget area.
    *
    * @link http://codex.wordpress.org/Function_Reference/register_sidebar
    */
    function butiko_widgets_init() {
    register_sidebar( array(
    'name’ => __( 'Sidebar’, 'butiko’ ),
    'id’ => 'sidebar-1′,
    'description’ => ”,
    'before_widget’ => '<aside id=”%1$s” class=”widget %2$s”>’,
    'after_widget’ => '</aside>’,
    'before_title’ => '<h3 class=”widget-title”><span class=”normal”>’,
    'after_title’ => '</span></h3>’,
    ) );

    register_sidebar( array(
    'name’ => __( 'Footer 1′, 'butiko’ ),
    'id’ => 'footer-1′,
    'description’ => ”,
    'before_widget’ => '<aside id=”%1$s” class=”widget %2$s”>’,
    'after_widget’ => '</aside>’,
    'before_title’ => '<h3 class=”widget-title”><span class=”normal”>’,
    'after_title’ => '</span></h3>’,
    ) );

    register_sidebar( array(
    'name’ => __( 'Footer 2′, 'butiko’ ),
    'id’ => 'fotoer-2′,
    'description’ => ”,
    'before_widget’ => '<aside id=”%1$s” class=”widget %2$s”>’,
    'after_widget’ => '</aside>’,
    'before_title’ => '<h3 class=”widget-title”><span class=”normal”>’,
    'after_title’ => '</span></h3>’,
    ) );

    register_sidebar( array(
    'name’ => __( 'Footer 3′, 'butiko’ ),
    'id’ => 'footer-3′,
    'description’ => ”,
    'before_widget’ => '<aside id=”%1$s” class=”widget %2$s”>’,
    'after_widget’ => '</aside>’,
    'before_title’ => '<h3 class=”widget-title”><span class=”normal”>’,
    'after_title’ => '</span></h3>’,
    ) );

    register_sidebar( array(
    'name’ => __( 'Footer 4′, 'butiko’ ),
    'id’ => 'footer-4′,
    'description’ => ”,
    'before_widget’ => '<aside id=”%1$s” class=”widget %2$s”>’,
    'after_widget’ => '</aside>’,
    'before_title’ => '<h3 class=”widget-title”><span class=”normal”>’,
    'after_title’ => '</span></h3>’,
    ) );

    //catalog widget area
    register_sidebar( array(
    'name’ => __( 'Shop Sidebar’, 'butiko’ ),
    'id’ => 'catalog-sidebar’,
    'before_widget’ => '<aside id=”%1$s” class=”widget %2$s”>’,
    'after_widget’ => '</aside>’,
    'before_title’ => '<h3 class=”widget-title”><span class=”normal”>’,
    'after_title’ => '</span></h3>’,
    ) );

    }
    add_action( 'widgets_init’, 'butiko_widgets_init’ );

    /**
    * Enqueue scripts and styles.
    */
    function butiko_scripts() {

    wp_enqueue_style( 'foundation-style’, get_template_directory_uri() . '/css/foundation.css’ );
    wp_enqueue_style( 'normalize-style’, get_template_directory_uri() . '/css/normalize.css’ );
    wp_enqueue_style( 'flaticon-style’, get_template_directory_uri() . '/css/flaticon.css’ );
    wp_enqueue_style( 'owl-style’, get_template_directory_uri() . '/css/owl.carousel.css’ );
    wp_enqueue_style( 'nanoslider-style’, get_template_directory_uri() . '/css/nanoslider.css’ );
    wp_enqueue_style(’flex-skin’, get_template_directory_uri() . '/css/flexslider.css’);
    wp_enqueue_style( 'featured-vertical-style’, get_template_directory_uri() . '/css/vertical-slider.css’ );
    wp_enqueue_style( 'butiko-style’, get_stylesheet_uri() );

    wp_enqueue_script( 'modernizr-js’, get_template_directory_uri() . '/js/vendor/modernizr.js’, array(), '20141206′, true );
    wp_enqueue_script( 'foundation-js’, get_template_directory_uri() . '/js/foundation.js’, array(’jquery’), '20141206′, true );
    wp_enqueue_script( 'hoverintent-js’, get_template_directory_uri() . '/js/hoverIntent.js’, array(), '20141206′, true );

    wp_enqueue_script(’owl-carousel’, get_template_directory_uri() . '/js/owl.carousel.min.js’, array(’jquery’), '1.10.1′, true);
    wp_enqueue_script( 'nanoscroller-js’, get_template_directory_uri() . '/js/jquery.nanoscroller.min.js’, array(), '20141206′, true );
    wp_enqueue_script(’flex-slider’, get_template_directory_uri() . '/js/jquery.flexslider.js’, array(’jquery’), '20141206′, true );
    wp_enqueue_script(’stellar-js’, get_template_directory_uri() . '/js/jquery.stellar.js’, array(’jquery’), '20141206′, true );
    wp_enqueue_script( 'featured-vertical-slider’, get_template_directory_uri() . '/js/vertical-slider.js’, array(), '20141206′, true );
    wp_enqueue_script(’magnific-js’, get_template_directory_uri() .’/js/jquery.magnific-popup.js’, array(„jquery”), true);
    wp_enqueue_style(’magnific-skin’, get_template_directory_uri() . '/css/magnific-popup.css’);
    wp_enqueue_script( 'butiko-skip-link-focus-fix’, get_template_directory_uri() . '/js/skip-link-focus-fix.js’, array(’jquery’), '20141206′, true );
    wp_enqueue_script( 'main-js’, get_template_directory_uri() . '/js/main.js’, array(), '20141206′, true );

    if ( is_singular() && comments_open() && get_option( 'thread_comments’ ) ) {
    wp_enqueue_script( 'comment-reply’ );
    }
    }
    add_action( 'wp_enqueue_scripts’, 'butiko_scripts’ );

    /**
    * Implement the Custom Header feature.
    */
    //require get_template_directory() . '/inc/custom-header.php’;

    /**
    * Custom template tags for this theme.
    */
    require get_template_directory() . '/inc/template-tags.php’;

    /**
    * Custom functions that act independently of the theme templates.
    */
    require get_template_directory() . '/inc/extras.php’;

    /**
    * Customizer additions.
    */
    require get_template_directory() . '/inc/customizer.php’;

    function alter_shipping_methods($list){
    $chosen_titles = array();
    $available_methods = WC()->shipping->get_packages();
    $chosen_rates = ( isset( WC()->session ) ) ? WC()->session->get( 'chosen_shipping_methods’ ) : array();

    foreach ($available_methods as $method)
    foreach ($chosen_rates as $chosen) {
    if( isset( $method[’rates’][$chosen] ) ) $chosen_titles[] = $method[’rates’][ $chosen ]->label;
    }

    if( in_array( 'Kurier DHL za pobraniem’, $chosen_titles ) ) {
    $array_diff = array(’WC_Gateway_BACS’, „WC_Gateway_Przelewy24”);
    $list = array_diff( $list, $array_diff );
    }
    return $list;
    }
    add_action(’woocommerce_payment_gateways’, 'alter_shipping_methods’);

    add_filter( 'woocommerce_email_attachments’, 'attach_terms_conditions_pdf_to_email’, 10, 3);

    function attach_terms_conditions_pdf_to_email ( $attachments, $status , $order ) {
    //$allowed_statuses = array( 'new_order’, 'customer_invoice’, 'customer_processing_order’, 'customer_completed_order’ );
    $allowed_statuses = array(’customer_completed_order’ );

    if( isset( $status ) && in_array ( $status, $allowed_statuses ) ) {
    $attachments[] = get_template_directory() . '/attachments/oswiadczenie_o_odstapieniu_od_umowy.pdf’;
    $attachments[] = get_template_directory() . '/attachments/pouczenie_o_prawie_do_odstapienia_od_umowy.pdf’;
    $attachments[] = get_template_directory() . '/attachments/regulamin_www.ubranka-lapetite.pl.pdf’;
    $attachments[] = get_template_directory() . '/attachments/reklamacja_towaru.pdf’;
    //$attachments[] = $your_pdf_path;
    }

    return $attachments;
    /**
    * Filter payment gateways
    */
    function my_custom_available_payment_gateways( $gateways ) {
    $chosen_shipping_rates = WC()->session->get( 'chosen_shipping_methods’ );

    if ( in_array( 'flat_rate:1′, $chosen_shipping_rates ) ) :
    unset( $gateways[’cod’] );

    endif;
    return $gateways;
    }
    add_filter( 'woocommerce_available_payment_gateways’, 'my_custom_available_payment_gateways’ );
    }

    Thread Starter mattkary

    (@mattkary)

    Może te fragmenty (google zbadaj) komuś ułatwią. Bo niestety nie wiem gdzie tego szukać i jak to usunąć.
    Kolor zielony fragmenty dobrze działające.
    Kolor czerony do usniecia.



    • Ta odpowiedź została zmodyfikowana 7 years, 2 months temu przez mattkary.
    • Ta odpowiedź została zmodyfikowana 7 years, 2 months temu przez mattkary.
    • Ta odpowiedź została zmodyfikowana 7 years, 2 months temu przez mattkary.
    Thread Starter mattkary

    (@mattkary)

    Nie, nie ma zdublowanych shortcode’ów

Viewing 4 replies - 1 through 4 (of 4 total)
  • Temat ‘zbublowane „podsumowanie koszyka”, „’ jest zamknięty na nowe odpowiedzi.