Tagged: add to cart, product slider
-
AuthorPosts
-
June 3, 2019 at 4:41 pm #1106748
I am using the product slider to show highlight products on my site. But I want to add an ADD TO CART button bellow it, kinda like this:
Is there a way to add this? So the user won’t be need to click on the product to add to cart, but will be able to add to cart right from the front page.
Thanks
June 8, 2019 at 4:26 am #1108369Hey PIW,
Try adding this code to the end of your functions.php file in Appearance > Editor:add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10 );
This will add the button to your product slider then we can assist with some css.
Best regards,
MikeJune 10, 2019 at 4:53 pm #1108847Hi Mike, thanks for your answer.
I’ve added the code on my functions.php but I don’t see any button or link.
Can you give me a hand with this?Thanks
June 12, 2019 at 12:17 pm #1109457Hi,
Thank you for the update.
Try to wrap it inside an “after_setup_theme” hook.
add_action( 'after_setup_theme', function() { add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 12 ); }, 999);
Best regards,
IsmaelJune 17, 2019 at 3:44 pm #1111035Hi Ismael, thanks for your replay.
I’ve added it as you said but, sadly, the buttons aren’t showing up.
Is there anything else I can do?June 20, 2019 at 3:16 am #1111787Hi,
Please include an admin login in the Private Content area, so we can examine closer.Best regards,
MikeJune 21, 2019 at 2:02 pm #1112333Hi Mike.
Here is the login info.
ThanksJune 22, 2019 at 3:45 pm #1112579Hi,
Thanks for the login, have you tried disabling your plugins to rule out a conflict? Can we try temporarily?
Typically the JetPack plugin loses it’s settings when deactivating, and perhaps your WPML addons will too, so I wanted to confirm that this testing will be ok with you.
We also have a beta version with many fixes that help, but we will need ftp access to try, can you include ftp access in the Private Content area so we can be of more assistance?Best regards,
MikeJuly 10, 2019 at 2:44 pm #1117479Hi Mike, sorry for the long delay – I was on vacations
I tried to disable the plugins, but then I got the error:
“You need to install and activate the WooCommerce Shop Plugin to display WooCommerce Products”I am afraid I can’t update the theme right now, because I am working on translations.
July 11, 2019 at 11:16 am #1117750Hi,
“You need to install and activate the WooCommerce Shop Plugin to display WooCommerce Products”
That’s because you disabled the WooCommerce plugin. Only disable the plugins that are not related to WooCommerce. And let us know when you’re ready to update the theme.
Best regards,
IsmaelJuly 11, 2019 at 3:54 pm #1117831Hi Ismael.
I’ve disabled all the plugins minus the woocommerce ones, but the button doesn’t shows upJuly 15, 2019 at 1:38 am #1118637Hi,
Thank you for the update.
The button should display even without the modification above as long as the product type is set to simple. Is that the case in your site? Are the products set to a different type?
Best regards,
IsmaelJuly 15, 2019 at 2:16 pm #1118778Hi Ismael, thanks for the reply.
All my products are set to SIMPLE type.July 18, 2019 at 6:58 am #1119794Hi,
Thanks for the update.
Can we access the site without adding it to our hosts file? I tried logging in but the wp-admin redirects to or displays a 404 page.
Best regards,
IsmaelJuly 18, 2019 at 7:02 pm #1119977Hi Ismael.
The site is now online, try to access it.July 19, 2019 at 12:36 pm #1120159Hi,
Thank you for the update.
The filter above actually works. We added it in the functions.php file.
Best regards,
IsmaelJuly 19, 2019 at 3:55 pm #1120236Hi Ismael,
Thanks for the help. I’ve fixed the line height of the products title.I think I got what was wrong – I’ve inserted the codes in functions.php which is on the Wp root folder, but it seams that you’ve added it using the Wp editor, which seams to be a different file.
In which one I should insert the codes from now on?
Also, how can I change the button text? I have a code into functions.php to change those texts, but for those buttions, they are getting the default “buy” text – and in our site, the customers will only ask for quotes.
Thanks
July 21, 2019 at 4:02 am #1120553Hi,
I tried to check your site but I found the product buttons say “Pedir orçamento” is this correct?Best regards,
MikeJuly 22, 2019 at 3:13 pm #1120863Hi Mike.
Yes, that is correct. Maybe it was a cache thing.
Thanks for all the help. You can close this topicJuly 22, 2019 at 3:44 pm #1120889Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Product slider with add to cart buttons’ is closed to new replies.