Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Creating additional contact forms


L. Haase

Recommended Posts

I have a coding issue I am hoping someone can help me with.

 

http://aquarian-artisan-bath-body.com/catalog/wholesale_contact.php

 

I needed to create an additional email form to use as a type of application for new retailers. I have duplicated the contact_us.php in both the catalog and languages directories as well as the other files (filenames.php, bm_about_us.php, etc.) you change to add a new page to your boxes.

 

I have added new fields and everything works visually however when I try to send it, I get the error:

 

Error: An enquiry has already been sent. Please try again in 15 minutes.

 

I think the error is in the following file (I have redded the code below which I think is the culprit and especially the "contact" reference since I have a new file name instead of contact_us.php. I am unsure of what to put there if that is the case.

 

Any ideas?

 

catalog/wholesale_contact.php

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WHOLESALE_CONTACT);

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {

$error = false;

 

$name = tep_db_prepare_input($HTTP_POST_VARS['name']);

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);

$company_name = tep_db_prepare_input($HTTP_POST_VARS['company_name']);

$company_address = tep_db_prepare_input($HTTP_POST_VARS['address']);

$city = tep_db_prepare_input($HTTP_POST_VARS['city']);

$state = tep_db_prepare_input($HTTP_POST_VARS['state']);

$zip = tep_db_prepare_input($HTTP_POST_VARS['zip']);

$phone = tep_db_prepare_input($HTTP_POST_VARS['phone']);

$sales_estimate = tep_db_prepare_input($HTTP_POST_VARS['sales_estimate']);

$additional_information = tep_db_prepare_input($HTTP_POST_VARS['additional_information']);

 

if (!tep_validate_email($email_address)) {

$error = true;

 

$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

}

 

$actionRecorder = new actionRecorder('ar_wholesale_contact', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);

if (!$actionRecorder->canPerform()) {

$error = true;

 

$actionRecorder->record(false);

 

$messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES : 15)));

}

 

if ($error == false) {

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $additional_information, $name, $email_address, $company_name, $company_address, $city, $state, $zip, $phone, $sales_estimate);

 

$actionRecorder->record();

 

tep_redirect(tep_href_link(FILENAME_wholesale_contact, 'action=success'));

}

}

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_wholesale_contact));

 

require(DIR_WS_INCLUDES . 'template_top.php');

?>

 

<h1><?php echo HEADING_TITLE; ?></h1>

 

<?php

