File: /home/royaltuning/www/public/wp-content/uploads/wpallexport/functions.php
<?php
function getNetto($price)
{
$netto = round($price / 1.27);
return $netto;
}
function getCategoryId($product_id)
{
$terms = get_the_terms($product_id, 'product_cat');
$cat_id = [];
foreach ($terms as $term) {
$cat_id[] = $term->term_id;
}
return implode(",", $cat_id);
}
function delete_all_between($beginning, $end, $string)
{
$string = strip_tags($string);
$beginningPos = strpos($string, $beginning);
$endPos = strpos($string, $end);
if ($beginningPos === false || $endPos === false) {
return $string;
}
$textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos);
return delete_all_between($beginning, $end, str_replace($textToDelete, '', $string));
}
?>