Home Forums WoodMart support forum Product navigation (in single product page) next-previous criterium

Product navigation (in single product page) next-previous criterium

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #489420

    supergap
    Participant

    Hi,
    I would like to better understand the way the Product navigation works.

    Now it seems it follows the ‘date order’ logic, but I’m not sure. but I’n my opinion is not a good way to go next-previous. The right way should be moving in the same category as primary logic.

    Which is the criterium it shows next-previous by? Product ID, Title, Date? Is it possible to decide which is the order to follow? In which way does it choose the ‘next’ category (menu order? category ID, Alphabetical order..)? Is it possible to stop at last product of a category (to not change category and remain in the current category) ? Or to go to the current category by clicking in the central button (4 squares button) instead of the shop page?

    Please let me know,
    Many thanks.

    Attachments:
    You must be logged in to view attached files.
    #489531

    Luke Nielsen
    Keymaster

    Hello,

    In order to display pagination on a single product, we use the default WordPress function get_adjacent_post, which sorts by date. Also, we have a filter in the theme when activated, the previous and next products will be derived only from the same taxonomy as the main product, in order to activate it, it is convenient to add this code to the child theme.

    add_filter( 'woodmart_get_prev_product_same_term', '__return_true' );

    Kind Regards

    #489539

    supergap
    Participant

    Hi,
    thanks for fast reply.
    which is the right way to add the code to php. I did sometimes but I can’t remember the steps to get the editor page in WordPress.
    Once in that page I just have to paste this code or I have to add some code before/after to open/close that code addition?

    Thanks

    #489552

    Luke Nielsen
    Keymaster

    Hello,

    You need to paste that code to the functions.php file in your child theme. You need just paste that code.

    Let me know the results.

    Kind Regards

    #489573

    supergap
    Participant

    Hi,
    clear. I just can’t find anymore the ‘Theme Editor’ link in Appearance.
    I can find it on other WP sites but not in this 6.3 WoodMart site. Is it moved away in some other place?
    Please look at attached file. Thanks again.

    Attachments:
    You must be logged in to view attached files.
    #489620

    Luke Nielsen
    Keymaster

    Hello,

    Here is an article on how to enable the Theme file editor:

    https://docs.wpuserregistration.com/docs/how-to-enable-theme-plugin-editor-mode/

    Kind Regards

    #489640

    supergap
    Participant

    hi,
    that line define(‘DISALLOW_FILE_EDIT’, true); is not in my wp-config.php file.
    I set anyway the same line (rewriting it with FALSE) but nothing change.

    I paste the your code in them child function.php file, via FTP and it works fine
    add_filter( ‘woodmart_get_prev_product_same_term’, ‘__return_true’ );

    But I would like to understand why theme editor link is missing in WP backend

    #489648

    Luke Nielsen
    Keymaster

    Hello,

    The thing is that the Theme file editor is related to WordPress and our theme cannot hide it, please try to read the below solution as well and let me know the result:

    https://nichetwins.com/wordpress-theme-editor-missing/#:~:text=More%20experienced%20site%20owners%20who,to%20disable%20the%20theme%20editor.

    Kind Regards

    #489649

    supergap
    Participant

    Hi,
    Already read that article.
    Can’t find there any solution.
    Thanks anyway.

    #489650

    Luke Nielsen
    Keymaster

    Hello,

    Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?

    Kind Regards

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