Site logo

[Support request] Alignement of product description in woocommerce cart

Home Forums Support [Support request] Alignement of product description in woocommerce cart

Home Forums Support Alignement of product description in woocommerce cart

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #2597722
    Emanuel

    Themeversion: 3.3.0
    GP Premium: 2.3.1

    Hello!

    I’m wondering why the alignment of the product description after adding it to the cart is not straight.
    I’m using the “Deposits & Partial Payments for WooCommerce” plugin which adds 2 lines for payment now and payment later. The description text is bolt and the details are not. This lets the lines look not aligned.
    You can see the problem easy by viewing the site:
    https://www.flyairea.com/shop/tandemfluege/tandemflug-im-oetztal
    and adding any appointment to the cart with clicking “Verfügbarkeit prüfen”.
    Having the item in the cart there is a description also for the date of flight and time. This is some details coming from the woocommerce appointment plugin. But the problem is also there for any normal product which is not an appointment.

    I tried to make some css settings but I absolutely don’t know how it could work.
    I guess it could be made some css to
    tr.woocommerce-cart-form__cart-item.cart-item

    I think you from the support are way faster then me.
    Thanks a lot in advance!

    #2598024
    David
    Staff
    Customer Support

    Hi there,

    does this CSS work:

    .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio .awcdp-deposits-description {
        margin-left: 34px;
    }
    #2599197
    Emanuel

    Hi!

    Unfortunately not, but I found out with the Firefox Developer Edition, that the line-height property which was set to 22px is too small and I added a custom css like this:

    /*Im Warenkorb anpassen, dass die Angaben auf der richtigen Höhe sind*/
    .woocommerce td.product-name .wc-item-meta p, .woocommerce td.product-name .wc-item-meta:last-child, .woocommerce td.product-name dl.variation p, .woocommerce td.product-name dl.variation:last-child {
      line-height: 28px;
    }

    The line height and alignment looks ok with 28px.

    What I still don’t like is, when the width of the window is too small, that for example the price get’s a line brake in the middle of the number. It would be better to write it then completely in a new line.
    My other idea was to change the complete cart and checkout page with generateblocks. Could this be done? Because as well the size of the table is to big on mobile on the checkout page.

    @media(max-width: 768px) {
    .woocommerce table.shop_table.woocommerce-checkout-review-order-table {
      border: 1px solid rgba(0,0,0,.1);
      margin: 0 -1px 24px 0;
      text-align: left;
      width: 90%;
      border-collapse: separate;
      border-radius: 5px;
    }
    }

    In Firefox developer it’s changing the width with this css but with custom css this is not working.

    #2599390
    David
    Staff
    Customer Support

    Its not possible at this time to edit those page using the block editor/

    For the cart page you can reduce the padding around the table:

    
    @media(max-width: 768px) {
        .woocommerce-page table.shop_table_responsive tr td {
            padding: 10px 0;
        }
    }

    For the checkout – do i need an account to see that ?

    #2599425
    Emanuel

    Hello David and Thank you a lot!

    With reducing the padding there is still the line brake on the cart page for example:
    Anzahlungsbetrag: 32,
    00 €

    And yes, sorry, for the checkout page the login details are needed which I’m adding now to the private information.

    To edit the checkout page, I found this with FunnelKit:
    https://www.wpbeginner.com/wp-tutorials/how-to-customize-woocommerce-checkout-page/
    or this with CartFlows:
    https://wpastra.com/woocommerce-tutorial/woocommerce-checkout-page/

    Is there any docu / recommended way with GP?
    I want to decide if I should better learn new stuff with generateblocks (to use inside Funnel or CartFlows) or elementor. But this has time for later – for now I’m totally satisfied if the checkout page is displaying all information in a correct way and working 😉

    Emanuel

    #2600787
    David
    Staff
    Customer Support

    There isn’t a GP tutorial for checkout page customizations. As we don’t add a Checkout Template, aside from some minimal styling that GP, what you see is the work of the Woo plugins template.
    And the checkout table template in Woo isn’t very responsive especially when extra variations or long words are involved.

    So what can we do:

    1. Customizer > Layout > Container – in the mobile preview, reduce the Left and Right Padding to give the tables some extra space.

    2. Some CSS to reduce general table padding and optionally reduce the font size:

    .woocommerce table.shop_table td, .woocommerce table.shop_table th {
      padding: 10px 5px !important;
      font-size: 16px !important;
    }
    

    3. Considering those issues on the Checkout page, it may make sense to change the table layout to a stack:

    .woocommerce-checkout .woocommerce table.shop_table tr {
      display: flex;
      flex-direction: column;
    }
    
    .woocommerce-checkout .woocommerce table.shop_table th.product-total {
      display: none;
    }
    
    .woocommerce-checkout .woocommerce table.shop_table td.product-total {
      font-weight: bold;
      font-size: 1.2em;
      border-bottom-width: 4px;
    }
    #2600912
    Emanuel

    Hi David,

    1. left and right padding reduced
    2. table padding and font size looks perfect with this values
    3. layout as a stack looks nice!

    Thanks a lot!

    Can I add some CSS that the value of the price (cart and checkout site) always makes a complete line break as soon as it’s not fitting?
    In Firefox developer edition this is already automatically.
    There is either:
    Anzahlungsbetrag: 0,20 €
    or
    Zukünftige Zahlungen:
    0,80 €

    In Chrome it’s still sometimes
    Anzahlungsbetrag: 0,2
    0 €

    Would be nice to always break the complete price down to the next row and not leave some rest.

    Emanuel

    #2601101
    David
    Staff
    Customer Support

    Is that issue seen on a actual mobile device? Or only in the developers tools on chrome desktop ?

    #2601148
    Emanuel

    Hi David,

    yes, I have the issue with the breaks in the middle of the price on my android phone (Ulefon Armor 17 Pro, android 12) and also when I’m resizing the chrome browser.

    And what is strange:
    I switched off “germanized for woocommerce” to make the settings. Now I switched it on again and the stack-table is away again.
    I guess it has just another class-ID now?

    Emanuel

    #2603795
    David
    Staff
    Customer Support

    Hmmm…. so where is the CSS added?
    I see it load on the Cart Page.
    On the Checkout it is not showing BUT if i add the CSS using the browser developers tools it does work…..

    #2608266
    Emanuel

    Hello David,

    I commented the css out as it was doing nothing.

    Now I’m using this:

    .woocommerce-checkout-review-order-table tr {
      display: flex;
      flex-direction: column;
    }
    
    .woocommerce-checkout-review-order-table th.product-total {
      display: none;
    }
    
    .woocommerce-checkout-review-order-table td.product-total {
      font-weight: bold;
      font-size: 1.2em;
    	text-align: right;
      border-bottom-width: 4px;
    }

    I’m leaving the deposit plugin active for now as we can see now as well the line-brake for the prices. The prices are not calculated correct (they made an update for the plugin and did some mistake)

    Could it be made, that at the description for the single product the table has space completely to the right (max border of 10 or 20 pix). Could be something like dl.variation under product-name the width?

    Thanks,
    Emanuel

    #2608389
    David
    Staff
    Customer Support

    Theres a few moving parts here, and yes we could reduce the padding around the description.
    But before we go there, what happens if we stack the image above the description?

    .woocommerce table.shop_table td.product-name div {
        float: none;
    }
    #2608474
    Emanuel

    Yeah, that looks nice!
    And as I can see in the inspector, the padding is automatically more then 😉

    I removed the cart-subtotal as well with:

    .woocommerce-checkout-review-order-table tr.cart-subtotal {
    	display: none;
    }

    Now I think before the tr.order-total (Gesamtsumme) a bigger gray dash would be nice.
    But it’s not working with

    .woocommerce-checkout-review-order-table tr.order-total {
    	border-top: 5px;
    	border-top-color: blue;
    }
    #2609027
    Fernando
    Customer Support

    Hi Emanuel,

    How about this code?:

    .woocommerce-checkout-review-order-table tr.order-total::before {
        content:"";
        height: 5px;
        background-color:blue;
        position: static;
    }
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.