• Resolved airplanetees

    (@airplanetees)


    If you see this webpage https://airplanetees.com/boeing-737-luggage-tag/ Once you go through the product fields some fields aren’t required. I would like to show them in the cart as blank if I’m able.

    Example: User fills out the site like this.

    Line 1: Dan Pooler
    Line 2:
    Line 3: 555-555-5555
    Line 4: [email protected]
    Line 5:

    Cart and the admin order email will show:
    Line 1: Dan Pooler
    Line 3: 555-555-5555
    Line 4: [email protected]

    But I would like to show it like:
    Line 1: Dan Pooler
    Line 2:
    Line 3: 555-555-5555
    Line 4: [email protected]
    Line 5:

    Is this possible? I tried by putting a “SPACE” in the default but then I lose the example text which is nice. Thoughts? I bought you a coffee!!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Krzysztof Pi?tkowski

    (@wckalkulator)

    @airplanetees Hi, this is not possible by default, but you should override view file: https://github.com/piatkowski/wckalkulator/blob/master/views/fields/cart.php

    As you can see there is if($has_value), which should be removed if you need to show line items without values.

    To do so, copy file from plugin’s directory from views/fields/cart.php to your-theme/wc-kalkulator/fields/cart.php and make changes (remove if($has_value) or set $has_value to always true).

    Thread Starter airplanetees

    (@airplanetees)

    Sorry not a programmer…
    So I would completely remove each line? Like this?
    How to set value to always true?

    <?php
    if (!defined(‘ABSPATH’)) {
    exit;
    }

    $has_image = !empty($view->image);
    $has_colorswatch = !empty($view->colorswatch);

    if ($has_image || $has_colorswatch): ?>
    <?php echo esc_html($view->title); ?>:<br/>
    <?php endif; ?>

    <?php if ($has_image): ?>
    image); ?>” width=”64″ alt=””/>
    <?php endif; ?>

    <?php if ($has_colorswatch): ?>
    <span class=”wck-colorswatch” style=”background-color: <?php echo esc_html($view->colorswatch); ?>”></span><br/>
    <?php endif; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blank Fields in Cart’ is closed to new replies.