New Landing How can we help? Atelier Menu in footer displaying Order #XXXXX instead of the menu item name

Viewing 10 posts - 1 through 10 (of 10 total)
  • Posted in: Atelier
  • #253003
    BBMagnus
    Member
    Post count: 20

    As the subject suggests, I am having an issue with a footer menu when I’m on the view-order page.

    Instead of the title displaying as “Frågor & svar” it’s displaying “Order #17131”. The thing is that it only does this on the view-order page. I have been searching for the issue for hours but gave up. The same issue cannot be reproduced on any other theme so I am certain that it has something to do with your theme. I have also tried to switch from the child theme to Atelier but I get the same issue.

    Look at the provided screenshot for more info.

    Thanks in advance

    Attachments:
    You must be logged in to view attached files.
    #253389
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Is there any scope to test this all plugins deactivated leaving only Woo and Swift Framework active?

    – Can we have access to the login details with an order?

    – Swift Framework 2.0.2 has now been released, you look to be using 1.66?

    Thanks.

    #253466
    BBMagnus
    Member
    Post count: 20

    Is there any scope to test this all plugins deactivated leaving only Woo and Swift Framework active?
    I have tested this on my local machine, I don’t want to deactivate everything on this site since it’s going to be published live soon. An important note is that I have tried WordPress twentythirteen with the same plugins by just switching to that theme and it don’t feature the same issue.

    – Can we have access to the login details with an order?
    I have created an order for your login.

    – Swift Framework 2.0.2 has now been released, you look to be using 1.66?
    That was true, I have updated now – still have the issue though 🙁

    #253534
    BBMagnus
    Member
    Post count: 20

    What I discovered was that in the page template you are running:

    if( have_posts() ) : the_post();

    and not

    while( have_posts() ) : the_post();

    This means that the code setting the query variable “in_the_loop” is not set to false.

    This means that you are not ending “the loop”.

    WooCommerce has a add_filter for “the_title” which checks for in_the_loop() to check if the title is the main page title.

    “the_title” also runs for all the menu items in the footer menu.

    I will do a quick-fix for my customer by overriding the page.php – file and adding have_posts() in the bottom of the file just before the footer code.

    Please have a look at this.

    #253904
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Are you referring to this file? /swift-framework/layout/page.php This output is what page.php will use.

    Have you tested this? We can incorporate this into a future release.

    Thanks.

    #254097
    BBMagnus
    Member
    Post count: 20

    Yes exactly, I am referring to that file.

    It looks like this right now:

    
    <?php if ( have_posts() ) : the_post(); ?>
    
        <?php do_action( 'sf_page_content_before' ); ?>
    
        <div <?php post_class( 'clearfix' ); ?> id="<?php the_ID(); ?>">
    
            <?php do_action( 'sf_page_content_start' ); ?>
    
            <?php the_content(); ?>
    
            <div class="link-pages"><?php wp_link_pages(); ?></div>
    
            <?php
                /**
                 * @hooked - sf_page_comments - 10
                 **/
                do_action( 'sf_page_content_end' );
            ?>
    
        </div>
    
        <?php do_action( 'sf_page_content_after' ); ?>
    
    <?php endif; ?>
    

    And the loop is never closed since no have_posts() are being run after the last post has been “printed”.

    I suggest this instead:

    
    <?php while ( have_posts() ) : the_post(); ?>
    
        <?php do_action( 'sf_page_content_before' ); ?>
    
        <div <?php post_class( 'clearfix' ); ?> id="<?php the_ID(); ?>">
    
            <?php do_action( 'sf_page_content_start' ); ?>
    
            <?php the_content(); ?>
    
            <div class="link-pages"><?php wp_link_pages(); ?></div>
    
            <?php
                /**
                 * @hooked - sf_page_comments - 10
                 **/
                do_action( 'sf_page_content_end' );
            ?>
    
        </div>
    
        <?php do_action( 'sf_page_content_after' ); ?>
    
    <?php endwhile; ?>
    

    Although we know that there will only be one post WordPress is built with a loop, allowing for more than one post.

    My suggestion adds a while loop instead of an if-statement, this will make have_posts() run one more time after the_post() has been called.

    Since I can’t override the swift-framework files I have added my quickfix to the atelier/page.php file, adding a have_posts() before get_footer(), closing the loop.

    #254417
    David Martin – Support
    Moderator
    Post count: 20834

    Thanks, I’m just going to run this past the lead developer for his review also.

    Cheers,
    David.

    #254422
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Thanks @BBMagnus – will integrate that for the next update. Appreciate it.

    – Ed

    #255728
    BBMagnus
    Member
    Post count: 20

    Thank you! 🙂

    #256018
    David Martin – Support
    Moderator
    Post count: 20834

    Great, thanks Ed.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register