PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

[Module] List of customer out of stock registrations

77 replies to this topic
#1
presta-dyr

    PrestaShop Fanatic

  • Moderators
  • 1045 posts
This small module lists registrations for out of stock products done via the mailalerts module. If customers are registered their name is shown. In any case the e-mail and the product is listed.

Updated 2010-05-27: Fixed bug for multiple pages
Updated 2010-12-18: Added colors and added delete function
Updated 2010-12-18: Fixed count for attributes
Updated 2012-01-18: Fixed count for attributes

/Kjeld

Attached Files



#2
yaya

    PrestaShop Apprentice

  • Members
  • PipPip
  • 294 posts
Hi,

where can we see customers who are waiting for out of stock products. (which page)

thx

#3
presta-dyr

    PrestaShop Fanatic

  • Moderators
  • 1045 posts
Under the statistics tab.

/Kjeld

#4
yaya

    PrestaShop Apprentice

  • Members
  • PipPip
  • 294 posts
ok thx
But i have a problem, because i have uninstall statistics tab on my board ....

#5
presta-dyr

    PrestaShop Fanatic

  • Moderators
  • 1045 posts
You can install it again from the tools->tabs menu.

/Kjeld

Attached Files



#6
nuttis

    PrestaShop Apprentice

  • Members
  • PipPip
  • 130 posts
thanks for the module. its working perfectly!

#7
safa

    PrestaShop Addict

  • Moderators
  • 968 posts
thanks for works.
Posted Image

Sanal Pos Modülü İçin tıklayınız.(Tüm Bankalar Api ve 3d Secure)

#8
presta-dyr

    PrestaShop Fanatic

  • Moderators
  • 1045 posts
There was a bug when the number of customers grew to two pages. I have updated the attachment in the first message in this thread.

/Kjeld

#9
SpyrosT

    PrestaShop Apprentice

  • Members
  • PipPip
  • 305 posts
nice one! I will give it a try.

#10
SpyrosT

    PrestaShop Apprentice

  • Members
  • PipPip
  • 305 posts
Is there a way to delete the fake lists?
There are a lot showing "your@email.com"

#11
Pippo3000

    PrestaShop Apprentice

  • Members
  • PipPip
  • 411 posts

From 1268350571:

This small module lists registrations for out of stock products done via the mailalerts module. If customers are registered their name is shown. In any case the e-mail and the product is listed.

Updated 2010-05-27: Fixed bug for multiple pages

/Kjeld


Thanks, Kjeld! Great work, seems to work perfectly with PS1.3.2

Phil
PS v1.3.2.x

#12
Ian Reynolds

    PrestaShop Newbie

  • Members
  • Pip
  • 7 posts
I am using 1.3.2.3 and have just updated to the newest version (top of thread) still I only see one page of 20 names?

Does this work with 1.3.2.3?

Thanks

Ian

#13
Zenith

    PrestaShop Apprentice

  • Members
  • PipPip
  • 386 posts
I'm using it on SVN 1.4 and have been using it since 1.2.5 - just compared my code (had to make some changes for 1.4 version) and it's still the same base code for the pagination. Should work for you, maybe you don't have more than 20 mail alerts?

Look in the database, in the "mailalert_customer_oos" table to see how many entries you have.

#14
noesac

    PrestaShop Apprentice

  • Members
  • PipPip
  • 492 posts
Possible to add a date column on this?

#15
Zenith

    PrestaShop Apprentice

  • Members
  • PipPip
  • 386 posts
It is, I have added a date, but it requires modifying the database and core files, as the date is not recorded in the database by default.

If you are willing to make the changes let me know and I'll post up instructions.

#16
noesac

    PrestaShop Apprentice

  • Members
  • PipPip
  • 492 posts
That would be great thanks. Is it a risky change?

#17
Zenith

    PrestaShop Apprentice

  • Members
  • PipPip
  • 386 posts
No risks, just either have to work around the changes if you update, or apply them to the new version files.

Via phpMyAdmin alter the table...
ALTER TABLE `ps_mailalert_customer_oos` ADD `date_add` DATE NOT NULL


-----[ OPEN ]-----
modules/mailalerts/mailalerts.php


-----[ FIND ]-----
    `id_product_attribute` int(10) unsigned NOT NULL,


-----[ ADD AFTER ]-----
    `date_add` date NOT NULL,


-----[ OPEN ]-----
modules/statsoos/statsoos.php


-----[ FIND ]-----
      SELECT `id_customer`, `customer_email`, `id_product`, `id_product_attribute`


-----[ REPLACE WITH ]-----
          SELECT `id_customer`, `customer_email`, `id_product`, `id_product_attribute`, `date_add`


-----[ FIND ]-----
      '.$this->l('Customer').''.$this->l('E-mail').''.$this->l('Product').''.$this->l('Attribute').'';


-----[ REPLACE WITH ]-----
      '.$this->l('Date').''.$this->l('Customer').''.$this->l('E-mail').''.$this->l('Product').''.$this->l('Attribute').'';


-----[ FIND ]-----
    '.$customerName.'


-----[ ADD BEFORE ]-----
                '.$oosPage['date_add'].'


-----[ OPEN ]-----
modules/mailalerts/mailalerts-ajax_add.php


-----[ FIND ]-----
    REPLACE INTO `'._DB_PREFIX_.'mailalert_customer_oos` (`id_customer`, `customer_email`, `id_product` , `id_product_attribute`)
VALUES ('.intval($id_customer).', \''.pSQL($customer_email).'\', '.intval($id_product).', '.intval($id_product_attribute).')'))


-----[ REPLACE WITH ]-----
    REPLACE INTO `'._DB_PREFIX_.'mailalert_customer_oos` (`id_customer`, `customer_email`, `id_product` , `id_product_attribute`, `date_add`)
VALUES ('.intval($id_customer).', \''.pSQL($customer_email).'\', '.intval($id_product).', '.intval($id_product_attribute).', \''.date('Y-m-d').'\')'))


I think these are the only changes, let me know how it goes as I may have forgotten a change somewhere - was awhile ago I added this.

#18
maestrobo

    PrestaShop Apprentice

  • Members
  • PipPip
  • 51 posts
@zenith: thanks for the hack. very useful.

for the last replace, not sure your parenthesis are correct. mine are like this and that work like a charm :)


if (Db::getInstance()->Execute('
REPLACE INTO `'._DB_PREFIX_.'mailalert_customer_oos` (`id_customer`, `customer_email`, `id_product` , `id_product_attribute`, `date_add`)
VALUES ('.intval($id_customer).', \''.pSQL($customer_email).'\', '.intval($id_product).', '.intval($id_product_attribute).', \''.date('Y-m-d').'\')'))

Using Prestashop 1.3.2 on MySQL 4.1.22 - Fix duplicate product issue! (not fixed in 1.3.2) - Please avoid SELECT statement as SQL value for MYSQL compatibility issues. Thanks.

#19
Zenith

    PrestaShop Apprentice

  • Members
  • PipPip
  • 386 posts
Happy to help!

It's this forum code that removed the last apostrophe from mine. As long as you have it working ;)

#20
Pippo3000

    PrestaShop Apprentice

  • Members
  • PipPip
  • 411 posts

From 1281655766:

Is there a way to delete the fake lists?
There are a lot showing "your@email.com"


yes, would like to be able to delete entries, too. no fakes (yet) but some customers are waiting for products which will not be in stock again, so I would like to get rid of those in the statsoos statistic.

phil
PS v1.3.2.x