Vinoteca: wine shop on 1C-Bitrix (module, template, components, pages)

This commit is contained in:
jimagie committed 2026-10-22 19:35:23 +05:00
commit 0590195880
593 files changed
+27942

No files matched your search

@@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
namespace Jinove\Vinoteca;
use Jinove\Vinoteca\Catalog\PriceRange;
final class StoreSchema
{
private const OPENS = "10:00";
private const CLOSES = "21:00";
private const COUNTRY = "RU";
private const CURRENCY = "RUB";
private const DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
public static function graph(array $contacts, string $description, string $street, string $city): array
{
$host = Config::host();
$store = $host . "/#store";
return [
"@context" => "https://schema.org",
"@graph" => [
[
"@type" => "LiquorStore",
"@id" => $store,
"name" => "Vinoteca",
"description" => $description,
"url" => $host . SITE_DIR,
"logo" => $host . SITE_TEMPLATE_PATH . "/assets/brand/vinoteca-icon-512.png",
"image" => $host . SITE_TEMPLATE_PATH . "/assets/media/og-home.jpg",
"telephone" => $contacts["phone"],
"email" => $contacts["email"],
"address" => [
"@type" => "PostalAddress",
"streetAddress" => $street,
"addressLocality" => $city,
"addressCountry" => self::COUNTRY,
],
"openingHoursSpecification" => [[
"@type" => "OpeningHoursSpecification",
"dayOfWeek" => array_map(static fn(string $day): string => "https://schema.org/" . $day, self::DAYS),
"opens" => self::OPENS,
"closes" => self::CLOSES,
]],
"currenciesAccepted" => self::CURRENCY,
"priceRange" => PriceRange::get(),
"sameAs" => [$contacts["telegram"]],
],
[
"@type" => "WebSite",
"@id" => $host . SITE_DIR . "#website",
"url" => $host . SITE_DIR,
"name" => "Vinoteca",
"inLanguage" => LANGUAGE_ID,
],
],
];
}
}