• Resolved joshuausaxray

    (@joshuausaxray)


    How do I have the base price shown on the bottom?

    For Example if they selected everything where there is no increase in price, the price does not show. It shows the additional price and final cost if you selected additional features but still does not show base cost. How do I fix this?

    Further information: I am using elementor pro (Hello Elementor theme), woocommerce, and Flexible Product Fields (WooCommerce Product Addons) to develop this website

    this is our competitor we know they use a different plugin “Gravity Forms” but this is what we want to achieve… https://protechmed.com/product/back-relief-apron/

    I hope I gave all the relevant details needed.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Tomasz WP Desk

    (@tomaszwp)

    Hello @joshuausaxray

    I am sorry but that is not possible. This is a plugin for WooCommerce and WooCommerce products have a price shown above the product description. So there is no need to show the same price a second time if the product options do not increase it. I assume that in this case the price has been removed in Elementor.

    The solution is to add a 0.00 price to each option that is not paid. I would then consider adding a plus sign before the price in parentheses. The result will be as in the example below.
    Example

    Adding a plus before a price greater than 0

    Plugin Support Tomasz WP Desk

    (@tomaszwp)

    I am marking this topic as resolved as we have not received any new replies. Please let us know if you need our help again.

    I wrote this code to achieve this and it 100% works (I’m using Todd Mottos html5 blank theme). Goes in your functions.php.

    This code displays the base product name and its price with all the addons selected for the product. It also shows the quantity and updates it based on what quantity you choose.

    It also validates if the addons summary element is shown. If it isn’t shown (since no addons are selected) it will not show the product name and price.

    // Add price to fpf counter in bottom
    function add_dynamic_product_data_to_footer() {
    if (is_product()) {
    global $product;
    $product_name = $product->get_name();
    $product_price = wc_price($product->get_price());
    ?>
    <script type="text/javascript">
    jQuery(document).ready(function($) {
    var productName = <?php echo json_encode($product_name . ':'); ?>;
    var productPrice = <?php echo json_encode($product_price); ?>;
    function updateProductNameWithQuantity() {
    var quantity = $('.quantity .qty').val() || 1;
    var formattedProductName = quantity + ' x ' + productName;
    $('#fpf_totals dt.product-name').text(formattedProductName);
    }
    function addProductNameAndPrice() {
    if (!$('#fpf_totals dt.product-name').length) {
    var newDt = $('<dt class="product-name"></dt>').text(productName);
    var newDd = $('<dd class="product-price"></dd>').html(productPrice);
    $('#fpf_totals').prepend(newDd).prepend(newDt);
    updateProductNameWithQuantity();
    }
    }
    $('.quantity .qty').on('change', function() {
    updateProductNameWithQuantity();
    });
    var observer = new MutationObserver(function(mutations) {
    mutations.forEach(function(mutation) {
    if ($('#fpf_totals').css('display') !== 'none') {
    addProductNameAndPrice();
    }
    });
    });
    observer.observe($('.fpf-totals')[0], {
    childList: true,
    subtree: true
    });
    });
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'add_dynamic_product_data_to_footer');
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Base Price not shown’ is closed to new replies.