Home Forums WoodMart support forum Sticky Add to Cart Variations – CSS Fix

Sticky Add to Cart Variations – CSS Fix

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #72845

    newsprince
    Participant

    Hello.

    We edit the file

    /woodmart/inc/woocommerce.php

    On line 3372 – 3374

    We replace the code

    <a href="<?php echo esc_url( $product->add_to_cart_url() ); ?>" class="woodmart-sticky-add-to-cart button alt">
    								<?php echo $product->is_type( 'variable' ) ? esc_html__( 'Select options', 'woodmart' ) : $product->single_add_to_cart_text(); ?>
    							</a>

    With this one

    <span class="stickyaddtocart"><?php woocommerce_variable_add_to_cart(); ?></span>

    Now the variations shows up on sticky add to cart function you have BUT can you provide us a CSS fix so that the variations are aligned on the right side and Product Image with Tittle and Price stay on the left side? We gave it a class also to style it. .stickyaddtocart

    I think some other people have asked about this too.
    It works just needs some CSS fix.
    Thank you.

    #72901

    Bogdan Donovan
    Keymaster

    Hello,

    Try to add the following code snippet to the Custom CSS area in Theme Settings.

    .woodmart-sticky-btn .woodmart-sticky-btn .woodmart-sticky-btn-content {
    	flex: 1 1 auto;
    }
    
    .woodmart-sticky-btn-cart {
    	flex: 0 1 50%;
    }
    
    .woodmart-sticky-btn-cart .variations_form .variations {
     margin-bottom: 0;
    }
    
    .stickyaddtocart {
    	flex-basis: 900px;
    }
    
    .woodmart-sticky-btn-cart  .stickyaddtocart .cart {
    	flex-wrap: nowrap;
    }

    Regards

    #72908

    newsprince
    Participant

    Yes thank you it works but it’s not very convenient.

    Anyway maybe you implement it better some day.

    Thank you.

    #72923

    Artem Temos
    Keymaster

    You are welcome. We will consider improvement in our future updates.

Viewing 4 posts - 1 through 4 (of 4 total)