after adding to Wishlist button stays enactive
-
Hello, thanks for a grate plugin.
after update the plugin stopped adding a class of .woosw-added. it works fine when the page is loaded but if you refresh the page it doesn’t do that anymore. I would like to add the class manually to make sure its over riding any conflict with any plugin call it bootstrapping it in.
for example I used this code to strap in a class for products that are already in cart cant we do something like that for products already in wishlist?
function woocommerce_custom_add_to_cart_class ( $html, $product, $args ) { // Define the classes to be added $class_to_append = "this_guys_in_cart"; // Check if product is in cart $in_cart = WC()->cart->find_product_in_cart( WC()->cart->generate_cart_id( $product->get_id() ) ); if ( $in_cart != '' ) { // Append the extra class $args['class'] = $args['class']." {$class_to_append}"; $html = sprintf( '<a href="%s" data-quantity="%s" class="%s" %s>%s</a>', esc_url( $product->add_to_cart_url() ), esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ), esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ), isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '', esc_html( $product->add_to_cart_text() ) ); } // Return Add to cart button return $html; } add_filter( "woocommerce_loop_add_to_cart_link", "woocommerce_custom_add_to_cart_class", 10, 3 );
Then I can just custom the CSS to for example to fill the background black or red or whatever and problem will be solved.
thanks best regards love WPC awesome plugins and using the hello elementor theme its what you guys use to make your themes also.
The page I need help with: [log in to see the link]
- The topic ‘after adding to Wishlist button stays enactive’ is closed to new replies.