• 01-12-2023, 08:43:51
    #1
    Merhaba,

    Bir script koduna ihtiyacım var nasıl yapabilirim


    Ürüne girdiğimde ürüne 45 gün ile 55 gün üzerine koyup bu şekilde yazmasını sağlayacağım nasıl yapabilirim
  • 01-12-2023, 08:56:48
    #2
    $bugun = date("d.m.Y"); // Bugünün tarihini alır
    $gelecek_tarih = date('d.m.Y’ ,strtotime($bugun . ' +45 days')); // Bugüne 45 gün ekler

    echo $gelecek_tarih; // Yeni tarihi yazdırır
  • 01-12-2023, 09:30:34
    #3
    brkctk adlı üyeden alıntı: mesajı görüntüle
    $bugun = date("d.m.Y"); // Bugünün tarihini alır
    $gelecek_tarih = date('d.m.Y’ ,strtotime($bugun . ' +45 days')); // Bugüne 45 gün ekler

    echo $gelecek_tarih; // Yeni tarihi yazdırır
    bu tarz birşey yaptım ama varmı eksiğim

    <script>
    document.addEventListener('DOMContentLoaded', function () {
    setTimeout(() => {
    console.log("init du texte d'expédition - v0.0.1");

    const date = new Date();
    const hour = (date.getUTCHours() + 3) % 24;

    const targetButtonClass = "product-detail-page-buy-box";
    const selectedButton = document.getElementsByClassName(targetButtonClass)[0];

    const minGunuEkle = 45;
    const maxGunuEkle = 55;

    const minTeslimTarihi = new Date(date.getTime() + minGunuEkle * 24 * 60 * 60 * 1000);
    const maxTeslimTarihi = new Date(date.getTime() + maxGunuEkle * 24 * 60 * 60 * 1000);

    const ayIsimleriFransizca = [
    "Janvier", "Février", "Mars", "Avril", "Mai", "Juin",
    "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
    ];

    const minTarihStr = `${minTeslimTarihi.getDate()} ${ayIsimleriFransizca[minTeslimTarihi.getMonth()]} ${minTeslimTarihi.getFullYear()}`;
    const maxTarihStr = `${maxTeslimTarihi.getDate()} ${ayIsimleriFransizca[maxTeslimTarihi.getMonth()]} ${maxTeslimTarihi.getFullYear()}`;

    const teslimTarihiMesaji = `Livraison entre le ${minTarihStr} et le ${maxTarihStr}.`;

    const yeniElement = `<p style="margin: 10px 0;">${teslimTarihiMesaji}</p>`;

    selectedButton.insertAdjacentHTML('afterend', yeniElement);
    }, 2000);
    });
    </script>