Product images responsive, fix qty on single
authorLaury GvR <laury@gaslightmedia.com>
Tue, 29 Mar 2016 23:29:03 +0000 (19:29 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 29 Mar 2016 23:29:03 +0000 (19:29 -0400)
css/app.css
functions.php
scss/_page.header.scss
scss/plugins/_woocommerce.scss
woocommerce.php
woocommerce/content-product.php

index a353a5b..0eb0398 100644 (file)
@@ -6389,6 +6389,10 @@ header {
       header .social a img {
         margin: 0; }
 
+@media only screen and (max-width: 40em) {
+  .page-title, .woocommerce-result-count, .woocommerce-ordering {
+    padding: 0 10px; } }
+
 .contain-to-grid {
   box-shadow: 0 5px 10px -1px #999999; }
   .contain-to-grid .top-bar {
@@ -6695,6 +6699,7 @@ main {
     font-family: Arial;
     font-size: 12px; }
   .woocommerce .single_variation_wrap .quantity {
+    float: right;
     margin-bottom: 10px; }
     .woocommerce .single_variation_wrap .quantity input {
       display: inline-block;
@@ -6983,11 +6988,15 @@ main {
     border-radius: 3px;
     clear: both;
     float: right;
+    margin-top: 10px;
     padding: 2px 8px;
     background: transparent url("../assets/repeating-pattern.jpg") repeat scroll 0 0;
     padding: 3px 10px;
     font-size: 14px;
     border: 1px solid transparent; }
+    @media only screen and (max-width: 40em) {
+      .woocommerce #content .product.type-product .single_add_to_cart_button {
+        float: none; } }
     .woocommerce #content .product.type-product .single_add_to_cart_button:hover, .woocommerce #content .product.type-product .single_add_to_cart_button:focus {
       background-color: white;
       border: 1px solid #0f789f; }
@@ -6998,9 +7007,10 @@ main {
     display: table;
     height: 25px;
     padding: 2px 0 2px 5px; }
-    .woocommerce #content .product.type-product .quantity .cart-qty-label, .woocommerce #content .product.type-product .qty .cart-qty-label {
-      float: right;
-      margin-right: 5px; }
+    @media only screen and (max-width: 40em) {
+      .woocommerce #content .product.type-product .quantity, .woocommerce #content .product.type-product .qty {
+        float: none;
+        margin: 0 auto; } }
     .woocommerce #content .product.type-product .quantity .input-text, .woocommerce #content .product.type-product .qty .input-text {
       margin: 0; }
     .woocommerce #content .product.type-product .quantity .minus, .woocommerce #content .product.type-product .quantity .plus, .woocommerce #content .product.type-product .qty .minus, .woocommerce #content .product.type-product .qty .plus {
@@ -7013,6 +7023,10 @@ main {
     .woocommerce #content .product.type-product .quantity .minus:hover, .woocommerce #content .product.type-product .quantity .plus:hover, .woocommerce #content .product.type-product .qty .minus:hover, .woocommerce #content .product.type-product .qty .plus:hover {
       background-color: transparent;
       color: inherit !important; }
+  .woocommerce #content .product.type-product .cart-qty-label {
+    float: right;
+    clear: both;
+    margin-right: 5px; }
   .woocommerce #content .product.type-product .price {
     color: transparent;
     margin-bottom: 0;
@@ -7022,6 +7036,10 @@ main {
     text-align: right;
     display: block;
     line-height: 1.0; }
+    @media only screen and (max-width: 40em) {
+      .woocommerce #content .product.type-product .price {
+        float: none;
+        text-align: center; } }
     .woocommerce #content .product.type-product .price > * {
       height: 40px; }
     .woocommerce #content .product.type-product .price span {
@@ -7037,6 +7055,10 @@ main {
     float: right;
     clear: both;
     font-size: 14px; }
+    @media only screen and (max-width: 40em) {
+      .woocommerce #content .product.type-product .stock {
+        float: none;
+        text-align: center; } }
   @media only screen and (max-width: 40em) {
     .woocommerce #content .product.type-product {
       margin-top: 20px; }
@@ -7134,14 +7156,8 @@ main {
       padding: 10px;
       clear: both;
       width: 100%;
-      padding-right: 0;
-      border: none; }
-      @media only screen and (max-width: 40em) {
-        .woocommerce #content ul.products li.product.type-product {
-          width: 49%; } }
-      @media only screen and (min-width:40.063em) and (max-width:64em) {
-        .woocommerce #content ul.products li.product.type-product {
-          width: 33%; } }
+      border: none;
+      margin: 0 auto 10px; }
       .woocommerce #content ul.products li.product.type-product h3 {
         font-size: 16px;
         text-align: left; }
@@ -7155,8 +7171,7 @@ main {
         border-radius: 5px; }
         .woocommerce #content ul.products li.product.type-product > div img {
           /*                border: 2px solid $black;*/
-          border-radius: 3px;
-          width: auto; }
+          border-radius: 3px; }
       .woocommerce #content ul.products li.product.type-product h3 {
         font-weight: normal; }
       .woocommerce #content ul.products li.product.type-product .count {
@@ -7185,6 +7200,10 @@ main {
         float: right;
         text-align: right;
         clear: both; }
