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