Το προϊόν “Delsey τσαντάκι ώμου Picpus Black” έχει προστεθεί στο καλάθι σας. Συνεχίστε τις αγορές
| Σύνολα καλαθιού |
|---|
Σύνολα καλαθιού
| Υποσύνολο | 45,00 € | |||
|---|---|---|---|---|
|
||||
| Σύνολο | 45,00 € | |||
Visa
MasterCard
Cash On Delivery
Bank Transfer
Apple Pay
Google Pay
get_sku(); // Νόμισμα/τιμές $currency = get_woocommerce_currency(); $price = wc_get_price_to_display($product, ['price' => $product->get_price()]); $in_stock = $product->is_in_stock(); // Availability mapping $availability = $in_stock ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock'; if ( $product->is_on_backorder() ) $availability = 'https://schema.org/BackOrder'; if ( $product->is_on_pre_order() ) $availability = 'https://schema.org/PreOrder'; // Προτεραιότητα σε sale price αν υπάρχει if ( $product->is_on_sale() ) { $price = wc_get_price_to_display($product, ['price' => $product->get_sale_price()]); } // Brand ανίχνευση (προσπαθεί σε συνήθη taxonomies/attributes) $brand_name = null; $brand_taxonomies = ['product_brand', 'brand', 'pa_brand', 'pa_marka']; // προσάρμοσε αν χρειάζεται foreach ($brand_taxonomies as $tax) { if ( taxonomy_exists($tax) ) { $terms = wp_get_post_terms(get_the_ID(), $tax, ['fields' => 'names']); if ( ! is_wp_error($terms) && ! empty($terms) ) { $brand_name = $terms[0]; break; } } } // Fallback αν δεν βρεθεί taxonomy if (!$brand_name) $brand_name = 'AlhimistisBags'; // Προαιρετικά: χαρτογράφηση brand → επίσημο URL (βελτιώνει το Knowledge Graph) $brand_map = [ 'Delsey' => 'https://www.delsey.com/', 'The Chesterfield Brand' => 'https://chesterfieldbags.com/', 'Camel Active' => 'https://www.camelactive.com/', 'Kipling' => 'https://www.kipling.com/', 'Caterpillar' => 'https://www.catlifestyle.com/', 'Bange' => 'https://www.bange-bag.com/', 'Porsche Design' => 'https://www.porsche-design.com/', 'Travelite' => 'https://www.travelite.com/', 'Cabin Zero' => 'https://www.cabinzero.com/', "Bric's" => 'https://www.brics.it/', 'Piquadro' => 'https://www.piquadro.com/', 'BG Berlin' => 'https://bgberlin.com/', 'Knirps' => 'https://www.knirps.com/', 'AlhimistisBags' => 'https://alhimistisbags.gr/' ]; $brand_url = $brand_map[$brand_name] ?? null; // Προσπάθεια άντλησης GTIN/EAN αν υπάρχει σε κοινά meta keys (προαιρετικό) $gtin = get_post_meta(get_the_ID(), '_wc_gpf_google_gtin', true); if (!$gtin) $gtin = get_post_meta(get_the_ID(), '_alg_ean', true); if (!$gtin) $gtin = get_post_meta(get_the_ID(), 'ean', true); // Περιγραφή: κόψε ασφαλώς $desc = wp_strip_all_tags(get_post_field('post_excerpt', get_the_ID())); if (empty($desc)) $desc = wp_strip_all_tags(get_post_field('post_content', get_the_ID())); $desc = mb_substr($desc, 0, 1000); // Χτίζουμε το JSON-LD Product $data = [ '@context' => 'https://schema.org/', '@type' => 'Product', '@id' => $url . '#product', 'name' => $name, // ← λύνει το “λείπει το name” 'url' => $url, 'image' => $image ?: [], 'description' => $desc, 'sku' => $sku ?: null, 'brand' => [ '@type' => 'Brand', 'name' => $brand_name ], 'offers' => [ // ← λύνει το “προσθέστε offers/review/aggregateRating” '@type' => 'Offer', 'url' => $url, 'priceCurrency' => $currency, 'price' => (string) wc_format_decimal($price, 2), 'availability' => $availability, 'itemCondition' => 'https://schema.org/NewCondition', 'seller' => [ '@type' => 'Organization', 'name' => 'AlhimistisBags' ] ] ]; if ($brand_url) { $data['brand']['sameAs'] = [$brand_url]; } if ($gtin) { $data['gtin'] = (string) $gtin; // Schema.org δέχεται gtin γενικό κλειδί (gtin13/gtin14 αν θέλεις πιο αυστηρά) } // Εκτύπωση echo ''; }, 99);