Home Forums WoodMart support forum Hover on product – Tiled – How to add a regular "Add to Cart" button

Hover on product – Tiled – How to add a regular "Add to Cart" button

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #67562

    b4hr4m
    Participant

    Hi,

    Is there any way to add a regular “add to cart” button to the Tiled hover on product effect?

    I have added this code to content-product-tiled.php:

    <div class="btn-add">
        <?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
    </div>

    The “add to cart” button showed up but the button style doesn’t like a regular button. It seems it won’t inherit a regular button style from the theme.

    Please check the pictures, I want the button be like the blue one.

    Or if it’s easier, how can the “Standard button” hover effect, becomes like a Tiled with border and padding?

    Thanks

    Attachments:
    You must be logged in to view attached files.
    #67632

    Hello,

    Thank you very much for choosing our theme and contacting us.

    Please add this custom code to Theme Setting > Custom CSS

    .woodmart-hover-tiled .btn-add > a {
        background-color:  #7eb934;
    }
    
    .woodmart-hover-tiled .btn-add > a {
      display: inline-block;
      position: relative;
      font-weight: 600;
      text-align: center;
      text-transform: uppercase;
      letter-spacing: .3px;
      border-radius: 0;
      border-width: 0;
      border-style: solid;
      border-color: transparent;
      outline: none;
      -webkit-box-shadow: none;
              box-shadow: none;
      text-shadow: none;
      text-decoration: none;
      vertical-align: middle;
      cursor: pointer;
      -webkit-transition: color 0.25s ease,  background-color 0.25s ease, border-color 0.25s ease,  box-shadow 0.25s ease, opacity 0.25s ease;
      -webkit-transition: color 0.25s ease,  background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease,  -webkit-box-shadow 0.25s ease;
      transition: color 0.25s ease,  background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease,  -webkit-box-shadow 0.25s ease;
      transition: color 0.25s ease,  background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease,  opacity 0.25s ease;
      transition: color 0.25s ease,  background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease,  opacity 0.25s ease,  -webkit-box-shadow 0.25s ease;
      padding: 0;
      overflow: hidden; }
    
    .woodmart-hover-tiled .btn-add > a span:not(.woodmart-tooltip-label) {
        display: block;
        -webkit-transition: transform .25s ease,  opacity .15s ease;
        -webkit-transition: opacity .15s ease,  -webkit-transform .25s ease;
        transition: opacity .15s ease,  -webkit-transform .25s ease;
        transition: transform .25s ease,  opacity .15s ease;
        transition: transform .25s ease,  opacity .15s ease,  -webkit-transform .25s ease; }
    
    .woodmart-hover-tiled .btn-add > a:before {    
        content: "\f11d";
        font-family: "woodmart-font";
        position: absolute;
        top: 0;
        left: 0;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
            -ms-flex-direction: row;
                flex-direction: row;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
        -webkit-box-pack: center;
            -ms-flex-pack: center;
                justify-content: center;
        width: 100%;
        height: 100%;
        font-weight: 400;
        font-size: 20px;
        color: white;
        -webkit-transition: opacity .15s ease, transform .25s ease;
        -webkit-transition: opacity .15s ease, -webkit-transform .25s ease;
        transition: opacity .15s ease, -webkit-transform .25s ease;
        transition: opacity .15s ease, transform .25s ease;
        transition: opacity .15s ease, transform .25s ease, -webkit-transform .25s ease;
        transform: translateY(100%);
        -webkit-transform: translateY(100%); }
    
    .woodmart-hover-tiled .btn-add > a:after {
        content: "";
        width: 18px;
        height: 18px;
        display: inline-block;
        vertical-align: middle;
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-left-color: white;
        border-radius: 50%;
        position: absolute;
        top: 50%;
        left: 50%;
        opacity: 0;
        margin-left: -9px;
        margin-top: -9px;
        -webkit-transition: opacity .2s ease;
    }
    
    .woodmart-hover-tiled .btn-add > a:hover:before {
        -webkit-transform: translateY(0) translateZ(0);
        transform: translateY(0) translateZ(0);
    }
    
    .woodmart-hover-tiled .btn-add > a:hover span:not(.woodmart-tooltip-label) {
        -webkit-transform: translateY(-100%) translateZ(0);
        transform: translateY(-100%) translateZ(0); 
    }
    
    .woodmart-hover-tiled .btn-add > a.loading:before {
        opacity: 0;
    }
    
    .woodmart-hover-tiled .btn-add > a.loading:after {
        opacity: 1;
        -webkit-animation: wd-rotate 450ms infinite linear;
                animation: wd-rotate 450ms infinite linear;
    }
    
    .woodmart-hover-tiled .btn-add > a.loading span:not(.woodmart-tooltip-label) {
        opacity: 0;
    }
    
    .woodmart-hover-tiled .btn-add {
      margin-top: 10px;
    }   
    
    .woodmart-hover-tiled .btn-add > p {
        display: none; }
    
    .woodmart-hover-tiled .btn-add > a {
        color: #ffffff; }
    
    .woodmart-hover-tiled .btn-add > a:hover, 
    .woodmart-hover-tiled .btn-add > a:focus {
          -webkit-box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.1);
                  box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.1);
          color: #ffffff; 
    }
    
    .woodmart-hover-tiled .btn-add > a span:not(.woodmart-tooltip-label) {
        font-size: 12px;
        line-height: 16px;
        padding: 10px 14px; 
    }
    
    .woodmart-hover-tiled .btn-add .added_to_cart {
        font-size: 12px;
        line-height: 16px;
        padding: 10px 14px; 
    }
    
    .woodmart-hover-tiled .btn-add .added_to_cart:before {
        content: none; 
    }

    Best Regards

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