Zen Cart Logo
Forums / All Other Contributions/Addons / Back In Stock Notifications

Back In Stock Notifications

Views: 71,747

Results 41 to 60 of 507
7 Sep 2008, 9:01 AM
#41
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Back In Stock Notifications

Hi Laurie,

Your template/CSS is messing this up slightly, but it's easily fixed...

If you add

<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
7 Sep 2008, 9:23 AM
#42
chalfontgifts avatar

chalfontgifts

Zen Follower

Join Date:
Jun 2007
Posts:
122
Plugin Contributions:
0

Re: Back In Stock Notifications

Thanks conor.

So which php block do I have to add that code to.

Thanks
Laurie

7 Sep 2008, 11:29 AM
#43
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi Laurie,

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

10 Sep 2008, 7:20 PM
#44
helen610 avatar

helen610

New Zenner

Join Date:
Jan 2008
Posts:
8
Plugin Contributions:
0

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.

10 Sep 2008, 8:44 PM
#45
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi Helen,

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:

            $zco_notifier->attach($this,
            array(
                'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO'
                )
            );
```to:

```php
            $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](http://dev.ceon.net)
10 Sep 2008, 9:08 PM
#46
helen610 avatar

helen610

New Zenner

Join Date:
Jan 2008
Posts:
8
Plugin Contributions:
0

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)?

11 Sep 2008, 8:56 AM
#47
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi,

helen610:

Thank you Conor, that worked beautifully! :)

No problem. :)

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

11 Sep 2008, 10:26 AM
#48
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

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

11 Sep 2008, 11:15 AM
#49
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi Andy,

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

11 Sep 2008, 3:50 PM
#50
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

Re: Back In Stock Notifications

Hi Conor
thanks for all the support, module is excellent

Andy

21 Sep 2008, 5:21 PM
#51
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

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.

21 Sep 2008, 5:50 PM
#52
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi Randy,

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.

countrycharm:

Thank you for you help in advance. I really like this Module.

I'm glad you do. :)

All the best...

Conor

21 Sep 2008, 6:08 PM
#53
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

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.

22 Sep 2008, 11:12 AM
#54
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi Randy,

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

22 Sep 2008, 5:22 PM
#55
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Back In Stock Notifications

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.

All the best...

Conor
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

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.

// 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

<?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.

22 Sep 2008, 6:01 PM
#56
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi Randy,

Glad you've got your layout sorted!

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

22 Sep 2008, 6:43 PM
#57
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

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

22 Sep 2008, 7:31 PM
#58
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Back In Stock Notifications

Hi Randy,

countrycharm:

how can I change the click here link and replace it with a clickable image. Thank you

Simply change the:

To be notified when this product is back in stock please <a href="%s">click here</a>.

to:

<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

22 Sep 2008, 8:40 PM
#59
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Back In Stock Notifications

Thanks Coner that worked out great. Thank you for all your help.

23 Sep 2008, 5:08 AM
#60
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

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!

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:

        $zco_notifier->attach($this,
        array(
            'NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_INFO'
            )
        );
> 
> ```php
            $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](http://dev.ceon.net)