+        @media only screen and (max-width: 40em) {
+          .woocommerce #content ul.products li.product.type-product .cart {
+            float: none;
+            text-align: center; } }
       .woocommerce #content ul.products li.product.type-product .products-add-to-cart {
         clear: both;
         float: right; }
index 832678f..b3c41e5 100644 (file)
@@ -137,7 +137,7 @@ add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_produ
 add_filter ( 'woocommerce_product_thumbnails_columns', 'prod_thumb_cols' );
 
 remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
-add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 30 );
+add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 20 );
 
 function prod_thumb_cols() {
     return 4; // .last class applied to every 4th thumbnail
index b914569..bb7adee 100644 (file)
@@ -132,3 +132,10 @@ header {
         }
     }
 }
+.page-title,
+.woocommerce-result-count,
+.woocommerce-ordering {
+    @media #{$small-only} {
+        padding: 0 10px;
+    }
+}
\ No newline at end of file
index b182894..4851dfc 100644 (file)
         font-size: 12px;
     }
     .single_variation_wrap .quantity {
+        float: right;
         margin-bottom: 10px;
         input {
             display: inline-block;
             border-radius: 3px;
             clear: both;
             float: right;
+            margin-top: 10px;
+            @media #{$small-only} {
+                float:none;
+            }
             padding: 2px 8px;
             background: rgba(0, 0, 0, 0) url("../assets/repeating-pattern.jpg") repeat scroll 0 0;
             padding: 3px 10px;
         }
         .quantity, .qty {         
             float: right; 
+            @media #{$small-only} {
+                float:none;
+                margin: 0 auto;
+            }
             display:table;
             height: 25px;
             padding: 2px 0 2px 5px;
-            .cart-qty-label {
-                float: right;
-                margin-right: 5px;
-            }
             .input-text {
                 margin: 0;
             }
                 color: inherit !important;
             }
         }
+        .cart-qty-label {
+            float: right;
+            clear: both;
+            margin-right: 5px;
+        }
         .price {
             color: transparent;
             margin-bottom: 0;
             margin: 0;
             float: right;
             text-align: right;
+            @media #{$small-only} {
+                float:none;
+                text-align: center;
+            }
             display: block;
             line-height: 1.0;
             > * {
         .stock {
             color: black;
             float: right;
+            @media #{$small-only} {
+                float:none;
+                text-align: center;
+            }
             clear: both;
             font-size: 14px;
         }
             padding: 10px;
             clear: both;
             width: 100%;
-
-            @media #{$small-only} {
-                width: 49%;
-            }
-            @media #{$medium-only} {
-                width: 33%;
-            }
+            border: none;
+            margin: 0 auto 10px;
             h3 {
                 font-size: 16px;
                 text-align: left;
                 border: none;
                 padding-right: 15px;
             }
-            padding-right: 0;
-            border: none;
             > div {
                 margin: 5px;
                 padding: 5px;
                 img {
     /*                border: 2px solid $black;*/
                     border-radius: 3px;
-                    width: auto;
                 }
             }
             h3 {
                 float: right;
                 text-align: right;
                 clear: both;
+                @media #{$small-only} {
+                    float:none;
+                    text-align: center;
+                }
             }
             .products-add-to-cart {
                 button {
index aeeace9..aaf913f 100644 (file)
 <script>
     
 $(document).ready(function () {
-        $("#tab-html5_video p").remove();
-        var mainImage = $(".attachment-shop_single.size-shop_single.wp-post-image");
-        var thumbImage =  $(".attachment-shop_thumbnail.size-shop_thumbnail");
-        
-        $(thumbImage).mouseover(function(){
-            $(mainImage).attr("srcset", $(this).attr("src"));
-        });
-
-        // Thumbnail undisplay
-        $(thumbImage).mouseout(function(){
-            $(mainImage).attr("srcset", $(mainImage).attr("src"));
-        });
-        
+    $("#tab-html5_video p").remove();
+    var mainImage = $(".attachment-shop_single.size-shop_single.wp-post-image");
+    var thumbImage =  $(".attachment-shop_thumbnail.size-shop_thumbnail");
+    $(".attachment-shop_thumbnail").parent().css("text-align","center");
+    $(".woocommerce-placeholder").parent().css("text-align","center");
+    $(thumbImage).mouseover(function(){
+        $(mainImage).attr("srcset", $(this).attr("src"));
+    });
+
+    // Thumbnail undisplay
+    $(thumbImage).mouseout(function(){
+        $(mainImage).attr("srcset", $(mainImage).attr("src"));
+    }); 
+    
 });
 </script>
\ No newline at end of file
index 2301b27..8e5eb47 100644 (file)
@@ -51,10 +51,10 @@ if ( 0 === $woocommerce_loop['loop'] % $woocommerce_loop['columns'] ) {
 <?php if (!is_product()) { ?>
 <li <?php post_class( $classes ); ?>>
     <div class="row collapse">
-        <div class="small-12 medium-4 column">
+        <div class="small-12 large-4 column">
         <?php echo $product->get_image(); ?>
         </div>
-        <div class="small-12 medium-8 columns">
+        <div class="small-12 large-8 columns">
             <div class="row">
                 <?php echo woocommerce_template_loop_product_link_open(); ?>
                 <?php do_action( 'woocommerce_shop_loop_item_title' ); ?>