if ($messageStack->size('contact') > 0) {

echo $messageStack->output('contact');

}

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {

?>

 

<div class="contentContainer">

<div class="contentText">

<?php echo TEXT_SUCCESS; ?>

</div>

 

<div style="float: right;">

<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>

</div>

</div>

 

<?php

} else {

?>

 

<?php echo tep_draw_form('wholesale_inquiry', tep_href_link(FILENAME_WHOLESALE_CONTACT, 'action=send'), 'post', '', true); ?>

 

<div class="contentContainer">

<div class="contentText">

<p>Becoming a retailer of our products is very easy. There is a short application where you provide a few details about your business and then, after verification, you will receive a permanent discount coupon code to use with your order.</p>

<p>Depending on the size of your business, there will be a minimum order. Minimum orders are established at the time of the application approval and may be increased due to your ordering history.<p>

<p>Orders from existing stock are shipped within 1-3 days. Orders for custom loafs take a minimum of 6 weeks to ship due to curing time.</p>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="fieldKey"><?php echo ENTRY_NAME; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('name'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_EMAIL; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('email'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_COMPANY_NAME; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('company_name'); ?></td>

<tr>

<td class="fieldKey"><?php echo ENTRY_COMPANY_ADDRESS; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('company_address'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_CITY; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('city'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_STATE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('state'); ?></td>

</tr>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_ZIP; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('zip'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_PHONE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('phone'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_SALES_ESTIMATE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('sales_estimate'); ?></td>

</tr>

<tr>

<td class="fieldKey" valign="top"><?php echo ENTRY_ADDITIONAL_INFORMATION; ?></td>

<td class="fieldValue"><?php echo tep_draw_textarea_field('additional_information', 'soft', 50, 5); ?></td>

</tr>

</table>

</div>

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>

</div>

</div>

 

</form>

 

<?php

}

 

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

 

I am including this modified file just in case I am missing something here.

 

catalog/includes/languages/english/wholesale_contact.php

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

define('HEADING_TITLE', 'Wholesale Application');

define('NAVBAR_TITLE', 'Wholesale Application');

define('TEXT_SUCCESS', 'Your enquiry has been successfully sent to the Store Owner.');

define('EMAIL_SUBJECT', 'Wholesale Application from ' . STORE_NAME);

 

define('ENTRY_NAME', 'Full Name:');

define('ENTRY_EMAIL', 'E-Mail Address:');

define('ENTRY_COMPANY_NAME', 'Company Name:');

define('ENTRY_COMPANY_ADDRESS', 'Company Address:');

define('ENTRY_CITY', 'City:');

define('ENTRY_STATE', 'State:');

define('ENTRY_ZIP', 'Zip:');

define('ENTRY_PHONE', 'Phone:');

define('ENTRY_SALES_ESTIMATE', 'Estimated Sales:');

define('ENTRY_ADDITIONAL_INFORMATION', 'Additional Information:');

 

define('ERROR_ACTION_RECORDER', 'Error: An enquiry has already been sent. Please try again in %s minutes.');

?>

Link to comment
Share on other sites

  • 1 month later...

$actionRecorder = new actionRecorder('ar_wholesale_contact', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);
if (!$actionRecorder->canPerform()) {
  $error = true;

  $actionRecorder->record(false);

$messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES : 15)));
}

 

You have correctly defined a new action recorder by the name of ar_wholesale_contact, but have you actually created the action recorder module?

 

Action Recorder modules are located in the following directory:

 

Module File: catalog/includes/modules/action_recorder/

Language File: catalog/includes/languages/LANGUAGE/modules/action_recorder/

 

You should copy ar_contact_us.php to ar_wholesale_contact.php and update the new module to reference *WHOLESALE_CONTACT* parameters instead of *CONTACT_US*.

 

The module then needs to be installed in the Administration Tool in the Modules -> Action Recorder -> Install Module page.

:heart:, osCommerce

Link to comment
Share on other sites

Ok, Harald. I made all the changes you mentioned, creating the ar_wholesale_contact.php in both directories. The addition of the module in the admin area was successful however when trying to test the form, I get a 404 not found error stating. .

 

NOT FOUND

 

The requested URL /catalog/FILENAME_wholesale_contact was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Now I know from prior contribution additions that this is telling me that the wholesale_contact.php file cannot be found in the main catalog directory however I checked and it is. Here is the coding for that.

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WHOLESALE_CONTACT);

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {

$error = false;

 

$name = tep_db_prepare_input($HTTP_POST_VARS['name']);

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);

$company_name = tep_db_prepare_input($HTTP_POST_VARS['company_name']);

$company_address = tep_db_prepare_input($HTTP_POST_VARS['address']);

$city = tep_db_prepare_input($HTTP_POST_VARS['city']);

$state = tep_db_prepare_input($HTTP_POST_VARS['state']);

$zip = tep_db_prepare_input($HTTP_POST_VARS['zip']);

$phone = tep_db_prepare_input($HTTP_POST_VARS['phone']);

$sales_estimate = tep_db_prepare_input($HTTP_POST_VARS['sales_estimate']);

$additional_information = tep_db_prepare_input($HTTP_POST_VARS['additional_information']);

 

if (!tep_validate_email($email_address)) {

$error = true;

 

$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

}

 

$actionRecorder = new actionRecorder('ar_wholesale_contact', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);

if (!$actionRecorder->canPerform()) {

$error = true;

 

$actionRecorder->record(false);

 

$messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES : 15)));

}

 

if ($error == false) {

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $additional_information, $name, $email_address, $company_name, $company_address, $city, $state, $zip, $phone, $sales_estimate);

 

$actionRecorder->record();

 

tep_redirect(tep_href_link(FILENAME_wholesale_contact, 'action=success'));

}

}

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_wholesale_contact));

 

require(DIR_WS_INCLUDES . 'template_top.php');

?>

 

<h1><?php echo HEADING_TITLE; ?></h1>

 

<?php

