Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #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:

    View post on imgur.com

    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

    #1108369

    Hey 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,
    Mike

    #1108847

    Hi 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

    #1109457

    Hi,

    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,
    Ismael

    #1111035

    Hi 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?

    #1111787

    Hi,
    Please include an admin login in the Private Content area, so we can examine closer.

    Best regards,
    Mike

    #1112333

    Hi Mike.
    Here is the login info.
    Thanks

    #1112579

    Hi,
    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,
    Mike

    #1117479

    Hi 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.

    #1117750

    Hi,

    “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,
    Ismael

    #1117831

    Hi Ismael.
    I’ve disabled all the plugins minus the woocommerce ones, but the button doesn’t shows up

    #1118637

    Hi,

    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,
    Ismael

    #1118778

    Hi Ismael, thanks for the reply.
    All my products are set to SIMPLE type.

    #1119794

    Hi,

    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,
    Ismael

    #1119977

    Hi Ismael.
    The site is now online, try to access it.

    #1120159

    Hi,

    Thank you for the update.

    The filter above actually works. We added it in the functions.php file.

    Best regards,
    Ismael

    #1120236

    Hi 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

    #1120553

    Hi,
    I tried to check your site but I found the product buttons say “Pedir orçamento” is this correct?

    Best regards,
    Mike

    #1120863

    Hi Mike.
    Yes, that is correct. Maybe it was a cache thing.
    Thanks for all the help. You can close this topic

    #1120889

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 20 posts - 1 through 20 (of 20 total)
  • The topic ‘Product slider with add to cart buttons’ is closed to new replies.