If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / Contact Us form goes to add product?

Contact Us form goes to add product?

Locked

Started by forced on 11 Sep 2009, 9:07 PM · Views: 1,257

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
11 Sep 2009, 9:07 PM
#1
forced avatar

forced

New Zenner

Join Date:
Oct 2007
Posts:
61
Plugin Contributions:
0

Post #1 by forced

Zen Cart v1.3.8a
I am using the ask a question contribution and contact us pages to email a price quote to the customer. When I go the product page and hover over the button, or push it, it appears to be going to an add to cart page. When I look at the source code, it has the correct URL for the email quote page. I am stumped???

Here is a link to a product page:
http://www.superchargersuperstore.com/index.php?main_page=product_info&cPath=7_35_51_57_95&products_id=76
Steve

11 Sep 2009, 9:51 PM
#2
forced avatar

forced

New Zenner

Join Date:
Oct 2007
Posts:
61
Plugin Contributions:
0

Post #2 by forced

im not sure if this is the right spot to ask this question?

:blink:

11 Sep 2009, 10:05 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #3 by drbyte

It's probably the right spot. I don't know the answer. I've never used the addons you mention, so someone else who's more familiar with them will have to respond.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Sep 2009, 10:15 PM
#4
forced avatar

forced

New Zenner

Join Date:
Oct 2007
Posts:
61
Plugin Contributions:
0

Post #4 by forced

Does it make sense that in the source code it shows the correct URL, but when you actually click the button it goes to a different URL?

11 Sep 2009, 10:42 PM
#5
forced avatar

forced

New Zenner

Join Date:
Oct 2007
Posts:
61
Plugin Contributions:
0

Post #5 by forced

Here is my code...

This is in the tpl_product_info_display.php

<!--bof Email For Price -->
 <div id="askQuestion" class="biggerText">
<?php echo zen_draw_form('email_price_quote', zen_href_link(FILENAME_EMAIL_PRICE_QUOTE, 'action=send&products_id=' . $_GET['products_id'])); ?>
<fieldset id="contactUsForm">
<legend>Enter Your Email For a Price Quote</legend>
<label class="inputLabel" for="email-address">Email Address:</label>
<input type="text" name="email" size="40" id="email-address" />
<br class="clearBoth" />
<br /><br />Your email address will not be stored.
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
</fieldset>

</form></div>
   <br />
   <br class="clearBoth" />
   
<!--eof Email For Price -->

Here is my tpl_email_price_quote_default.php

<div class="centerColumn" id="askAQuestion">

<div class="mainContent success">Check your email for our Price Quote!</div>

<div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

</div>

Here is my header_php.php

  $valid_product = false;
  if (isset($_GET['products_id'])) {
  	$superstore_price = zen_get_products_display_price((int)$_GET['products_id']);
    $product_info_query = "select pd.products_name, p.products_price, p.products_model
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_status = '1'
                           and p.products_id = '" . (int)$_GET['products_id'] . "'
                           and p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";

    $product_info = $db->Execute($product_info_query);

    if ($product_info->RecordCount() > 0) {
      $valid_product = true;
    }
  }

  if ($valid_product == false) {
    zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id']));
  }

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
$email_address = zen_db_prepare_input($_POST['email']);
$zc_validate_email = zen_validate_email($email_address);
$send_to_name = "Supercharger Superstore Customer";
$email_subject = "Price Quotation on" . $product_info->fields['products_model'] . "From SuperchargerSuperstore.com";
$email_text = "";
$name = "Supercharger Superstore";
$email_address = "[email protected]";

    // Prepare HTML-portion of message
    $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Thank you for enquiring with SuperchargerSuperstore.com!</b><br><br>You requested a price quotation on: ' . $product_info->fields['products_name'] . '<br>Part Number: ' . $product_info->fields['products_model'] . '<br><b>SuperchargerSuperstore price: ' . $superstore_price . '</b><br>MSRP: ' . $product_info->fields['products_price'] . '<br><br>If you would like to purchase this system, <a href="http://www.superchargersuperstore.com/index.php?main_page=index&action=buy_now&products_id=' . $_GET['products_id']) . '">please click here to add it to your shopping cart.</a><br /><br>Thank you,<br><b>The Supercharger Superstore</b><br><br>Please note: Pricing and availability are subject to change at any time without prior notice. Please consult our terms and conditions pages on our website.<br>';

    // Send message
    // reuse contact_us form so we get the correct reply-to and don't have
    // to change includes/functions/functions_email.php (which has special
    // hooks for contact_us.
    zen_mail($send_to_name, $email_address, $email_subject, $text_message, $name, $email_address, $html_msg,'contact_us');
} // end action==send

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_EMAIL_PRICE_QUOTE, 'false');

$breadcrumb->add(NAVBAR_TITLE);
12 Sep 2009, 12:01 AM
#6
forced avatar

forced

New Zenner

Join Date:
Oct 2007
Posts:
61
Plugin Contributions:
0

Post #6 by forced

I got an email saying the error had to do with the zen_draw_form line in the page. I tried taking that out and using an html form line and it seemed to do the same thing... :shocking:

12 Sep 2009, 12:05 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #7 by drbyte

forced:

Does it make sense that in the source code it shows the correct URL, but when you actually click the button it goes to a different URL?

Looks like the code checks to see if the products_id is "valid" and if it's not, it redirects to the product page:```
if ($valid_product == false) {
zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id']));
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Sep 2009, 4:20 PM
#8
forced avatar

forced

New Zenner

Join Date:
Oct 2007
Posts:
61
Plugin Contributions:
0

Post #8 by forced

Doesn't this header_php.php page get called when the main_page is the "email_price_quote"? This error is happening on the "product_info" page.

14 Sep 2009, 9:59 PM
#9
forced avatar

forced

New Zenner

Join Date:
Oct 2007
Posts:
61
Plugin Contributions:
0

Post #9 by forced

I ended up just using the "ask a question" contribution and changing the variables and added the query to pull the retail price and my sale price. Then I changed the email addresses around so that the address entered would get the email with the product pricing.

:clap: