• Resolved tuomvii

    (@tuomvii)


    Hi!

    For some reason my client had his product page’s price options made with your plugin changed a little bit. Before it was like this:

    1 unit (24,90 €)
    3 units (44,90 €)
    5 units (99,90 €)

    But now it shows like this:

    1 unit [+24,90 €]
    3 units [+44,90 €]
    5 units [+99,90 €]

    How the brackets change and the plus sign appear there when they weren’t there before? Did something change and I can revert this change?

    Thanks in advance!

    • This topic was modified 5 years, 2 months ago by tuomvii.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @tuomvii,

    Yes we have updated updated, some clients didn’t like old style with () so we replaced. But you can control this with filter:

    add_filter('ppom_option_label', 'ppom_change_label', 11, 4);
    function ppom_change_label($label, $option, $meta, $price){
       
        $label = "{$option_label}(+{$price})";
        return $label;
    }
    Thread Starter tuomvii

    (@tuomvii)

    Thank you very much for this @nmedia! One simple question, does removing the plus sign affect the plugin somehow? Is it mandatory?

    And for some reason when using that snippet, it doesn’t show the option labels “1 unit”, “3 units” etc.

    • This reply was modified 5 years, 2 months ago by tuomvii.

    Hi,

    No won’t affect any calculation. And what do you mean by doesn’t show option label…

    Thread Starter tuomvii

    (@tuomvii)

    @nmedia, before the snippet it shows the options like this:

    1 unit [+24,90 €]
    3 units [+44,90 €]
    5 units [+99,90 €]

    When I use this snippet in the functions.php file:

    add_filter('ppom_option_label', 'ppom_change_label', 11, 4);
    function ppom_change_label($label, $option, $meta, $price){
       
        $label = "{$option_label}({$price})";
        return $label;
    }

    Notice that I removed the plus sign on purpose.

    But after it show’s like this:

    (24,90 €)
    (44,90 €)
    (99,90 €)

    So the labels before the prices are removed and not showed.

    Sorry, here is the correct code:

    add_filter('ppom_option_label', 'ppom_change_label', 11, 4);
    function ppom_change_label($label, $option, $meta, $price){
       
        $option_label = $option['option'];
        $label = "{$option_label}({$price})";
        return $label;
    }
    Thread Starter tuomvii

    (@tuomvii)

    @nmedia thank you very much for your response! This works beautifully now. Will be using your plugin in the future too. Nice support <3

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Radio button price options changed’ is closed to new replies.