-
Back In Stock Notifications
Hi,
It gives us great pleasure to release a new Zen Cart module - one which we feel many of you will find very useful!
Back In Stock Notifications
The Back In Stock Notifications is an extremely handy module which lets customers subscribe to a notification list for a product that has gone out of stock.
The subscription process is completely automated, customers don't have to have an account to subscribe themselves, but if they do the subscription is automatically associated with their account.
Once a product is back in stock, an e-mail can be sent to all those subscribed to the notification list for that product, using the convenient admin utility.
Read on to check out all of the features... we're sure you'll find them very comprehensive!
Features
Fully-automated, dynamic subscription display
- As soon as a product goes out of stock, a message asking customers if they want to “be notified when this product is back in stock...” is shown where the Buy Now button would have been.
http://dev.ceon.net/images/back_in_s...ation_link.png - A form is also displayed directly on the Product Info page to encourage a quick and easy subscription! It is pre-filled if the customer is logged in!
- If a customer is already subscribed to the Back In Stock Notification List for this product, a message “You have requested to be notified when this product is back in stock” is displayed instead of the subscribe message. The form also isn't added to the page.
- If a customer is not logged in when they subscribe to a notification list, the subscription is automatically associated with their account.
Fully-automated unsubscriptions
- If a customer has an existing account with the store, they can manage their Back In Stock Notification subscriptions directly in their “My Account” section.
- Customers who have subscribed to a notification list, but don't have an account with the store, can click on a link in their subscription e-mail to unsubscribe, or browse to the unsubscription page on the website and enter the code they were sent in this e-mail.
Intuitive, comprehensive admin utility
The admin utility allows a store owner to view existing subscriptions, send subscription notification e-mails and delete old subscriptions. The options it provides are as follows:
- The current list of products with subscriptions can be viewed. This allows the store owner to quickly and easily see which products customers are interested in as well as the current stock level for each of these products.
- The current list of products with subscriptions can also be viewed with additional information about the customers subscribed and when they subscribed.
- A “Test Run” of the subscription notification mailing can be run. This will let the store owner see who would have been e-mailed, and about which product(s). The first e-mail that would have been sent is sent to the store owner so that they check if the e-mail is formatted correctly before the actual run!
- The actual, real run of the subscription notification mailing can be run. The subscriptions for the completed notifications will then be automatically removed from the database.
- Subscriptions for products which no longer exist can be expunged from the database.
Intelligent notifications
- If a customer is subscribed to several notification lists and a mailing is going out which includes more than one of these products, the notifications for that customer will be combined so they will only receive one e-mail. This looks more professional and minimises any irritation or thoughts of spamming!
Download here
We hope you like this module - feedback is greatly appreciated (As are donations)!
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Looking forward to trying this !
-
Back In Stock Notifications 2.2.0 Released!
Hi,
A new version of this essential module is out now - don't lose out on sales, let people know when a product they want is back in stock! :)
From the changelog:
[ADDED] E-mail confirmation field added to prevent automated scripts spamming the notification form and therefore avoid useless subscriptions and needless bounced confirmation/notification e-mails.
Download 2.2.0 Now!
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Hi
I have installed this, but for some reason the form does not work when I clicl on it.
See on my test site here.
http://www.lozer.co.uk/shop/index.ph...oducts_id=6897
Regards
Laurie
-
Re: Back In Stock Notifications
Hi Laurie,
Quote:
Originally Posted by
chalfontgifts
I have installed this, but for some reason the form does not work when I clicl on it.
You've either:
messed up when modifying tpl_product_info_display.php.
or
A PHP error is occurring within the added code from that template. Are you sure you've uploaded class.CeonXHTMLHiTemplate.php? If that file was missing the PHP code would fail and break the page as it has on your site.
I've released a new version of the software as I found a very minor bug when looking at this for you... please download the new version and use the tpl_product_info_display.php from within it and make sure you've uploaded all the files.
All the best...
Conor
-
Please Help
I have installed the back in stock notification in my cart 1.38.All installations went fine until when i click on an out of stock product,
Suddenly the page goes out of order.I mean i am using a 3 column layout, it all collapses and only this one shows up beneath the product sold out button.
To be notified when this product is back in stock please click here.
The link is also not working.
After hours of digging i finally find out that this section
<!--bof Form close-->
<?php // BEGIN BACK_IN_STOCK_NOTIFICATIONS 2 of 2
if (isset($back_in_stock_notification_build_form) && $back_in_stock_notification_build_form) {
// Build the notification request form
has some problem.When i disable this code,the page get backs to normal.i am desperate.Please help. I Have re installed the application.But no way
:frusty:
Please help me out
-
Re: Please Help
Hi,
Quote:
Originally Posted by
dhanesh
After hours of digging i finally find out that this section
Which version of the module are you using?
The reason your page is not rendering properly is that something within that block of code is failing and PHP is exiting. More than likely the require_once statement which comes after the line you mentioned is not finding the file it needs.
If you insert the following lines after the initial <?php // BEGIN BACK... line, the error message should be displayed:
PHP Code:
@ini_set('display_errors', '1');
error_reporting(E_ALL);
Please post that error message here.
All the best...
Conor
-
Re: Please Help
Hi Conor,
This is the message.
Parse error: syntax error, unexpected T_NEW in /home/electrop/public_html/includes/classes/class.CeonXHTMLHiTemplate.php on line 682
Link: http://electropath.ca
Thanks
-
Re: Please Help
Hi,
Thanks for following up on this.
Argh! You've found problem with the module... I missed out a single PHP 5 keyword in that file... commented several out but missed that one. You're obviously using PHP4 so it failed to parse the file.
I'll release an updated version soon. I'd appreciate it if you could simply try this in the meantime:
Open:
includes/classes/class.CeonXHTMLHiTemplate.php
and change line 682 to the following three lines:
PHP Code:
$extract_more_parts = false;
printf("Couldn't find start tag for %s!\n", $part_name);
//throw new Exception("Couldn't find start tag for $part_name");
Please let me know if that gets things working as expected.
If it does, I'll repackage the module up as 2.2.2.
Sorry once again about the oversight!
All the best...
Conor
-
Re: Back In Stock Notifications
I have replaced the string.
The template system is fine.The page is back to normal.Buts its still showing this error.Please follow this link
http://electropath.ca/index.php?main...ification_form
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
dhanesh
I have replaced the string.
The template system is fine.The page is back to normal.Buts its still showing this error.
Yes, I see that and I know what's causing it... the str_replace method is different in PHP5 from PHP4.
I have to modify the CeonTemplate class to add in backwards compatibility for this function.
Do you mind getting in contact privately please so I can send you the updated file?
http://dev.ceon.net/contact_us
Thanks very much for your patience, we're almost there!
All the best..
Conor
Ceon
-
Re: Back In Stock Notifications
Thanks!!!!!!!!!!!!!!!:hug:
It Worked:clap::clap::clap:
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
dhanesh
It Worked:clap::clap::clap:
That's great! Thanks for letting me know.. I'll have a new version out this weekend with those updates.
I'll post here when it's available. Please update as you are using a slightly older version (that displays the {cofnospam} tag in the confirmation field... ugly ;) ).
All the best...
Conor
-
Re: Back In Stock Notifications
Hi Conor
I think I may have the same problem here with mine as I am running php4 too. Is there any chance you could give me the details of what to change, as I really need to test today.
Regards
Laurie
-
Back In Stock Notifications 2.2.2 Released!
Hi,
A new version of the module has been released with compatibility with PHP4 completed for the CeonXHTMLHiTemplate class.
It can be downloaded here:
http://dev.ceon.net/web/zen-cart/back_in_stock_notifications/downloads
Hopefully the distribution will also be updated in the Zen Cart downloads area.
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications 2.2.2 Released!
Quote:
Originally Posted by
conor
Hopefully the distribution will also be updated in the Zen Cart downloads area.
It can't be if it's not submitted ... typically by someone like the author.
-
Re: Back In Stock Notifications 2.2.2 Released!
Hi,
Quote:
Originally Posted by
DrByte
It can't be if it's not submitted ... typically by someone like the author.
Doing so now...
All the best..
Conor
-
Re: Back In Stock Notifications
Customers who have subscribed to a notification list, but don't have an account with the store, can click on a link in their subscription e-mail to unsubscribe, or browse to the unsubscription page on the website and enter the code they were sent in this e-mail.
The feature above does not seem to be working on my site.
The link send straight to the login page.
I have COWOA on my site. Could this be causing a problem, or an I mis understanding how this should work.
I thought it would take the customer back to the product page, but place an unsubscribe link on the page. I am not sure where the unsubscriptionpage that is refered to above is placed neither.
[FONT=Tahoma][FONT=Tahoma]This is the link that is sent in the email :[/FONT][/FONT]
[FONT=Tahoma][FONT=Tahoma]http://www.lozer.co.uk/shop/index.ph..._notifications[/FONT][/FONT]
[FONT=Tahoma][FONT=Tahoma][/FONT][/FONT]
[FONT=Tahoma][FONT=Tahoma]When you go to this it appears to re direct to this.[/FONT][/FONT]
[FONT=Tahoma][FONT=Tahoma][/FONT][/FONT]
[FONT=Tahoma][FONT=Tahoma]https://web165.secure-secure.co.uk/l...bfff47931230b1[/FONT][/FONT]
[FONT=Tahoma][FONT=Tahoma][/FONT][/FONT]
Thanks for any help, and a great idea for a contribution.
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
chalfontgifts
The feature above does not seem to be working on my site.
It's working fine.. if a customer signed up for a notification while they were logged in, and they are not logged in when they click on the link, then Zen Cart will ask them to log in; they will then see the back in stock notifications page or section in the account admin.
Obviously for security reasons a link to a website should not be able to log someone in!
Quote:
Originally Posted by
chalfontgifts
Thanks for any help, and a great idea for a contribution.
No problem. I'm glad you like it!
All the best..
Conor
-
Re: Back In Stock Notifications
Great looking mod Conor, as usual, however im having trouble with it. Ive copied all the files over and ran the sql and it is showing up under 'configuration' and also 'catalogue' in Admin. The only problem is, the option to enable it is not there, so it doesn't work!
I have double checked to make sure all the files were uploaded and they are there. Any ideas? :no:
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
Sudakoma
Great looking mod Conor, as usual, however im having trouble with it.
Thanks... I'm sorry to hear that though - thought I'd got all problems covered now! ;)
Quote:
Originally Posted by
Sudakoma
Ive copied all the files over and ran the sql and it is showing up under 'configuration' and also 'catalogue' in Admin. The only problem is, the option to enable it is not there, so it doesn't work!
It sounds like the entire SQL file wasn't successfully run then. The option to enable the module is inserted by the SQL so if it's not there then the module won't work!
Do you just have a "Configuration Group" for Back In Stock Notifications but no options within that group? Or, if you do have any of the options, what do you have?
If you're missing options then something strange must have happened with the SQL file and it could possibly be run again to see if any errors come up:
Open the SQL file before you run it and uncomment the lines to delete the existing options/group, then run it again.. you shouldn't get any errors. If you do, that would cause the missing options you are talking about!
All the best...
Conor
-
Re: Back In Stock Notifications
Quote:
Originally Posted by
conor
Hi,
Thanks... I'm sorry to hear that though - thought I'd got all problems covered now! ;)
It sounds like the entire SQL file wasn't successfully run then. The option to enable the module is inserted by the SQL so if it's not there then the module won't work!
Do you just have a "Configuration Group" for Back In Stock Notifications but no options within that group? Or, if you do have any of the options, what do you have?
If you're missing options then something strange must have happened with the SQL file and it could possibly be run again to see if any errors come up:
Open the SQL file before you run it and uncomment the lines to delete the existing options/group, then run it again.. you shouldn't get any errors. If you do, that would cause the missing options you are talking about!
All the best...
Conor
Thanks for the reply. When i open the configuration group for Back In Stock Notifications, there are no options at all, just 3 headings:
Title
Value
Action
I tried running the sql file again after uncommenting the lines to delete the existing options/groups and got the following errors:
14 statements processed.
ERROR: Cannot insert configuration_key "" because it already exists
ERROR: Cannot insert configuration_key "" because it already exists
ERROR: Cannot create table back_in_stock_notification_subscriptions because it already exists
Note: 3 statements ignored. See "upgrade_exceptions" table for additional details.
Hope this helps.
-
Re: Back In Stock Notifications
Hi,
What version of MySQL are you using? It appears to be failing with the usage of the @t4 variable in the SQL.
All the best...
Conor
-
Re: Back In Stock Notifications
-
Re: Back In Stock Notifications
Correction, MySQL client version: 4.1.7
Sorry about that! :oops:
-
Re: Back In Stock Notifications
Hi,
Unfortunately I don't know why it won't work then, that seems like a recent enough version.
The SQL code that is failing was based on code from other modules in the download area.
I'm afraid I'm just going to have to post and ask if anyone has a clue what is going wrong.
In the meantime, you could remove the BISN configuration group from your database replace the @t4 variable with an unused configuration group ID and run the SQL again.
Using a hard-coded ID is guaranteed to work but obviously not the way I wanted to offer!
Sorry I can't be more help than that!
It'll have you working in no time, but that's not the nicest solution!
Here's the code, replace the ID in the five places marked with your ID:
Code:
INSERT INTO configuration_group VALUES ('YOURIDHERE', 'Back In Stock Notifications', 'Set Back In Stock Notifications Options', '1', '1');
UPDATE configuration_group SET sort_order = 'YOURIDHERE' WHERE configuration_group_id = 'YOURIDHERE';
INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `use_function` , `set_function`, `date_added`)
VALUES ('', 'Enable/Disable Back In Stock Notification', 'BACK_IN_STOCK_NOTIFICATION_ENABLED', '1', 'If enabled, when a customer comes across a product that is out of stock, the customer will be offered the chance to be notified when it is back in stock<br /><br />0 = off <br />1 = on', 'YOURIDHERE', '1', NOW(), NULL, 'zen_cfg_select_option(array(''0'', ''1''), ', NOW());
INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added`)
VALUES ('', 'Send Copy of Back In Stock Notification Subscription E-mails To', 'SEND_EXTRA_BACK_IN_STOCK_NOTIFICATION_SUBSCRIPTION_EMAILS_TO', '', 'Send copy of Back In Stock Notification Subscription e-mails to the following email addresses, in this format: Name 1 <email@address1>, Name 2 <email@address2>', 'YOURIDHERE', '2', NOW(), NOW()
);
All the best...
Conor
-
Re: Back In Stock Notifications
Sorry to appear a bit stupid but what do you mean by my ID? :blush:
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
Sudakoma
Sorry to appear a bit stupid but what do you mean by my ID? :blush:
Everyone's Zen Cart installation is different so the IDs which are being used of the configurations groups can be different, depending on what 3rd party mods (if any) have been installed.
You need to use a unique ID for the configuration group in the SQL. THh script is supposed to find the first unused one but something's wrong with it on your server so you have to specify it manually.
Log into your admin and move your mouse over the configuration menu. The group IDs will be seen in the URLs displayed in your browser as your mouse pointer moves over each configuration group.
Choose an ID (a number) that's a few higher than the highest one you see and replace the five instances of "YOURIDHERE" in the above script with it, save the script and run it.
All the best..
Conor
-
Re: Back In Stock Notifications
Ok, I made the changes you posted and ran the script but it made no difference, there are still no options displaying to enable it. :frusty:
-
Re: Back In Stock Notifications
Hi Conor
In my previous post I was referring to customers that do not have or create an account. Is there a way for them to unsubscribe.
Maybe I have mis understood how it should work in that situation. I thought the link in the email would take them to the product page with an option to unsubscribe.
Have I got this wrong ?
Regards
Laurie
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
chalfontgifts
In my previous post I was referring to customers that do not have or create an account. Is there a way for them to unsubscribe.
Sorry, I misread your post because the links you gave me are only presented to those who have an account.
I think you must have made a mistake when testing the module and used an e-mail address which is signed up to your site.
If you subscribe to a Back In Stock Notification List with an e-mail address that is not registered with your site then the link in the e-mail will go to an "unsubscribe" page, and the subscriber will have a code they can enter if they didn't use the automatic link.
I have tested this on your site and it works exactly as it should - try it again with another e-mail address and you shall see! :)
Glad I could help! :)
All the best...
Conor
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
Sudakoma
Ok, I made the changes you posted and ran the script but it made no difference, there are still no options displaying to enable it. :frusty:
Okay, there's something wrong with your server then.
Please send me some admin account details and if you have PHPMyAdmin/control panel software, details for that as well and I'll take a look (set up a temporary account which you can delete once I've got things fixed for you).
You can send these to me by using the following form:
ttp://dev.ceon.net/contact_us
All the best...
Conor
-
Re: Back In Stock Notifications
Details sent, thanks. :smartalec:
-
Re: Back In Stock Notifications
Conor,
Great tool! Thanks for taking the time to work it out. I use something very similar on my osC store with the flaw that one must be registered and logged in to use it. This will be a huge improvement! I've installed it on my test zen store and it appears to function perfectly.
I have just 1 concern. When we take seasonal inventory, our update from sold out can be considerable. The way we're configured in our current store, notice is sent the instant stock goes from 0 to >0 on each item. Therefore, only a few dozen emails are launched at any moment. If I hit the button with hundreds of emails in the queue, it could be flagged as spam at the receiving end. Is there something to modulate the transmission interval of the emails? (I know my newsletter program does that, but I don't know how)
By the way, for anyone wondering if this tool is a good idea, you should know that it's just about at the top of my priority list for migrating to zen. It's huge! It generates a huge spike in sales when we do seasonals and the residual sales continue for days.
-
Re: Back In Stock Notifications
Just sent a couple of pints your way. Thanks again!
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
brushwoodnursery
notice is sent the instant stock goes from 0 to >0 on each item. Therefore, only a few dozen emails are launched at any moment.
The system won't e-mail the same person more than once when you click the "send" button, no matter how many products they've asked to be notified are back in stock. It combines all of an individual's notifications into one e-mail, specifically to avoid any issues with spam.
Quote:
Originally Posted by
brushwoodnursery
If I hit the button with hundreds of emails in the queue, it could be flagged as spam at the receiving end. Is there something to modulate the transmission interval of the emails? (I know my newsletter program does that, but I don't know how)
I guess if you're a victim of your own success somewhat ( ;) ) - in that you might be e-mailing lots of people at the same server/ISP - it would be handy to limit the number of e-mails going out at once.
That would be interesting software to build in. What is this newsletter software you use, is it open source? (If so, please send a link).
You could also set up a script which automatically runs the "send" routine every time you update a product (the script would check if the product's stock level has just changed).. it shouldn't be too resource intensive as it would normally have nothing to do as normally you wouldn't be just putting something back in stock.
Quote:
Originally Posted by
brushwoodnursery
Just sent a couple of pints your way. Thanks again!
Thanks very much indeed... it's great to find that people like the software and it will be very nice indeed to have a drink on you this weekend to celebrate! ;)
All the best...
Conor
-
Re: Back In Stock Notifications
Quote:
Originally Posted by
conor
Hi,
I guess if you're a victim of your own success somewhat ( ;) ) - in that you might be e-mailing lots of people at the same server/ISP - it would be handy to limit the number of e-mails going out at once.
That would be interesting software to build in. What is this newsletter software you use, is it open source? (If so, please send a link).
Thanks very much indeed... it's great to find that people like the software and it will be very nice indeed to have a drink on you this weekend to celebrate! ;)
All the best...
Conor
Yes, it's been almost 10 years of hard work and it's going well. The newsletter program is phplist. Free and open source! They call it domain throttling. It slows transmission of the emails per domain so you don't get flagged as spam. I'm using an older version. I believe it's gotten better over the last few years. The newsletter feature on zen is on my list to investigate. If it isn't robust, I'll load a fresh phplist to the new store. Unfortunately, I'm not good enough with code to fully integrate it. I had promised to teach myself but have never gotten further than mucking around with it and occasionally getting lucky.
If you can slow the transmission of the messages, that would be great! For stock notifications, it wouldn't have to be by domain; just general. Something simple like 1 every 8 seconds would be fine. By the way, combining the list into one email per customer is really nice. Currently they get 1 per item and I think that's triggering some spam filters, too.
Cheers!
--Dan
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
brushwoodnursery
Okay, I'll take a look and see how easy/hard integrating this limiting would be.
Quote:
Originally Posted by
brushwoodnursery
I had promised to teach myself but have never gotten further than mucking around with it and occasionally getting lucky.
There's a lot of people like that... it is fun to learn though so I do recommend going "the whole way" and learning PHP programming properly, it can give a lot of satisfaction as programming is a very creative activity!
Quote:
Originally Posted by
brushwoodnursery
Currently they get 1 per item and I think that's triggering some spam filters, too.
Not with the current version of the module from Ceon? That should only send one e-mail per customer, regardless of how many notifications they are receiving when the "send" command is run.
Or are you talking about some other software you were previously using?
All the best...
Conor
-
Re: Back In Stock Notifications
Quote:
Originally Posted by
conor
Hi,
Not with the current version of the module from Ceon?
Or are you talking about some other software you were previously using?
Conor
Yes, sorry. I'm bouncing back and forth. When I say currently, I'm referring to my product stock notification system on my current osC store. It's live and has served me reasonably well for the last few years but it's time to move on. My zen cart is in development now.
-
Re: Back In Stock Notifications
Hi Conor
Please can you give me some guidance as to why the layout is all over the place on the link below and other products
that are out of stock.
http://www.lozer.co.uk/shop/index.ph...ducts_id=16790
The text for the out of stock notification seems to break out of its own area.
This maybe a problem with something I have done during installation.
Regards
Laurie
-
Re: Back In Stock Notifications
Hi Laurie,
Your template/CSS is messing this up slightly, but it's easily fixed...
If you add
Code:
<br class="clearBoth">
before the opening <form> tag for the back in stock notification form, things should look better!
Hope that helps!
All the best..
Conor
-
Re: Back In Stock Notifications
Thanks conor.
So which php block do I have to add that code to.
Thanks
Laurie
-
Re: Back In Stock Notifications
Hi Laurie,
Quote:
Originally Posted by
chalfontgifts
So which php block do I have to add that code to.
In tpl_product_info_display.php
Put it before the form on that page.
All the best...
Conor
-
Re: Back In Stock Notifications
I can't get this to work with the Book Type add-on. The back-in-stock notification option does not show on the product page if the product type does not equal 1.
Any help you could provide would be VERY appreciated!
I'm assuming it's tied to the product type after I tried the following:
Checked against 2 items: A with product-type = 1, and B with product-type = 7
Copied tpl_product_info_display.php from download as tpl_product_info_display.php and tpl_product_book_info_display.php (so the files were identical)
Checked both items - same display template, just a different value in the product-type field
A (with product-type 1) shows option correctly, B does not show option at all
Both are using the EXACT same product_info_display template. I didn't modify any of the other files at all.
http://rav4.websitewelcome.com/~cdiw...sbackorder.gif
-
Re: Back In Stock Notifications
Hi Helen,
Quote:
Originally Posted by
helen610
I can't get this to work with the Book Type add-on. The back-in-stock notification option does not show on the product page if the product type does not equal 1.
You're not quite right.
The Back In Stock Notification module works on the basis of the value of the $products_quantity variable as generated by the file:
includes/modules/pages/product_info/main_template_vars.php
This value is read in the observer class for the module, which attaches itself to the event:
NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO
It then sets up variables to be used by the template file to display the link and form.
Obviously the product_book_info page type you have defined is a custom page?
If you have created it by copying the product_info page scripts (header.php, main_template_vars.php) then you can easily integrate the Back In Stock Notifications module by modifying the following file..
includes/classes/observers/class.back_in_stock_notificationsProductInfo.php
Change:
PHP Code:
$zco_notifier->attach($this,
array(
'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO'
)
);
to:
PHP Code:
$zco_notifier->attach($this,
array(
'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO',
'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_BOOK_INFO'
)
);
That should be all you need to get this working with your custom product type. No reference to the product_type is made, all that has to be done is for this observer to run and to have a $products_quantity variable to check!
(Of course the above assumes that you have a NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_BOOK_INFO event within your main_template_vars.php for the product_book_info page).
Easy! :)
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Thank you Conor, that worked beautifully! :)
I had one more question.
I noticed the link to the notification form uses the full URL. Since I'm using only one product type, it was pretty easy to change the filename FILENAME_PRODUCT_INFO so it matched my product type, but it might get more cumbersome for those with more than one product type.
Is it possible just to build a link with the bookmark (ie. a href=#back_in_stock_notification_form instead of a href="http://www.domain.com/index.php.....#back_in_stock)?
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
helen610
Thank you Conor, that worked beautifully! :)
No problem. :)
Quote:
Originally Posted by
helen610
I noticed the link to the notification form uses the full URL.
Is it possible just to build a link with the bookmark (ie. a href=#back_in_stock_notification_form instead of a href="http://www.domain.com/index.php.....#back_in_stock)?
Oh, yes, I had forgotten that the link for the current page would also need to be changed.
Thanks for your suggestion, but to be honest I'm not going to change the way the module works because using a simple anchor over a fully-qualified anchor breaks the link with certain SEO modules. I realise this means that people with custom product type pages will have more work to do, but the work for them is minimal and there are far more people who use SEO modules than custom product types.
Thanks for your interest in making things easier for others though!
Glad you like the module.
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Hi Conor
the module works ok, except the enail addresses are not being stored, if i login as a user, it tells me i have no subscriptions, if i login via admin, catalog, notify, it tells me 3 products have subsciptions, but if i run the test email, it says none to send, any ideas what ive missed?
thanks
Andy
-
Re: Back In Stock Notifications
Hi Andy,
Quote:
Originally Posted by
andy
any ideas what ive missed?
I'm afraid not but you've definitely not installed things properly then!
Please get in contact privately with some admin details for your site and FTP and PHPMyAdmin login details. You can delete any temporary accounts later.
http://dev.ceon.net/contact_us
All the best..
Conor
Ceon
-
Re: Back In Stock Notifications
Hi Conor
thanks for all the support, module is excellent
Andy
-
Re: Back In Stock Notifications
Can you look at my site here
and tell how I can lower the description below the the Model: number and sold out button. Does the price belong up under the picture. Also the link under the sold out button doesn't look right or something. Thank you for you help in advance. I really like this Module.
-
Re: Back In Stock Notifications
Hi Randy,
Quote:
Originally Posted by
countrycharm
Can you look at my site
here
and tell how I can lower the description below the the Model: number and sold out button. Does the price belong up under the picture. Also the link under the sold out button doesn't look right or something.
I'm afraid that those questions aren't really relevant to this thread. You should ask/pay a web designer to sort out your layout issues.
Quote:
Originally Posted by
countrycharm
Thank you for you help in advance. I really like this Module.
I'm glad you do. :)
All the best...
Conor
-
Re: Back In Stock Notifications
Hi Conor I understand what you are saying but my layout issues didn't start until I added this Module. The issue is in the tpl_product_info_display file. I cut the Module off and replace my original file and my layout issues went away. Thank you for your help. I would really like to use this Module.
-
Re: Back In Stock Notifications
Hi Randy,
Quote:
Originally Posted by
countrycharm
Hi Conor I understand what you are saying but my layout issues didn't start until I added this Module. The issue is in the tpl_product_info_display file. I cut the Module off and replace my original file and my layout issues went away. Thank you for your help. I would really like to use this Module.
The copy of tpl_product_info_display which is supplied with the module is an example of a file modified from a fresh version of Zen Cart. If you want to customise the layout of that page then you should copy the code from the example file and paste it in at the "appropriate" part of your customised template, according to where you would like things to be placed.
I'm afraid it's not within our remit to help with layout issues on your site.
If you are unsure of what you are doing then you should pay someone to sort this out for you.
All the best...
Conor
-
Re: Back In Stock Notifications
Quote:
Originally Posted by countrycharm
Can you look at my site here
and tell how I can lower the description below the the Model: number and sold out button. Does the price belong up under the picture. Also the link under the sold out button doesn't look right or something.
Quote:
I'm afraid that those questions aren't really relevant to this thread. You should ask/pay a web designer to sort out your layout issues.
All the best...
Conor
Quote:
Originally Posted by countrycharm
Hi Conor I understand what you are saying but my layout issues didn't start until I added this Module. The issue is in the tpl_product_info_display file. I cut the Module off and replace my original file and my layout issues went away. Thank you for your help. I would really like to use this Module.
Quote:
The copy of tpl_product_info_display which is supplied with the module is an example of a file modified from a fresh version of Zen Cart. If you want to customise the layout of that page then you should copy the code from the example file and paste it in at the "appropriate" part of your customised template, according to where you would like things to be placed.
I'm afraid it's not within our remit to help with layout issues on your site.
If you are unsure of what you are doing then you should pay someone to sort this out for you.
All the best...
Conor
After looking at the Cherry Zen tpl_product_info_display file I notice it is not the same as the standard zen tpl_product_info_display file. It has bee modified for the Cherry Zen Template by jettrue the maker of the Cherry Zen Template. I compared the 2 file in WinMerge and the only 2 pieces of code I added from the Back In Stock Notifications tpl_product_info_display file to the the one in cherry zen was this here if anybody else has run into this problem.
In the cherry zen tpl_product_info_display file add this code to line 100.
Quote:
// BEGIN BACK_IN_STOCK_NOTIFICATIONS 1 of 2
if (!is_null($product_back_in_stock_notification_form_link)) {
echo '<p>' . $product_back_in_stock_notification_form_link . '</p>';
}
// END BACK_IN_STOCK_NOTIFICATIONS 1 of 2
and on line 234 add this code
Quote:
<?php // BEGIN BACK_IN_STOCK_NOTIFICATIONS 2 of 2
if (isset($back_in_stock_notification_build_form) && $back_in_stock_notification_build_form) {
// Build the notification request form
/**
* Load the template class
*/
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.CeonXHTMLHiTemplate.php');
// Load in and extract the template parts for Back In Stock Notification functionality
$bisn_template_filename = DIR_FS_CATALOG . DIR_WS_TEMPLATES . 'template_default/templates/' .
'inc.html.back_in_stock_notifications.html';
$bisn_template = new CeonXHTMLHiTemplate($bisn_template_filename);
$bisn_template_parts = $bisn_template->extractTemplateParts();
$back_in_stock_notification_form = new CeonXHTMLHiTemplate;
// Load in the source for the form
$back_in_stock_notification_form->setXHTMLSource(
$bisn_template_parts['PRODUCT_INFO_BACK_IN_STOCK_NOTIFICATION_FORM']);
// Add the form action, titles, labels and button
$form_start_tag = zen_draw_form('back_in_stock_notification',
zen_href_link(FILENAME_BACK_IN_STOCK_NOTIFICATION_SUBSCRIBE, zen_get_all_get_params(),
'NONSSL'), 'POST');
$back_in_stock_notification_form->setVariable('back_in_stock_notification_form_start_tag',
$form_start_tag);
$product_back_in_stock_notification_form_title = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_TITLE;
$back_in_stock_notification_form->setVariable('title',
$product_back_in_stock_notification_form_title);
$name_label = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_ENTRY_NAME;
$email_label = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_ENTRY_EMAIL;
$email_confirmation_label = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_ENTRY_CONFIRM_EMAIL;
$back_in_stock_notification_form->setVariable('name_label', $name_label);
$back_in_stock_notification_form->setVariable('email_label', $email_label);
$back_in_stock_notification_form->setVariable('email_confirmation_label',
$email_confirmation_label);
$submit_button = zen_image_submit(BUTTON_IMAGE_NOTIFY_ME, BUTTON_NOTIFY_ME_ALT,
'name="notify_me"');
$back_in_stock_notification_form->setVariable('submit_button', $submit_button);
// Add in the introductory text
$intro_text = sprintf(BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_INTRO,
htmlentities($products_name));
$notice_text = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_NOTICE;
$back_in_stock_notification_form->setVariable('intro', $intro_text);
$back_in_stock_notification_form->setVariable('notice', $notice_text);
// Add the customer's details to the form (empty unless logged in)
$back_in_stock_notification_form->setVariable('name',
$back_in_stock_notification_form_customer_name);
$back_in_stock_notification_form->setVariable('email',
$back_in_stock_notification_form_customer_email);
$back_in_stock_notification_form->setVariable('cofnospam',
$back_in_stock_notification_form_customer_email_confirmation);
print $back_in_stock_notification_form->getXHTMLSource();
}
// END BACK_IN_STOCK_NOTIFICATIONS 2 of 2 ?>
Your Back In Stock Notifications will work and look like it should.
I thought I would share this with all cherry zen template users who would like to use this Module.
Thanks Coner for this very nice Module.
-
Re: Back In Stock Notifications
Hi Randy,
Glad you've got your layout sorted!
Quote:
Originally Posted by
countrycharm
I thought I would share this with all cherry zen template users who would like to use this Module.
Thanks Coner for this very nice Module.
Thank you for the notes for other users of the Cherry template and for your kind words!
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Coner I have one more question for you then I will leave you a long...lol in includes/languages/english/extra_definitions/back_in_stock_notifications.php on line 18 where it says To be notified when this product is back in stock please <a href="%s">click here</a>.');
how can I change the click here link and replace it with a clickable image. Thank you
-
Re: Back In Stock Notifications
Hi Randy,
Quote:
Originally Posted by
countrycharm
how can I change the click here link and replace it with a clickable image. Thank you
Simply change the:
PHP Code:
To be notified when this product is back in stock please <a href="%s">click here</a>.
to:
PHP Code:
<a href="%s"><img src="path/to/your/image" alt="click here to be notified when this product is back in stock" /></a>
You can make the definition use any HTML you want! :)
All the best...
Conor
-
Re: Back In Stock Notifications
Thanks Coner that worked out great. Thank you for all your help.
-
Re: Back In Stock Notifications
Thanks for this great mod! Is it possible in your next upgrade to support at least the standard out of the box Zen Cart product types?
I am thinking at least product_info and product_music_info
Thanks!
Quote:
Originally Posted by
conor
Hi Helen,
You're not quite right.
The Back In Stock Notification module works on the basis of the value of the $products_quantity variable as generated by the file:
includes/modules/pages/product_info/main_template_vars.php
This value is read in the observer class for the module, which attaches itself to the event:
NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO
It then sets up variables to be used by the template file to display the link and form.
Obviously the product_book_info page type you have defined is a custom page?
If you have created it by copying the product_info page scripts (header.php, main_template_vars.php) then you can easily integrate the Back In Stock Notifications module by modifying the following file..
includes/classes/observers/class.back_in_stock_notificationsProductInfo.php
Change:
PHP Code:
$zco_notifier->attach($this,
array(
'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO'
)
);
to:
PHP Code:
$zco_notifier->attach($this,
array(
'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO',
'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_BOOK_INFO'
)
);
That should be all you need to get this working with your custom product type. No reference to the product_type is made, all that has to be done is for this observer to run and to have a $products_quantity variable to check!
(Of course the above assumes that you have a NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_BOOK_INFO event within your main_template_vars.php for the product_book_info page).
Easy! :)
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
BlessIsaacola
Thanks for this great mod! Is it possible in your next upgrade to support at least the standard out of the box Zen Cart product types?
There are no plans to release any new versions in the future.
If anyone wants us to develop this functionality they'd have to cover the development costs.. If anyone else already has developed it, please just send me the new files and I'll test them, add them to and release a new version.
All the best...
Conor
-
Re: Back In Stock Notifications
I know that the PRODUCT_MUSIC_INFO just needs to be added to the observer since it's already part of the Zen Cart core. I was just pointing out the future update for those that may not be comfortable with messing with code in: includes/classes/observers/class.back_in_stock_notificationsProductInfo.php
Hmm...I just migrated this mod to our production environment and now questioning myself if there will be no future update (since once 1.4 is released this will probably become outdated).
Will send contribution once some of the quirks are worked out.
One nagging thing right now is if a product has a future date with zero quantity it looks funny displaying the future date and asking customers to pre-buy when Add to Cart button is disabled.
Quote:
Originally Posted by
conor
Hi,
There are no plans to release any new versions in the future.
If anyone wants us to develop this functionality they'd have to cover the development costs.. If anyone else already has developed it, please just send me the new files and I'll test them, add them to and release a new version.
All the best...
Conor
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
BlessIsaacola
I know that the PRODUCT_MUSIC_INFO just needs to be added to the observer since it's already part of the Zen Cart core. I was just pointing out the future update for those that may not be comfortable with messing with code in: includes/classes/observers/class.back_in_stock_notificationsProductInfo.php
I understand completely but I just have other things to be doing at this time.
Quote:
Originally Posted by
BlessIsaacola
Hmm...I just migrated this mod to our production environment and now questioning myself if there will be no future update (since once 1.4 is released this will probably become outdated).
If Zen Cart totally changes in 1.4 then a new version may be released then. I wasn't saying that the module was unsupported, just that no new releases are planned as we don't have time to add extra features that not many people have requested (you're the second in total ;) )..
Quote:
Originally Posted by
BlessIsaacola
Will send contribution once some of the quirks are worked out.
I'd like to take your word for that but I'm afraid experience here says otherwise! :(
Quote:
Originally Posted by
BlessIsaacola
One nagging thing right now is if a product has a future date with zero quantity it looks funny displaying the future date and asking customers to pre-buy when Add to Cart button is disabled.
Now I would call that particular problem a bug rather than a feature request. As such a new version will be released shortly with a fix for this! I may at that time also add support for product music types, I'll see how much time I have to spare.
All the best...
Conor
-
Re: Back In Stock Notifications
Yes this is a great mod and it helps out a lot like to say first great job on the mod.
I did see one thing though. I noticed that in the mod when it reaches zero in stock the notification comes up under the out of stock button. but say if it goes backwards say your stock says there is -1 in stock it does not show it is looking at it as if you do have stock.
My question would be how would you go about fixing this so the negitives do not make it look like it is in stock?
If the notfication does not show then how can people know to use it.
Second question in the form the confirm email box has this inside of it {cofnospam} how do i go about getting rid of that or is that normal?
Once again great mod thank you for putting it together.:bigups:
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
dscott1966
Yes this is a great mod and it helps out a lot like to say first great job on the mod.
Thanks, that's always good to hear! :)
Quote:
Originally Posted by
dscott1966
I did see one thing though. I noticed that in the mod when it reaches zero in stock the notification comes up under the out of stock button. but say if it goes backwards say your stock says there is -1 in stock it does not show it is looking at it as if you do have stock.
You're right! I'll create a new version which checks for stock less than or equal to zero rather than just 0.
I can release that shortly but in the meantime, if you like, you can change:
PHP Code:
$products_quantity == 0
to
PHP Code:
$products_quantity <= 0
in
\includes\classes\observers\class.back_in_stock_notificationsProductInfo.php
Quote:
Originally Posted by
dscott1966
Second question in the form the confirm email box has this inside of it {cofnospam} how do i go about getting rid of that or is that normal?
No, that was a bug in an earlier version. Download 2.2.2 at the following address to fix it:
http://dev.ceon.net/web/zen-cart/bac..._notifications
I guess I must have forgotten to update the download area!
I'll create a 2.2.3 and upload it, probably tomorrow.
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Hi,
Just checked and 2.2.2 is in the download area.
What version were/are you running?
The bug with cofnospam should be fixed in 2.2.1 and up!
All the best...
Conor
-
Re: Back In Stock Notifications
Hi Conor,
Im also using 2.2.2 and i still get the 'cofnospam' in that confirm email field. Its no big deal though for me and doesn't affect the working of the mod in any way. It's proving very popular with our customers.
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
Sudakoma
Im also using 2.2.2 and i still get the 'cofnospam' in that confirm email field.
That means that you haven't completed the upgrade to 2.2.2.
You must have missed updating the file
\includes\templates\YOUR_TEMPLATE\templates\tpl_product_info_display.php
You'll find a small difference between your version and the correct version from 2.2.2:
PHP Code:
$back_in_stock_notification_form->setVariable('email_confirmation',
should be:
PHP Code:
$back_in_stock_notification_form->setVariable('cofnospam',
All the best...
Conor
-
Re: Back In Stock Notifications
-
Re: Back In Stock Notifications
is there a way of getting this to work with attributes? so or our products have 6-7 different sizes and if one size is out it would be nice for someone to set -up notification for that size.
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
MB1
is there a way of getting this to work with attributes?
No, sorry, not until Zen Cart officially supports stock for attributes/product variants.
When 1.4 is released a new version of this module will probably follow which supports it.
All the best...
Conor
-
Re: Back In Stock Notifications
awesome mod....really great work.
I thought this mod would automatically send the notification once a products stock level was changed to a positive number. only when I found the entry under catalog that I saw you had to manually send the emails via the drop down selection list.
be a great addition to have the email notifications automatically send once the item was back in stock.
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
amazeme
awesome mod....really great work.
Thanks, that's always nice to hear! :)
Quote:
Originally Posted by
amazeme
be a great addition to have the email notifications automatically send once the item was back in stock
If people have subscribed to notification lists for several products and you are updating the stock levels for your store then that would result in them getting several e-mails.
That might not be a big issue for most stores but it was one of a few factors which resulted in us choosing to design the module in such a way that notifications aren't sent automatically when a product's stock level is updated.
However, there's nothing to stop you from writing a simple script to automatically run the notification sending routine on a daily/hourly cron job. That's a good compromise for what you need I think.
All the best...
Conor
ceon.net
-
Re: Back In Stock Notifications
Hey, Conor! I'm finally building my zen store! Just wondering if you had looked at the code in phplist to see about modulating the email blast to avoid getting flagged as spam at the receiving end.
I've downloaded the most recent release and just looked through it but haven't found the code yet. Not sure I'd know enough to do anything with it in your mod anyway.
-
Re: Back In Stock Notifications
Hi,
How are you?
Quote:
Originally Posted by
brushwoodnursery
Hey, Conor! I'm finally building my zen store!
That's good to hear.. just the right time of year to have it up! :)
Quote:
Originally Posted by
brushwoodnursery
Just wondering if you had looked at the code in phplist to see about modulating the email blast to avoid getting flagged as spam at the receiving end.
I haven't looked at the code, no, but the idea is pretty simple and wouldn't be something I'd find difficult to write - from scratch if necessary (if the PHPList code was too dependant on other code). However it is too much work for me to take on at the minute I'm afraid, so I doubt this functionality will be added to the module anytime in the next four months.
Sorry if that's bad news! Hopefully the lack of anti-spam-flagging measures won't hurt your usage of the module too much. :|
All the best..
Conor
-
Re: Back In Stock Notifications
well i can't wait to upgrade to 1.4 when it comes :no: do you know what part of the code i could play with so back in notification pops up all the time. for the mean time
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
MB1
well i can't wait to upgrade to 1.4 when it comes :no: do you know what part of the code i could play with so back in notification pops up all the time. for the mean time
If you want the form to always be displayed then you'll have to remove the followiung code:
PHP Code:
$products_quantity <= 0 &&
from
\includes\classes\observers\class.back_in_stock_notificationsProductInfo.php
You'll also have to be careful how often you run the notifications routine as it's likely that all notifications will be sent out each time you run it, as you are't actually matching up whether something's in stock or not.
I can't really recommned running things that way (but it is of course up to you).
All the best...
Conor
-
Re: Back In Stock Notifications
I've imported the whole database from old website to new website.
In admin when I click on catalog-->back in stock notification I've a blank page. In old website all works fine!
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
100asa
I've imported the whole database from old website to new website.
In admin when I click on catalog-->back in stock notification I've a blank page. In old website all works fine!
Try copying all the files across again. If that doesn't work then turn on error reporting in includes/application_top.php and you should see what error is being produced.
Search the forum for "blank page" if you would like to know more.
All the best...
Conor
-
Re: Back In Stock Notifications
in latest version of firefox I see a blank page; instead in ie 7 I can see error 500
-
Re: Back In Stock Notifications
how can I turn on error reporting? in admin/includes/application_top.php I already have-->error_reporting(E_ALL & ~E_NOTICE);
-
Re: Back In Stock Notifications
-
Re: Back In Stock Notifications
Great! with this tips I was discover error (configure.php) and solve!
:clap:
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
100asa
Great! with this tips I was discover error (configure.php) and solve!
:clap:
That's great news. :)
Thanks very much Dr Byte.. I knew that I'd seen that info before when searching for "blank page" but I'm going to store the direct link as it's a frequent occurrence!
All the best...
Conor
-
Re: Back In Stock Notifications
Coneo,
Thanks for a great Mod,I have installed it and it works great. One question though. How do I modify the "BACK IN STOCK NOTIFICATIION SUBSCRIPTION" email so that the product name is a clickable link which takes you back to that products page?
Andrew
-
Re: Back In Stock Notifications
Hi Andrew,
Quote:
Originally Posted by
schira
Coneo,
It's "Conor" actually! ;)
Quote:
Originally Posted by
schira
Thanks for a great Mod,I have installed it and it works great. One question though. How do I modify the "BACK IN STOCK NOTIFICATIION SUBSCRIPTION" email so that the product name is a clickable link which takes you back to that products page?
That's not a bad idea. I'll make it so that the name is clickable in the HTML version of the e-mail in the next version of the module.
I'm working away at a new SEO module (which has ended up taking an extra two weeks longer than I thought it would because of transliteration issues - ugh! - don't ask! :) ) and have just finished the final parts of it today. Once I've finished off the docs for that I'll make the necessary changes to the Back In Stock Notifications module and release it.
That should hopefully happen by next week.
You can keep an eye out here to see when it's available.
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Sorry Conor,
Fat fingers. Thanks for your reply and I will be eagerly looking forward to the new version.
Regards,
Andrew
-
Re: Back In Stock Notifications
Thats odd mine already creates a clickable link back to the product page.
see example from a sent email:
Dear ,
We have restocked a product you asked to be notified about.
Please check it out before it goes out of stock again!
--------------------------------------------------
Product Back In Stock
--------------------------------------------------
Hydor Koralia Wavemaker Controller 2-Way Basic
Link:
http://afishybusiness.com/index.php?...roducts_id=649
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
Mustang394
Thats odd mine already creates a clickable link back to the product page.
Yes, the "restocked" e-mail does, but the initial subscription e-mail doesn't. I don't see any reason that it shouldn't and Andrew has requested it so I'll be adding it to the next version.
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Hi, Conor! The site is almost ready and I'll be running the back in stock notifications soon. There are over 5000 to go so there will probably be about 1000 emails going out. I'm concerned about being flagged for spamming. Just wondering if you had a chance to look at the throttling in phplist to try to adapt it to your mod?
-
Re: Back In Stock Notifications
Hi!
How are you?
Quote:
Originally Posted by
brushwoodnursery
Just wondering if you had a chance to look at the throttling in phplist to try to adapt it to your mod?
Unfortunately there's no throttling built into the module at present.
It's would be a very handy feature I'd imagine, but unfortunately too much work to implement at this time. :(
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Could there be a simple way to add
into the loop somewhere?
I got that from the php manual.
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
brushwoodnursery
Could there be a simple way to add
into the loop somewhere?
I got that from the
php manual.
Certainly you can add that, but I don't know how much difference it will make. I'd imagine it'd probably be better than nothing but unfortunately I don't know enough about throttling to know if adding a 10 second delay would be enough to prevent servers blocking e-mails for breaching their limits for e-mails sent from a particular address. I'd have to research what these limits are and how any rules are applied in order to build an effective throttling mechanism into the software. Sadly, I just don't have the time to do that.
Hopefully I will in the future as I think it would be useful to know and therefore useful to implement.
As for the sleep() function. If you were to add it you'd have to add a counter into the sendBackInStockNotifications() function in
admin\includes\functions\back_in_stock_notifications_functions.php
and have it run the sleep command after a particular number of e-mails have been sent.
All the best...
Conor
-
Re: Back In Stock Notifications
OK, just finished digging through the code in phplist and they do use sleep(x) as one of the throttling functions. They actually use three but this is described as the simplest way. The more complex ones are batch throttling (which would match what you mentioned about counting a batch then stopping) and domain throttling (which limits the number going to any one domain per period, an even more complex count).
I'm just after a simple sleep(). If I have 1000 emails going out and I sleep(10) the loop, they would all still go out overnight easily. Can you tell me a good place to add that command? I don't think I need the counter, etc. A delay between each email sent would be fine with me.
My only concern would be timeout.
-
Re: Back In Stock Notifications
Hi,
Just before line 154 of the admin/includes/functions/
($email_addresses_result->MoveNext();)
You could add the following code:
PHP Code:
$num_emails_in_batch++
if ($num_emails_in_batch > 100) {
$num_emails_in_batch = 0;
sleep(10);
}
You should also add the following before the while loop on line 65:
PHP Code:
$num_emails_in_batch = 0;
Just good coding practice! :)
I might make this simple functionality an option in the next version with a configurable number of e-mails in a batch and sleep time.
All the best...
Conor
Ceon
-
Re: Back In Stock Notifications
Conor,
You've been very patient with my persistent badgering about this little detail. Once again, thank you very much!
-
Re: Back In Stock Notifications
Hmm...got trouble:
Parse error: syntax error, unexpected T_IF in /home/xxxxxx/xxx/xxx/admin/includes/functions/back_in_stock_notifications_functions.php on line 158
do i need the batch counter or can I just try the sleep?
-
Re: Back In Stock Notifications
I commented out everything but the sleep(10);
I have not entered inventory except a little testing bit. There would be 43 emails sent. At 10 seconds it stalls out and goes to a blank page. At 2 seconds, same thing. At 1 second, it takes just over 43 seconds (guesstimate) to return the successful results of a test mailing. In all 3 cases, the sample email was successfully sent out.
-
Re: Back In Stock Notifications
Hi,
Quote:
Originally Posted by
brushwoodnursery
Hmm...got trouble:
Parse error: syntax error, unexpected T_IF in /home/xxxxxx/xxx/xxx/admin/includes/functions/back_in_stock_notifications_functions.php on line 158
do i need the batch counter or can I just try the sleep?
Oops, there's a missing semicolon after
PHP Code:
$num_emails_in_batch++
It should be:
PHP Code:
$num_emails_in_batch++;
Sorry! :)
Quote:
I have not entered inventory except a little testing bit. There would be 43 emails sent. At 10 seconds it stalls out and goes to a blank page. At 2 seconds, same thing. At 1 second, it takes just over 43 seconds (guesstimate) to return the successful results of a test mailing. In all 3 cases, the sample email was successfully sent out.
Sounds like PHP is timing out.
You must have safe mode on, otherwise the script would set the maximum execution time/timeout for PHP to 0 ("Don't time out").
If you don't have access to your server to change the safe_mode setting or the max_execution setting then I'm afraid the sleep() command will be useless for you! :(
All the best..
Conor
-
Re: Back In Stock Notifications
Safe Mode is Off.
The notification panel pulls up just fine now.
Test run works fine. There's no delay, though, since it's only 43 emails and they batch up as one.
So, i ran the test with the batch size at 10 and the sleep at 20 seconds. Goes to blank page in just over 1 minute.
maybe it's my database connection?
I've decided to try to run it without the delay. I'll just do it after the phplist newsletter goes out and hope for the best. Looking through the list, most of the serious customers are waiting for multiple items. Also, not all of the items will be restocked at this time. It might be fine.