WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Adding Attribute (3 posts)

  1. cs.pt.fs
    Member
    Posted 1 year ago #

    I am trying to add an attribute for different color choices. I have created the attribute and added it in the "Attributes" section on the product page. I selected 'visible on product page' but it still doesn't show up.

    I have also tried selecting "Variable" for a product type and adding the attribute in the Variable options. Then the drop down does show on the product page but it doesn't have the color selections I created and the "Add to Cart" button disappears.

    Help?

    Thank you!

    http://wordpress.org/extend/plugins/woocommerce/

    [ please don't bump - it is against forum rules ]

  2. cs.pt.fs
    Member
    Posted 1 year ago #

    I looked this up on the forums and I was able to add my variations/attributes. But now the Add to Cart option does not show. Visible on Product page is enabled and prices set for each variation. Type set to variable.

    I found this resolution on the forums also:

    function mv_my_theme_scripts()
    {
    wp_enqueue_script('add-to-cart-variation', get_template_directory_uri() . '/js/add-to-cart-variation.js',array('jquery'),'1.0',true);
    }
    add_action('wp_enqueue_scripts','mv_my_theme_scripts');
    ?>

    But do I add this to function.php and thats it? How do I upload the add-to-cart-variation.js to the js files?

  3. bheadrick
    Member
    Posted 1 year ago #

    the add-to-cart-variation.js is already part of woocommerce. the solution you listed simply tells wordpress to load that in the footer instead of the header (or maybe both, I haven't tried it).

    and yes, just add the above to your functions.php

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic