Continue Shopping functionality issue (unable to page forward)…

Hey guys! Issue has come up with trying to CONTINUE SHOPPING function when in the cart:

1) add an item to the cart, go to cart and everything is fine but instead of checking out we click CONTINUE SHOPPING to go back to the main store page

2) brings you back to the main store page as it should, but when trying to advance page forward either by page number or NEXT it shows up as NO PRODUCTS (also noticed that the number of pages showing is inaccurate at EIGHT (8) pages as opposed to just going to store page, which shows TEN (10) pages.

Screen shots attached; please advise…

  • Vaughan
    • Support/SLS MockingJay

    Hi John,

    Hope you’re well?

    Do you have any Cache plugins installed at all? If so, could you try purging cache & de-activating to test with.

    Can you switch to the default twentysixteen theme temporarily and see if it begins to work? Just so we can eliminate an issue in the theme.

    If the above fails, Could you grant support access from the dashboard plugin so we can take a closer look? See https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Thanks

  • John
    • Site Builder, Child of Zeus

    Vaughan, no 3rd party cache plugins that I’m aware of; any chance that one the WPMU plugins like Defender or Hummingbird have something built-in that might cause it to happen? I’ll try the default twentysixteen theme to see what happens, and grant access after I get off work in an hour. Thanks for the quick reply!

  • John
    • Site Builder, Child of Zeus

    Vaughan, tried with TwentySixteen and the same thing (see screenshot). We do have W3 Total Cache installed but it's not active, that should be fine, correct? Access has been opened up, please let me know what else we can do for ya; thanks…

  • Vaughan
    • Support/SLS MockingJay

    Hi John,

    I’m at a loss on this one, I’ve tried setting my multisite up the same as yours, with the same shortcodes etc & I can’t replicate this.

    The funny thing is that you use the same shortcode on the /store page and pagination works perfectly fine there, but not on the /store/products/ page.

    Let me just ask one of my colleagues Ash to see if he can take a look and find anything.

    Apologies for the inconvenience this is causing.

  • John
    • Site Builder, Child of Zeus

    Vaughan / Ash,

    Any updates on this? Something that we noticed which may be helpful. When we click CONTINUE SHOPPING from within the shopping cart, it redirects a buyer back to http://fromxxxxxxxxxxxxyours.com/store/products/ and subsequently it will go to http://fromxxxxxxxxxxxxyours.com/store/products/page/2/ when trying to page forward, which is where we get the error and incorrect product total issue since it’s only showing 8 pages.

    But if you click SHOP from the main site homepage, it brings you to the store URL which is actually http://fromxxxxxxxxxxyours.com/store/ and then to http://fromxxxxxxxxxyours.com/store/page/2/, which seem to be the correct pages and also show what appears to be an accurate number of pages (10), and likely will display the correct number of products.

    So, for some reason we have two separate store pages and it redirects to the one that doesn’t work correctly?

  • John
    • Site Builder, Child of Zeus

    UPDATE: also noticed that if we remove all items from the cart, it does the EXACT same thing by bringing us to xxxx.com/store/products rather than just xxxx.com/store – please advise at your earliest convenience. Where SHOULD it be directing to is what we’d like to know?

    We found that this is because the PRODUCTS page is a child page to STORE under the pages directory in the dashboard. Removed STORE as the parent, and it still goes to xxxxxxx/com/products which is where the issue lies. Is it possible this has something to do with the previous issues of the products not showing up in this thread: https://premium.wpmudev.org/forums/topic/product-display-main-store-page

    Please advise at your earliest convenience. Thanks!

  • Ash
    • WordPress Hacker

    Hello John

    This is because you are using global shortcode in the store base page. We have a workaround luckily. Please try the following code:

    add_action( 'wp_head', function() {
    ?>
    <script type="text/javascript">
    jQuery( function($) {
    $( '.mp_button-continue-shopping' ).attr( 'href', 'http://frommychildtoyours.com/store/' );
    } );
    </script>
    <?php
    } );

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name ‘mu-plugins’. If there is no folder in that name, then create a folder, name it ‘mu-plugins’, create a file inside that, give any name you like and paste the code in there. You don’t need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers

    Ash

  • John
    • Site Builder, Child of Zeus

    Thanks, Ash, I’ll try this tonight once I get off work (fingers crossed!). Thought it would be an easy enough work around to redirect to the STORE page instead of the default STORE/PRODUCTS page but had no idea how to do that, so your assistance is much appreciated. I’ll followup on this later this evening… :slight_smile:

  • John
    • Site Builder, Child of Zeus

    Should we just delete the STORE/PRODUCTS page since it seems to be inaccurate so far as indexing the actual products that have been uploaded (it’s only showing 9 pages of products, while the STORE page shows 11, which is correct)?

    Not sure if that would cause any problems and we wouldn’t want anyone arriving at that page from a Google search or some other way if it’s not forwarding correctly or the number of items listed is incomplete/inaccurate. Thanks…

  • Ash
    • WordPress Hacker

    Hello John

    You are using global product shortcode in the store page, that shortcode will give you the correct result. Maybe product page showing products from one site, maybe main site only. For network products, shortcode is best option.

    We can set a redirect from product page to store page. If you want, you can use any redirect plugin which will handle that.

    Also, did you try the code above, is the issue fixed?

    Have a good day!

    Cheers

    Ash

  • John
    • Site Builder, Child of Zeus

    Yes, Ash, the work-around seems to be doing what it should, we added to the mu-plugin plugin folder to avoid any issues down the line with updates or changes to the theme.

    Do you have any suggestions for a Redirect Plugin in the repository since I’m not finding one developed by WPMUDEV? We’d greatly appreciate it if so…

  • John
    • Site Builder, Child of Zeus

    Ok, so now we’re getting this error message on 2 of the store sites when trying to go to the store page; any thoughts if this is related or a separate issues since we didn’t change anything that should affect this (it’s not happening in every store, just a couple?):

    Fatal error: Maximum execution time of 30 seconds exceeded in /home/xxxxxxxxx/xxxxxxx/xxxxxxx/wp-includes/class-wp-image-editor-imagick.php on line 352

  • John
    • Site Builder, Child of Zeus

    Ash, not sure how but the error referenced above is no longer happening (if you do have any info on WHY it may have happened please feel free to pass that along, anything can help for future issues) – Smushed images once it was realized that my cousin had been uploading huge pictures so maybe that was related to it, but again no longer an issue there and the redirect to the store page is working. Any thoughts on a redirect plugin that you would use? Thanks

  • Vaughan
    • Support/SLS MockingJay

    Hi John,

    The fatal error is caused by a low execution setting in the server PHP config.

    If you have access to php.ini on your server (You may need to ask your webhost how to edit this on your server)

    You need to set the following in your php.ini

    max_execution_time = 300

    Currently it is set to 30. That should prevent that error happing again.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.