Try to replace your code with the following one
function woodmart_get_gradient_css( $gradient_attr ) {
$gradient_css = explode( '|', $gradient_attr );
$css = $gradient_css[1];
$webkit_css = $gradient_css[1];
if ( strstr( $css, 'left' ) ) {
$css = str_replace( 'left', 'to right', $gradient_css[1] );
} elseif ( strstr( $css, 'right' ) ) {
$css = str_replace( 'right', 'to left', $gradient_css[1] );
} elseif ( strstr( $css, 'top' ) ) {
$css = str_replace( 'top', 'to bottom', $gradient_css[1] );
} elseif ( strstr( $css, 'bottom' ) ) {
$css = str_replace( 'bottom', 'to top', $gradient_css[1] );
}
$result = 'background-image:-webkit-' . $webkit_css . ';';
$result .= 'background-image:' . $css . ';';
return $result;
}