if ($messageStack->size('contact') > 0) {

echo $messageStack->output('contact');

}

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {

?>

 

<div class="contentContainer">

<div class="contentText">

<?php echo TEXT_SUCCESS; ?>

</div>

 

<div style="float: right;">

<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>

</div>

</div>

 

<?php

} else {

?>

 

<?php echo tep_draw_form('wholesale_contact', tep_href_link(FILENAME_WHOLESALE_CONTACT, 'action=send'), 'post', '', true); ?>

 

<div class="contentContainer">

<div class="contentText">

<p>Becoming a retailer of our products is very easy. There is a short application where you provide a few details about your business and then, after verification, you will receive a permanent discount coupon code to use with your order.</p>

<p>Depending on the size of your business, there will be a minimum order. Minimum orders are established at the time of the application approval and may be increased due to your ordering history.<p>

<p>Orders from existing stock are shipped within 1-3 days. Orders for custom loafs take a minimum of 6 weeks to ship due to curing time.</p>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="fieldKey"><?php echo ENTRY_NAME; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('name'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_EMAIL; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('email'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_COMPANY_NAME; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('company_name'); ?></td>

<tr>

<td class="fieldKey"><?php echo ENTRY_COMPANY_ADDRESS; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('company_address'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_CITY; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('city'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_STATE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('state'); ?></td>

</tr>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_ZIP; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('zip'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_PHONE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('phone'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_SALES_ESTIMATE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('sales_estimate'); ?></td>

</tr>

<tr>

<td class="fieldKey" valign="top"><?php echo ENTRY_ADDITIONAL_INFORMATION; ?></td>

<td class="fieldValue"><?php echo tep_draw_textarea_field('additional_information', 'soft', 50, 5); ?></td>

</tr>

</table>

</div>

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>

</div>

</div>

 

</form>

 

<?php

}

 

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>
Link to comment
Share on other sites

@L. Haase

 

Hi Computer Geekette, :rolleyes:

 

Needed one myself for a wholesale / SPPC site so finished now I will upload sometime tomorrow to the addon area being meaning to do for a while now

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Hi,

 

No not uploaded yet need a tester looks ok to me.

 

I added an optional image/file upload as my customer needed the seller permit

 

---> link

 

I will PM you the download link in an hour or so

 

Regards

Joli

 

PS: Please check that the error messages are functioning (message stack) think I got them all

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Got the pkg and installed and everything looks good. I did have to adjust the box name I wanted the file in. I don't know if that modification caused the issue of the coding itself being shown as the link text instead of "Wholesale Enquiries" as the link text. I had this issue before and thought it was in the bm_files but have double checked everything and it seems fine. The link works and the form works perfectly with no errors. Here is my coding.

 

includes/modules/boxes/bm_about_us.php

........

' <a href="' . tep_href_link(FILENAME_DIRECTIONS) . '">' . MODULE_BOXES_ABOUT_US_BOX_DIRECTIONS . '</a><br />' .

' <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_ABOUT_US_BOX_CONTACT . '</a><br />' .

' <a href="' . tep_href_link(FILENAME_WHOLESALE_CONTACT) . '">' . MODULE_BOXES_ABOUT_US_BOX_WHOLESALE_ENQUIRES . '</a><br />' .

' <a href="
target="blank">' .

...........

 

includes/languages/english/modules/boxes/bm_about_us.php

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

define('MODULE_BOXES_ABOUT_US_TITLE', 'About Us');

define('MODULE_BOXES_ABOUT_US_DESCRIPTION', 'Show about us page links');

define('MODULE_BOXES_ABOUT_US_BOX_TITLE', 'About Us');

define('MODULE_BOXES_ABOUT_US_BOX_SHIPPING', 'Shipping & Returns');

define('MODULE_BOXES_ABOUT_US_BOX_PRIVACY', 'Privacy Notice');

define('MODULE_BOXES_ABOUT_US_BOX_DIRECTIONS', 'Directions for Use');

define('MODULE_BOXES_ABOUT_US_BOX_CONTACT', 'Contact Us');

define('MODULE_BOXES_ABOUT_US_WHOLESALE_ENQUIRES', 'Wholesale Enquiries');

define('MODULE_BOXES_ABOUT_US_BOX_DEALER', 'Find a Retailer');

?>
Link to comment
Share on other sites

Hi,

 

You seem to be missing the define('ENTRY_DESC', 'YOUR TEXT HERE'); in /includes/languages/english/wholesale_contact.php

 

define('ENTRY_DESC', '<p>Becoming a retailer of our products is very easy. This text you can change in includes/languages/english/wholesale_contact.php</p>

<p>Depending on the size of your business, there will be a minimum order. Minimum orders are established at the time of the application approval and may be increased due to your ordering history.<p>

<p>Orders from existing stock are shipped within 1-3 days.</p>');

 

This is the text that will appear at the top of your contact form explaining you terms and conditions

 

Capital/uppercase letters normally indicate a missing language define

 

Your about us box (which is not standard ) has not got the language define so add this to

 

/includes/languages/english/modules/boxes/bm_about_us.php

 

define('MODULE_BOXES_ABOUT_US_BOX_WHOLESALE_ENQUIRES', 'Wholesale Enquiries');

 

instead of to the bm_information.php

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

I found the problem and, yes, it was with the wholesale?contact.php in languages. I used my old one instead of the one included in the pkg. My bad.

 

Great job! This works perfectly! I really appreciate it and, having looked in the addons for something that would work with my version and finding nothing, this will, I am sure, help others.

 

Thank you so much for your help, the contribution and your time.

Link to comment
Share on other sites

  • 4 weeks later...

I have had to reinstall my site (http://aquarian-artisan-bath-body.com) and seem to have an issue with the upload function for file attachments. It worked perfectly before the site crash so I simply used the same wholesale_contact.php files (catalog and catalog/includes/languages/english) but when I click on the "upload" button, no file is uploaded and no mention of a successful upload is made.

 

I went through the directions thoroughly, making the necessary edits mentioned if any. I unzipped the package again to give me fresh files too. Basically, other than re-using the wholesale_contact.php file(s), everything was transferred from the fresh extraction.

 

catalog/wholesale_contact.php draws the form fields which is...

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WHOLESALE_CONTACT);

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {

 

$error = false;

$name = tep_db_prepare_input($HTTP_POST_VARS['name']);

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);

$company_name = tep_db_prepare_input($HTTP_POST_VARS['company_name']);

$company_address = tep_db_prepare_input($HTTP_POST_VARS['address']);

$city = tep_db_prepare_input($HTTP_POST_VARS['city']);

$state = tep_db_prepare_input($HTTP_POST_VARS['state']);

$zip = tep_db_prepare_input($HTTP_POST_VARS['zip']);

$phone = tep_db_prepare_input($HTTP_POST_VARS['phone']);

$sales_estimate = tep_db_prepare_input($HTTP_POST_VARS['sales_estimate']);

$additional_information = tep_db_prepare_input($HTTP_POST_VARS['additional_information']);

 

if (!tep_validate_email($email_address)) {

$error = true;

 

$messageStack->add('contact', ENTRY_WHOLESALE_EMAIL_ADDRESS_CHECK_ERROR);

}

// BOF multimixer//

//define variable $email_body. if you want to add more fields do so by adding this line [ ."\r\n" . ] between the fields you wish to display and order them accordingly//

$email_body = ENTRY_NAME . ' ' . $name . "\r\n" . ENTRY_EMAIL . ' ' . $email_address . "\r\n" . ENTRY_COMPANY_NAME . ' ' . company_name . "\r\n" . ENTRY_COMPANY_ADDRESS . ' ' . $company_address . "\r\n" . ENTRY_CITY . ' ' . $city . "\r\n" . ENTRY_STATE . ' ' . $state . "\r\n" . ENTRY_ZIP . ' ' . $zip . "\r\n" . ENTRY_PHONE . ' ' . $phone . "\r\n" . ENTRY_SALES_ESTIMATE . ' ' . $sales_estimate . "\r\n" . ENTRY_ADDITIONAL_INFORMATION . ' ' . $additional_information;

//define variable $from_email. Set to Store owner email address as defined in Admin panel. If you want mails to be sent from customers mail address, set it to email_address//

$from_email = (STORE_OWNER_EMAIL_ADDRESS);

//EOF multimixer //

 

$actionRecorder = new actionRecorder('ar_wholesale_contact', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);

if (!$actionRecorder->canPerform()) {

$error = true;

$actionRecorder->record(false);

$messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_WHOLESALE_CONTACT_EMAIL_MINUTES : 15)));

}

if ($error == false) {

//BOF Multimixer//

// $enquiry replaced by $email_body Includes $email_body to message instead of $enquiry. $email_address replaced by $from_email Email is getting send from $from-email instead of $email_address//

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $email_body, $name, $from_email);

//EOF multimixer//

 

$actionRecorder->record();

 

tep_redirect(tep_href_link(FILENAME_WHOLESALE_CONTACT, 'action=success'));

}

}

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WHOLESALE_CONTACT));

 

