Jump to content
Sign in to follow this  
superstyling

if manufaturer id=x, redirect to questionaire else

Recommended Posts

The manufacturer (x) of some cosmetic products I wish to sell on-line require that a patient questionnaire or survey is filled out so that potential allergies can be ascertained prior to any of those manufacturerer's products being shipped to a customer.

 

I'm guessing that a solution is that a manufacturer scenario is added to the shopping_cart.php page so that "if manufaturer id=x, redirect to questionaire.php" else procede to checkout or login pages as per normal. If the product maufacturer=x, then, on completion of questionaire.php, I want to receive an email via a regular CGI script and the customer would procede to checkout.php or login.php

 

The database does not need to determine the content of the questionaire as I can handle that manually prior to shipping: I'll match the CGI email to the customer order and if the product suits the customer, I'll ship it and if it does not suit, I'll notify the customer via manual email that they are not eligible.

 

1) My question is, what code should I insert into shopping_cart.php to achieve the above, and what line should it be placed on? ...and..how do I code the SUBMIT button on the proposed questionaire.php page so that it redirects to the checkout or login page as per normal.

2) Does this sound like an easy fix; or is there a better solution?

 

If there is a PHP guru that knows what I need and can tell me I'm on the right track - thanks in advance - I look forward to some advice

Share this post


Link to post
Share on other sites

actually shouldnt be too hard..I just added phpesp to my site and i havent activated it yet but you have to right idea...

 

take a look at my survey..its not a real survey just a test

http://www.videogamedeals.com/survey.php

 

so once you install the survey software you just have to call it with an if statement and also you should have it open in a target="_blank" window

 

lmk how I can help..I would like to do a similar thing

Share this post


Link to post
Share on other sites

Hi jesse,

just looking at your site, nice Christmas snow and all.

 

I have just noticed : Join now to recieve special offers from VGD

The word recieve should read : "receive"

 

The survey you have, is it a contribution? where can I find it?

 

Salvo

Share this post


Link to post
Share on other sites
actually shouldnt be too hard..I just added phpesp to my site and i havent activated it yet but you have to right idea...

 

take a look at my survey..its not a real survey just a test

http://www.videogamedeals.com/survey.php

 

so once you install the survey software you just have to call it with an if statement and also you should have it open in a target="_blank" window

 

lmk how I can help..I would like to do a similar thing

Hey defender39

 

What you've done looks good. Where can I find phpesp?

Share this post


Link to post
Share on other sites

http://phpesp.sourceforge.net/

 

Its a bit much for me to make this contrib but I can help anyone with install questions and you can have my survey.php file I used

<?php

/*

  $Id: privacy.php,v 1.21 2003/02/13 04:23:23 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  require('includes/application_top.php');

 

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

 

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SURVEY, '', 'NONSSL'));

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<? require_once(DIR_WS_INCLUDES . 'meta.php'); ?>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- coolMenu //-->

<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>

<!-- coolMenu_eof //-->

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

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

  <tr>

    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

    </table></td>

<!-- body_text //-->

    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

      <tr>

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

          <tr>

            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

          </tr>

        </table></td>

      </tr>

      <tr>

        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

      </tr>

      <tr>

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

          <tr>

            <td class="main"><?php $sid=4; include("/usr/local/psa/home/vhosts/videogamedeals.com/httpdocs/survey/public/handler.php");?></td>

          </tr>

        </table></td>

      </tr>

    </table></td>

<!-- body_text_eof //-->

    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

    </table></td>

  </tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Share this post


Link to post
Share on other sites

now just add the other things for filenames.php

define('FILENAME_SURVEY', 'survey.php');

 

now the /catalog/includes/files/language/english/survey.php needs to be created

<?php

/*

  $Id: survey.php,v 1 2002/11/09

 

  OS Commerce - Community Made Shopping!

  http://www.oscommerce.com

 

  Copyright © 2000,2001 The Exchange Project

 

  Released under the GNU General Public License

*/

 

define('NAVBAR_TITLE', 'Survey');

define('HEADING_TITLE', 'Survey');

 

?>

 

now install the phpesp into /catalog/survey/

 

and follow the install directions for phpesp

 

you should be all set

Share this post


Link to post
Share on other sites

Oops...forgot to say that you also need to add some type of link either in the NAV or maybe a box. If you want to be creative you can have it on the last checkout checkout page and ask people about their experience shopping with you. Heck u can essentially create multiple survey.php pages for each survey. survey1.php survey2.php and so on

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×