Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter sungamr

    (@sungamr)

    Thank you so much for taking the time to check this. Now I know that what I was trying to do was indeed impossible. ??

    Thread Starter sungamr

    (@sungamr)

    Thanks for responding. I took over a custom checkout where you can select one of 3 checkout methods. BACS, Swish Handel and the Klarna Checkout.

    Naively perhaps, WP is a side gig for me, I wanted to switch between them without page reload by requesting them via AJAX and injecting them in a placeholder. I cannot get that to work with the Klarna iframe solution unfortunately and wanted to explore solutions before accepting defeat and full postback.

    We have the same problem.

    Can old overridden templates be the problem I have inherited an old “hacky” theme and decided to change as little as possible until we have time to deal with the template updates *blushing*.

    cart-empty.php version 3.5.0
    cart.php version 3.8.0
    payment.php version 3.5.3
    customer-on-hold-order.php version 3.7.0
    quantity-input.php version 4.0.0
    form-login.php version 4.1.0
    orders.php version 3.7.0
    simple.php version 3.4.0

    Thanks, Magnus


    The code look fine. Try to verify that the plugin actually get loaded. Check for a cookie that’s named _wp_session, for instance with Chrome F12 -> Resources -> Cookies.

    I did this by adding a filter.

    add_filter('storefront_credit_link','custom_remove_footer_credit',10);
    function custom_remove_footer_credit(){
        return false; //return true to show it.
    }

    The Storefront code does check for the presence and value of this filter

    if ( ! function_exists( 'storefront_credit' ) ) {
    	/**
    	 * Display the theme credit
    	 * @since  1.0.0
    	 * @return void
    	 */
    	function storefront_credit() {
    		?>
    		<div class="site-info">
    			<?php echo esc_html( apply_filters( 'storefront_copyright_text', $content = '&copy; ' . get_bloginfo( 'name' ) . ' ' . date( 'Y' ) ) ); ?>
    			<?php if ( apply_filters( 'storefront_credit_link', true ) ) { ?>
    			<br /> <?php printf( __( '%1$s designed by %2$s.', 'storefront' ), 'Storefront', '<a href="https://woothemes.com" rel="designer">WooThemes</a>' ); ?>
    			<?php } ?>
    		</div><!-- .site-info -->
    		<?php
    	}
    }

    I have been sitting with the same problem and what happens seem to be the following. When Visual Composer enter the Frontend-editor it will render the page. The problem is that the system still is in admin mode, so Woocommerce will not include(load) the templating-functions. As a result Woocommerce will crash and burn when it tries to render (in my case) the short codes as it will try to call functions in the unloaded templating system.

    public function include_template_functions() {
    		if ( ! is_admin() || defined( 'DOING_AJAX' ) ) {
    			include_once( 'includes/wc-template-functions.php' );
    		}
    	}

    If you are desperate you can always comment out the conditional inclusion and you will get it kind of working. (it doesn’t render the short codes correctly, but its not crashing). I don’t know what the side effects will be as I am not working on either the WC or VC project, so I leave that decision up to you. (Edited for clarity)

Viewing 6 replies - 1 through 6 (of 6 total)