• Resolved alaid

    (@alaid)


    Hi,

    I need to solve the issue that is created by placing the quantity suffix next to the price.

    I used a Hook that allows this, but it doesn’t work for me.

    if ( ! is_admin() ) {
    add_filter( ‘woocommerce_get_price_suffix’, ‘upw_add_price_suffix’, 10, 4 );
    }
    function upw_add_price_suffix( $html, $product, $price, $qty ) {
    $suffix = $product->get_meta( ‘_upw_quantity_suffix’ );
    return $suffix ? $html . ‘ x ‘ . $suffix : $html;
    }

    My intention is that “x kg” appears next to the price.

    The theme I use is Flatsome

    Please help me with the hook to put the suffix on the right side of the price.

    Thanks.

    • This topic was modified 4 years, 9 months ago by alaid.
Viewing 1 replies (of 1 total)
  • Plugin Author Condless

    (@condless)

    Hi Alaid,

    For the price suffix: enable the ‘Price for display’ option (via the main plugin settings page) and use the ‘Price Suffix’ option (via the ‘Unit Price’ tab of the edit product screen).

    For the quantity suffix to be displayed properly edit the /wp-content/themes/flatsome/woocommerce/global/quantity-input.php file so the line:
    <?php do_action( ‘woocommerce_after_quantity_input_field’ ); ?>
    will be under the line:
    <?php echo $qty_end; ?>
    You will have to repeat this modification after each theme update.

Viewing 1 replies (of 1 total)

The topic ‘Issue with quantity suffix’ is closed to new replies.