Tagged: 

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

    Hi,
    I am building a woocommerce catalog website.

    I want the next and previous buttons to navigate to products from the same category

    Hoiw can I fix it?

    Thanks

    Uri

    #688778

    Hi uribinsted!

    Please take a look here
    https://kriesi.at/support/topic/previousnext-buttons-on-portfolio-items-restrict-to-1-category/

    let us know if we can do anything else for you.

    Best regards,
    Basilis

    #732181

    Is this possible to do within the child theme framework? I tried adding…
    function avia_post_nav($same_category = true)

    … to my functions.php file and it caused a fatal error. So I went back to this post and see it says to edit the “functions-enfold.php” which I assume is not the functions.php file in the child theme. Interested to know how I too can restrict Next and Previous to one category.

    I’ll also add this to the functionality request, it seems unlikely anyone would want to cruise through multiple Post categories.

    Thank you

    #733858

    Hi,

    Please add this code in the functions.php file:

    add_filter('avia_post_nav_settings', 'avia_post_nav_settings_mod');
    function avia_post_nav_settings_mod($settings)
    {
      if(is_singular('product')) {
            $settings['taxonomy'] = 'product_cat';
    	$settings['is_fullwidth'] = false;
      }
      $settings['same_category'] = true;
      return $settings;
    }

    Best regards,
    Ismael

    #734802

    Awesome, this seems to be working! Thx

    #735739

    Hi,

    Glad we could help :)

    Best regards,
    Nikko

    #853914

    Hi,
    I copied Ismaels code to my functions.php (child theme) but nothing happens :’ (
    Maybe the filter was modified after January? Can you give me an updated code snipped?
    I’m using enfold 4.1.2, woocommerce 3.1.2

    #854259

    Hi tl_s180,

    The filter has not changed. The code should be working. Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #854535

    Thanks for your response. I figured out it’s working actually.
    Most of my products are in multiple categories.
    I made some test products with one category only .. and here it’s working as intended.
    I guess it’s not possible to navigate to the next product of the current category, if a product is assigned to multiple categories.

    #855601

    Hi,

    You are right!
    happy you solve it.
    Please feel free to let us know if there is anything else we can do for you.

    Thank you

    Best regards,
    Basilis

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Enfold – previous and next product-page arrows on posts to navigate to products’ is closed to new replies.