• Hi,

    Is it possible to add a link to the product while having the “Add to Cart” button in the collections/Products page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author andrewmrobbins

    (@andrewmrobbins)

    @oraelius Yes it is!

    If you’re using a shortcode to show your products, you’ll want to use the link_with_buy_button="true" attribute, like this:

    [wps_products link_with_buy_button="true"]

    If you’re using the default products page, you can add this filter hook to your theme’s functions.php file:

    
    add_filter('wps_products_all_args', function($defaults) {
       $defaults['link_to'] = 'wordpress';
       $defaults['link_with_buy_button'] = true;
    
       return $defaults;
    });
    

    Let me know if this helps!

    Thread Starter oraelius

    (@oraelius)

    Hello Andrew,

    I’ve tried adding that attribute to my shortcode before and unfortunately, it does not work. This is my shortcode since I wanted the “Add to cart” feature while on the shop/products page [wps_products link_to="none"] (https://prnt.sc/xzvwz5).

    Since this attribute removes all the links to the product, I tried mixing other attributes like the link_with_buy_button and it goes like this [wps_products link_to="none" link_with_buy_button="true"] and the link_to="none" seems to dominate/override the other attribute.

    I just want to know if there is a way to do this or it’s just not part of the feature.

    Thanks for the immediate reply ??

    jdunk

    (@jdunk)

    Is there a way for this to work is the [wps_collections] tag? I tried just adding it and it didn’t work.

    Plugin Author andrewmrobbins

    (@andrewmrobbins)

    @oraelius @jdunk

    Hey, apologies for the delay.

    You’ll need to change link_to=”none” to link_to=”wordpress”, like this:

    [wps_products link_to="wordpress" link_with_buy_button="true"]

    You can also link to Shopify like this: link_to="shopify".

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Linking products with “Add to Cart” button’ is closed to new replies.