Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1423786

    Hi there,

    We are using the Enfold theme, and Wishlist and Compare from yith.

    It’s working perfectly when logged in, but logged out, the do_shortcodes won’t work.

    We do not have any caching plugins activated.

    We are using the shortcodes in a product grid, and also in a slider, but as I said, they only work logged in. I can’t seem to understand why.

    These are my snippets:

    Grid:

    
    #child-theme/woocommerce/content-product.php
    # (previous code) 
    global $product;
    # ...
    ?>
    						<div class="tag-wrapper">
    	                         <?php echo apply_filters( 'the_content',' [yith_compare_button] ');
    <?php
    # (rest of the code)

    Slider: (same link, but (url)/shop-startseite/)

    
    #child-theme/shortcodes/econsor_productslider.php, within the html() function of the custom shortcode
    # ...
    
    				$html .= do_shortcode( '[yith_wcwl_add_to_wishlist product_id="' . $product->get_id() . '"]', false );
    # ...

    They both work perfectly logged in, but not logged out, so I guess it’s not an issue within the code itself.

    Can you guys help me out here?
    Thanks in advance!

    #1423867

    Hey emilconsor,

    Thank you for the inquiry.

    It’s possible that adding items to a wishlist is limited to logged-in users or site members, which could be why the shortcode isn’t working when logged out. You may want to reach out to the plugin authors for clarification.

    Best regards,
    Ismael

    #1423903

    Hey Ismael,

    yes, it is possible, as you can see in the link below, just above the price, you can add the product to your wishlist – even logged out.
    The shortcode there hooks into the single_product_summary action.

    #1424017

    Hi,
    I notice that on your page you have this error Uncaught TypeError: $(...).wc_product_gallery is not a function from your custom.js
    I’m not sure if this error also occurs when logged in, perhaps this is related.
    If this doesn’t help Please include an admin login in the Private Content area so we can examine further.

    Best regards,
    Mike

    #1424090

    Hi Mike,

    the TypeError is also logged in, so it is not related.

    I’ve included an admin login for you – thank you for your time!

    Regards

    #1424096

    Hi,

    Are you using this plugin?

    // https://wordpress.org/plugins/yith-woocommerce-wishlist

    Why are you manually adding shortcodes to the template? The plugin already provides an option to place the wishlist button above the image. You can find this option in the Settings > Add to Wishlist > Loop settings section. This option works correctly for the Product Grid and Product Slider elements.

    Best regards,
    Ismael

    #1424362

    Hi,
    yes, this is the plugin.

    I’m adding shortcodes manually since the plugin doesn’t work for my custom product slider shortcode I’ve created. I’ve pasted my code into the private contents.
    We don’t want to use the enfold slider, that’s why we built custom sliders with splide.

    #1424409

    Hi,

    Thank you for the update.

    We’ve reviewed the code, but we couldn’t see any reason why the shortcode wouldn’t work. It’s possible that the shortcode function includes logic that affects the visibility of the wishlist button for non-logged-in users. Have you tried reaching out to the plugin developer about this issue?

    Best regards,
    Ismael

    #1424423

    Hi Ismael,

    yes, I’ve written the plugin developer at the same time, just to be sure to find the issue.
    I’ve noticed that the shortcodes are gettinge executed with parameters, which are the tipical issues when facing a caching problem, but we do not have a caching plugin activated, so I really don’t understand why.

    Do you have an idea?

    #1424458

    Hi,

    We are not really sure what’s missing at this point because we are not familiar with the plugin. Please wait for the response from the plugin developers as they should have a better understanding of how the shortcode works.

    Thank you for your patience.

    Best regards,
    Ismael

    #1425555

    Hi Ismael,
    I noticed this page also not working properly (linked below) when not logged in OR without any parameters.
    I’m really struggeling now, since this is normally a caching problem, but as I said, we do not have any caching plugins activated.

    On a 1:1 copy of the page, it works. I really don’t know what to do anymore.

    Do you have another idea?

    • This reply was modified 10 months, 1 week ago by emilconsor.
    #1425568

    Edit: Somehow, by changing the URL, it is working now.
    I really can’t explain this, but that did the trick somehow. Thanks for your time.

    #1425645

    Hi,

    That is good to hear! Happy to know that the issue has been resolved. Please do not hesitate to open another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘do_shortcode not working when logged out’ is closed to new replies.