require(DIR_WS_INCLUDES . 'template_top.php');

?>

 

<h1><?php echo HEADING_TITLE; ?></h1>

 

<?php

if ($messageStack->size('contact') > 0) {

echo $messageStack->output('contact');

}

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {

 

?>

 

<div class="contentContainer">

<div class="contentText">

<?php echo TEXT_SUCCESS; ?>

</div>

 

<div style="float: right;">

<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>

</div>

</div>

 

<?php

} else {

?>

 

<?php echo tep_draw_form('wholesale_contact', tep_href_link(FILENAME_WHOLESALE_CONTACT, 'action=send'), 'post', '', true); ?>

 

<div class="contentContainer">

<div class="contentText">

<?php echo ENTRY_DESC; ?>

 

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="fieldKey"><?php echo ENTRY_NAME; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('name'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_EMAIL; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('email'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_COMPANY_NAME; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('company_name'); ?></td>

<tr>

<td class="fieldKey"><?php echo ENTRY_COMPANY_ADDRESS; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('company_address'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_CITY; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('city'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_STATE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('state'); ?></td>

</tr>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_ZIP; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('zip'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_PHONE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('phone'); ?></td>

</tr>

<tr>

<td class="fieldKey"><?php echo ENTRY_SALES_ESTIMATE; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('sales_estimate'); ?></td>

</tr>

<tr>

<td class="fieldKey" valign="top"><?php echo ENTRY_ADDITIONAL_INFORMATION; ?></td>

<td class="fieldValue"><?php echo tep_draw_textarea_field('additional_information', 'soft', 50, 5); ?></td>

</tr>

</table>

</div>

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>

</div>

</div>

 

</form>

<div class="container_upload">

<div class="contr"><h2>You can select the file (image) and click Upload button</h2></div>

 

<div class="upload_form_cont">

<form id="upload_form" enctype="multipart/form-data" method="post" action="upload.php">

<div>

<div><label for="image_file">Please select image file</label></div>

<div><input type="file" name="image_file" id="image_file" onchange="fileSelected();" /></div>

</div>

<div>

<input type="button" value="Upload" onclick="startUploading()" />

</div>

<div id="fileinfo">

<div id="filename"></div>

<div id="filesize"></div>

<div id="filetype"></div>

<div id="filedim"></div>

</div>

<div id="error">You should select valid image files only!</div>

<div id="error2">An error occurred while uploading the file</div>

<div id="abort">The upload has been canceled by the user or the browser dropped the connection</div>

<div id="warnsize">Your file is very big. We can't accept it. Please select more small file</div>

 

<div id="progress_info">

<div id="progress"></div>

<div id="progress_percent"> </div>

<div class="clear_both"></div>

<div>

<div id="speed"> </div>

<div id="remaining"> </div>

<div id="b_transfered"> </div>

<div class="clear_both"></div>

</div>

<div id="upload_response"></div>

</div>

</form>

 

<img id="preview" />

</div>

</div>

<?php

}

 

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

I am unsure where the issue lies.

Link to comment
Share on other sites

Hi,

 

You have an end script tag in your template_top.php which should not be there

 

<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js">

<script type='text/javascript' src='ext/jquery/image_upload/js/script.js'></script> = BROKEN!!!

<link rel="stylesheet" media="screen" href="ext/jquery/image_upload/css/main.css">

</script> = REMOVE!!!

 

So replace the broken line with this line

 

<script type="text/javascript" src="ext/jquery/image_upload/js/script.js"></script>

 

and see what happens

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

you have removed one script to many !! :-

 

***REPLACE***

<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js">

<script type="text/javascript" src="ext/jquery/image_upload/js/script.js"></script>

******* WITH ******

<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js"></script>

<script type="text/javascript" src="ext/jquery/image_upload/js/script.js"></script>

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Messed with the template_top.php, checked all the end tags for script, found another error and everything works great. I love this contribution.

 

You were right. I had to walk away from it for a bit in order to see it clearly when I came back to it. Also, I found I must refresh my browser a couple of times just to make sure the new code is in place. Sometimes I forget. Sorry.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...