• Resolved svarogwolf

    (@svarogwolf)


    Can u please add an option or set by default to show only the color label in the Palette title

    For exemple here : https://www.eurobject.fr/colorlabel.jpg
    The title is “#FE7531-Orange”
    Can u change it to “Orange” or add an extra option to change it

    It can be a select list “Title type” with choice :
    – Full title
    – Label
    – HEX/RGB code
    – No title

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    You can use following filter to change palette title as need:

    add_filter('ppom_option_label', 'ppom_change_palette_label', 99, 4);
    function ppom_change_palette_label($label, $option, $meta, $product) {
        
        if($meta['type'] != 'palettes') return $label;
    
        $color_label_arr = explode('-', $option['option']);
    	$color_code = trim($color_label_arr[0]);
    	$color_label = '';
    	if(isset($color_label_arr[1])){
    		$label = trim($color_label_arr[1]);
    		// If Need to hid price comment this
    		$label .= ' - '. ppom_price($option['price']);
    	}
    	
    	return $label;
    }

    You can comment followoing line from above code if want to disable price:
    $label .= ' - '. ppom_price($option['price']);

    How to use
    Paste this code into your theme’s functions.php file.

    • This reply was modified 7 years, 3 months ago by N-Media.
    Thread Starter svarogwolf

    (@svarogwolf)

    A select list would really be a better solution

    It can be a select list “Title type” with choice :
    – Full title
    – Label
    – HEX/RGB code
    – No title

    Ok, for now, you can above script.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Palette title’ is closed to new replies.