Jump to content

Powiadomienia o dostępności - lista oczekujących, jak?


kreatywneprojektowan

Recommended Posts

2 hours ago, atomek said:

Kto i o co pyta znajdziesz w tabeli ps_mailalert_customer_oos. Można dorobić np. własny moduł wyświetlający zawartość tej tabeli.

Rozumiem, że chodzi o bazę danych ? Jeśli tak to dziękuje i jest to faktycznie świetny pomysł ( przecież w niej znajdziemy wszystko, a nie pomyślałem jakoś o niej..).
A moduł działający już pod te mailalerts istnieje ?

Link to comment
Share on other sites

  • 2 weeks later...

Presta 1.6? Jeśli tak to wrzuć ten plik do modules/mailalerts i odpal z url strony http://twojadomena.pl/modules/mailalerts/twojanazwapliku.php 

 

<?php

require_once(dirname(__FILE__).'/../../config/config.inc.php');
include_once(dirname(__FILE__).'/mailalerts.php');

class MailAlertsBulk extends MailAlerts
{
    public function getAllMailAlertsForOutOfStock($id_shop = 1, $id_lang = 1)
    {
        $sql = 'SELECT * FROM '._DB_PREFIX_.'mailalert_customer_oos
            WHERE id_lang = '.(int)$id_lang.' AND id_shop = '.(int)$id_shop;

        return Db::getInstance()->executeS($sql);
    }
}


$mab = new MailAlertsBulk();

$id_shop = (isset($_GET['id_shop'])) ? $_GET['id_shop'] : 1;
$id_lang = (isset($_GET['id_lang'])) ? $_GET['id_lang'] : 1;

$mail_alerts = $mab->getAllMailAlertsForOutOfStock($id_shop, $id_lang);

if ($mail_alerts) {
  echo '<ol>';
  foreach ($mail_alerts as $alert) {
    $product = new Product((int)$alert['id_product']);
    $link = new Link();
    $product_name = $product->getProductName((int)$alert['id_product'], (int)$alert['id_product_attribute']);
    $product_link = $link->getProductLink($product, null,null,null,$id_lang,$id_shop, (int)$alert['id_product_attribute'], 0, 0, true);
    echo '<li><a href="'.$product_link.'">'.$product_name.'</a> ['.$alert['customer_email'].']</li>';
  }
  echo '</ol>';
}


Nie testowałem, bo u siebie mam trochę bardziej rozbudowaną wersję i na szybko to uciąłem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...