Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • I can also confirm this error. To fix it on my end I had to enable all of the URL stripping options under General -> WooCommerce. Not ideal though as we have redirects in place for some products.

    Thread Starter kyleb08

    (@kyleb08)

    This is what I need, I am not sure if you updated the hook to work like that?

    “I will update the filter hook so that you can set your wishlist by using variation id.”

    Thread Starter kyleb08

    (@kyleb08)

    Hi Hakik,

    Would it be possible to discuss this with you over email as it may be quicker and easier to troubleshoot.

    The shortcode is basic: [wc_wishlists_button /]

    The button grabs the variation id and value using JS as seen below in the value – when the button is added to your code via shortcode this data and variation ID isn’t loaded:

    <input type=”hidden” name=”variation_id” class=”variation_id” value=”1130347″>

    Many thanks,
    Kyle

    • This reply was modified 4 years, 4 months ago by kyleb08.
    Thread Starter kyleb08

    (@kyleb08)

    Or alternatively, is it possible to use the default add to cart form code within your plugin? This way I can bind the shortcode to the form so it can work.

    Thread Starter kyleb08

    (@kyleb08)

    Thank you for your response.

    1 – If using WooCommerce Wishlists, how can I add the shortcode for this into the add to cart form so that it shows for each variation?

    For this query. Where is the ‘add to cart’ being generated from in your plugins code? I need to add a shortcode to the ‘add to cart’ form to ensure that the Wishlist button is grabbing the product ID for each item in the table.

    I am unsure if the code below adds the button to the add to cart form

    function pvt_support_cart_filter( $string ){
            // Example shortcode
    	$var = do_shortcode('[caption]My Caption[/caption]');
    	return sprintf("%s<div class='shortcode'>%s</div>", $string, $var);
            //$string is button content
    }
    add_filter( 'pvtfw_row_cart_btn_is', 'pvt_support_cart_filter', 10, 1 );

    Are you using PVT shortcode in elementor builder? If yes, could you please give me a screenshot? Or, you can reproduce the issue by using Loom

    Yes I am using the Elementor Page builder. The error I am getting is when I attempt to save the page ‘Server 500 error’ or I have tested on a different website and it isn’t even letting me open the single product page template.

    Only when using the below code.

    function pvt_support(){
    	global $pvtfw_table;
    	remove_action('template_redirect', array( $pvtfw_table, 'remove_add_to_cart'), 29 );
    
    }
    add_action('template_redirect', 'pvt_support');

    We need this code to work correctly as on mobile devices we will need to keep the regular ‘add to cart’ form as the product variation table is not mobile responsive.

    Thank you for your help 🙂

    Thread Starter kyleb08

    (@kyleb08)

    The server 500 error happens when using this code:

    function pvt_support(){
    	global $pvtfw_table;
    	remove_action('template_redirect', array( $pvtfw_table, 'remove_add_to_cart'), 29 );
    
    }
    add_action('template_redirect', 'pvt_support');
Viewing 6 replies - 1 through 6 (of 6 total)