html v datach cez sf_item_data
-
Dobry den,
chcel by som sa spytat ci je nejakym sposobom moznost pouzit html v datach cez sf_item_data.
Idealne by som potreboval nieco taketo, ale na fakture to nie je bold ale to zobrazi “escaped html”, tj. <b>Nazov polozky</b>function bold_sf_item_data( $item_data, $order, $product, $order_item )
{
$product_id = $product->get_id();
if ( $product_id == 12345 )
{
$item_data['name'] = "<b>" . $item_data['name'] . "</b>";
}
return $item_data;
}
add_filter( 'sf_item_data', 'bold_sf_item_data', 10, 4 );Tiez sa mi este nedari poslat medzeru ako prvy znak, na fakture nie je, vyzera ze to robi trim.
function medzera_sf_item_data( $item_data, $order, $product, $order_item )
{
$product_id = $product->get_id();
if ( $product_id == 23456 )
{
$item_data['name'] = " " . $item_data['name'];
}
return $item_data;
}
add_filter( 'sf_item_data', 'medzera_sf_item_data', 10, 4 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.