Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #326252

    Hi, the chart (table) at the top of my cart page with the product, quantity, price, total etc somehow stretches far off to the right cutting off the “proceed to checkout” and “update cart” buttons — you have to expand the browser window all the way to the right to see them. It is not responsive to screen sizes and therefore you can’t check out on smaller screen sizes.

    All other woo commerce pages and tables are formatted correctly within my site’s max width with the exception of the table atop the cart page.

    I tried containing the [woocommerce_cart] short code on the cart page within the avia layout editor and that doesn’t seem to do anything.

    i’m running WP 4.0 with the latest enfold theme 2.9.2 and latest woo commerce 2.2.4.

    saw this thread: https://wordpress.org/support/topic/woocommerce-checkout-not-mobile-responsive

    Seems to work ok with the default WP 2014 theme, but not with enfold theme.

    any ideas?

    UPDATE: I used the code below to force the cart tables to become responsive, however, the tables still do not respond on mobile phone portrait. If the user does not change to landscape, they have no way of checking out.

    /* START Make the cart table responsive */
    /* http://css-tricks.com/responsive-data-tables/ */
    
    @media screen and (max-width: 640px) {
    
    /* Force table to not be like tables anymore */
    .woocommerce-page table.shop_table, 
    .woocommerce-page table.shop_table thead, 
    .woocommerce-page table.shop_table tbody, 
    .woocommerce-page table.shop_table th, 
    .woocommerce-page table.shop_table td, 
    .woocommerce-page table.shop_table tr { 
    	display: block; 
    }
    
    /* Hide table headers (but not display: none;, for accessibility) */
    .woocommerce-page table.shop_table thead tr { 
    	position: absolute;
    	top: -9999px;
    	left: -9999px;
    }
    
    .woocommerce-page table.shop_table tr { 
    	/*border: 1px solid #d2d3d3; */
    }
    
    .woocommerce-page table.shop_table td { 
    	/* Behave  like a "row" */
    	border: 1px solid #d2d3d3; 
    	position: relative;
    	padding-left: 30% !important; 
    }
    
    .woocommerce-page table.shop_table {
    	border: none;
            max-width:1030px!important;
    }
    
    .woocommerce-page table.shop_table td.product-spacer {
    	border-color: #FFF;
    	height: 10px;
    }
    
    .woocommerce-page table.shop_table td:before { 
    	/* Now like a table header */
    	position: absolute;
    	/* Top/left values mimic padding */
    	top: 6px;
    	left: 6px;
    	width: 45%; 
    	padding-right: 10px; 
    	white-space: nowrap;
    }
    
    /*
    Label the data
    */
    .woocommerce-page table.shop_table td.product-remove:before {
    	content: "DELETE";
    }
    
    .woocommerce-page table.shop_table td.product-thumbnail:before {
    	content: "IMAGE";
    }
    
    .woocommerce-page table.shop_table td.product-name:before {
    	content: "PRODUCT";
    }
    
    .woocommerce-page table.shop_table td.product-price:before {
    	content: "PRICE";
    }
    
    .woocommerce-page table.shop_table td.product-quantity:before {
    	content: "QUANTITY";
    }
    
    .woocommerce-page table.shop_table td.product-subtotal:before {
    	content: "SUBTOTAL";
    }
    
    .woocommerce-page table.shop_table td.product-total:before {
    	content: "TOTAL";
    }
    
    .woocommerce .quantity, 
    .woocommerce #content .quantity, 
    .woocommerce-page .quantity, 
    .woocommerce-page #content .quantity {
    	margin: 0;
    }
    
    .woocommerce-page table.cart td.actions, 
    .woocommerce-page #content table.cart td.actions {
    	text-align: left;
    	border:0;
    	padding-left: 6px !important;
    }
    
    .woocommerce-page table.cart td.actions .button.alt, 
    .woocommerce-page #content table.cart td.actions .button.alt {
    	float: left;
    	margin-top: 10px;
    }
    
    .woocommerce-page table.cart td.actions div, 
    .woocommerce-page #content table.cart td.actions div,
    .woocommerce-page table.cart td.actions input, 
    .woocommerce-page #content table.cart td.actions input {
    	margin-bottom: 10px;
           width: 100%;
    }
    
    .woocommerce-page .cart-collaterals .cart_totals {
    	float: left;
    	width: 100%;
    	text-align: left;
    }
    
    .woocommerce-page .cart-collaterals .cart_totals th, 
    .woocommerce-page .cart-collaterals .cart_totals td {
    	border:0 !important;
    }
    
    .woocommerce-page .cart-collaterals .cart_totals table tr.cart-subtotal td,
    .woocommerce-page .cart-collaterals .cart_totals table tr.shipping td,
    .woocommerce-page .cart-collaterals .cart_totals table tr.total td {
    	padding-left: 6px !important;
    }
    
    .woocommerce-page table.shop_table tr.cart-subtotal td,
    .woocommerce-page table.shop_table tr.shipping td,
    .woocommerce-page table.shop_table tr.total td,
    .woocommerce-page table.shop_table.order_details tfoot th,
    .woocommerce-page table.shop_table.order_details tfoot td {
    	padding-left: 6px !important;
    	border:0 !important;
    }
    
    .woocommerce-page table.shop_table tbody {
    	padding-top: 10px;
    }
    
    .woocommerce .col2-set .col-1, 
    .woocommerce-page .col2-set .col-1,
    .woocommerce .col2-set .col-2, 
    .woocommerce-page .col2-set .col-2,
    .woocommerce form .form-row-first, 
    .woocommerce form .form-row-last, 
    .woocommerce-page form .form-row-first, 
    .woocommerce-page form .form-row-last {
    	float: none;
    	width: 100%;
    }
    
    .woocommerce .order_details ul, 
    .woocommerce-page .order_details ul,
    .woocommerce .order_details, 
    .woocommerce-page .order_details {
    	padding:0;
    }
    
    .woocommerce .order_details li, 
    .woocommerce-page .order_details li {
    	clear: left;
    	margin-bottom: 10px;
    	border:0;
    }
    
    }
    
    /* END Make the cart table responsive */
    
    • This topic was modified 10 years, 2 months ago by codemode.
    #326907

    Hey codemode!

    We would need to see your site to take a look at what is causing the conflict. By default, the theme hides elements of the cart so that it can continue to fit.

    Best regards,
    Devin

    #328711

    I resolved this! There was a conflict with my custom CSS. All fixed!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Woo Commerce Table Width Cut Off On Cart Page, Not Responsive on Mobile’ is closed to new replies.