Implement code changes to enhance functionality and improve performance
This commit is contained in:
@@ -12,7 +12,11 @@ foreach ( $products as $product )
|
|||||||
$images = $xpath->query('Linki_do_zdjec/Link_do_zdjecia', $product);
|
$images = $xpath->query('Linki_do_zdjec/Link_do_zdjecia', $product);
|
||||||
|
|
||||||
// Pobieramy wartość elementu <Cena_detaliczna_brutto>
|
// Pobieramy wartość elementu <Cena_detaliczna_brutto>
|
||||||
$price = $xpath->evaluate('number(Cena_detaliczna_brutto)', $product);
|
$price = ceil($xpath->evaluate('number(Cena_detaliczna_brutto)', $product));
|
||||||
|
$priceNodeList = $xpath->query('Cena_detaliczna_brutto', $product);
|
||||||
|
if ($priceNodeList->length > 0) {
|
||||||
|
$priceNodeList->item(0)->nodeValue = $price;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Jeśli nie ma żadnego elementu <Link_do_zdjecia>, usuwamy element <Produkt>
|
// Jeśli nie ma żadnego elementu <Link_do_zdjecia>, usuwamy element <Produkt>
|
||||||
|
|||||||
Reference in New Issue
Block a user