• Mary

    (@ilhaverde)


    Hi

    I need to be able to have an “add-to-cart” button to the right of each custom variable for MPN’s. I don’t see a way to do this in woocommerce 3.2.3 and I didn’t find any plugins for this but I did come across a manual solution which looks like it might work. The solution is a custom url|link using the product ID, variation ID and attribute slug which I add to a button code.

    Example:

    MPN: louyhvtrxe – [button link=”www.mysite.com/cart/?add-to-cart=1843&variation_id=1866&attribute_pa_stock-number-or-mpn=louyhvtrxe”]Add To Cart[/button]

    When the button is clicked the product gets added to cart. The problem I’m running into is when placing the custom “add to cart” buttons on the product page the built-in attribute dropdown box still appears up top where it normally does. Is there a way to turn the variable dropdown off or a special way to handle this? There may be something obvious or not so obvious I haven’t learned about yet?

    Any help appreciated.

    Thanks
    Mary

    • This topic was modified 7 years ago by Mary.
Viewing 3 replies - 1 through 3 (of 3 total)
  • superkot

    (@superkot)

    You could hide it with CSS. Try adding table.variations {display:none;} to your custom CSS.

    Thread Starter Mary

    (@ilhaverde)

    Hi superkot

    Thanks, yes that would be an option if there’s no other way to actually remove the field. Viewing the attribute on the product page in admin I had overlooked the option “Visible on the product page”. I tried enabling and disabling it. It sounds like it would keep the attribute from displaying on the product page but I don’t see that it is actually doing anything at all.

    Thread Starter Mary

    (@ilhaverde)

    I researched the setting for the option “Visible on the product page” and what it actually does is show or hide the additional info tab which isn’t obvious..

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom variables add to cart – turn off built-in variable dropdown’ is closed to new replies.