Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #619166

    Hey guys,

    is there a way to close the preview cirle at the last and first product, so that

    at the last product there is a back button to the product before and a forth button to the very first product
    as well as
    at the first product there is a forth button to the second product and a back button to the very last product

    By now there is only a
    back button at the last product and a
    forth button at the first product.

    Thank you so much.

    Best Stephan

    #620980

    Hey handelsmann!

    Thank you for using Enfold.

    The issue is a little bit confusing. Please provide a link to the product page in question.

    Cheers!
    Ismael

    #621051

    Hey Ismael,

    for sure. You see in the last product there is only an arrow to the left side (product before) and you see in the fist product there is only an arrow to the night (next product) but you do not see an arrow on the opposite site.

    What I want to have is pointing from the last product to the first product and from the first product to the last product with the mssing arrow.

    Thanks for helping out.

    Best Stephan

    #622787

    Hi!

    Alright. Thank you for the info. Please add this in the functions.php file:

    add_filter('avia_post_nav_entries', 'avia_post_nav_entries_mod', 10, 2);
    function avia_post_nav_entries_mod($entries, $settings) {
        $first = 1; // id of the first product
        $last  = 2; // id of the last product
    
        $first = get_post($first, OBJECT);
        $last = get_post($last, OBJECT);
    
        if(empty($entries['next'])) $entries['next'] = $first;
        if(empty($entries['prev'])) $entries['prev'] = $last;
    
        return $entries;
    }

    Replace the value of the $first variable with the id of the very first product and the $last with the id of the last product.

    Regards,
    Ismael

    #622848

    Gangster. This is awesome Ismael. Thank you soooo much for your support.
    This works great. Could be an idea for the future to automate this last step by
    getting the id of the first and last product which is activated (probably a little bit more tricky).
    Awesome.

    Again – you are great guys. Thanks.
    Stephan

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Back and forth – Button – Product Preview’ is closed to new replies.