7 replies
My website is Real Site Rank - Professional SEO Services

It is created through Wordpress

The issue I have is that when you click on any of my pages, lets take Facebook Likes - Get lots of likes for your business or fan page | realsiterank.com as an example, if you go to the bottom of the page, and click on any of the order now boxes, you are taken to a page where you as the customer can fill in the details required for the order, once these are complete and the customer clicks check out they are taken to paypal where they then make their payment.

This is where my issue comes. I am receiving the orders through paypal without any trouble, however, I am not receiving the form they complete prior to making their paypal payment. I am meant to be receiving this via email... either before or after the payment has been made. Prefereably as soon as they hit the check out button I want to receive the form.

I am banging my head against a wall on this one.. i am sure that I need to put a piece of code in on the file called Contact Page Page Template (order.php)

Anyone able to help?

Thanks

Anthony
#issue #site
  • Profile picture of the author Zdenek Koukol
    Can you provide source code of order.php? And how do you know which form is send over paypal? I tested your order form and looks that when you fill up data, then what is only displayed is paypal order button.

    Code:
    https://www.paypal.com/xclick/business=anthony.seamarks@sky.com&item_name=1000_fb_likes&item_number=01&amount=19&currency_code=USD
    What is paypal returning page when is payment done? How you will know which form to which form this is assigned?
    {{ DiscussionBoard.errors[8903889].message }}
    • Profile picture of the author antswebsites
      code for the order.php is;

      <?php session_start();
      /*
      Template Name: Contact Page
      */
      ?>
      <?php if (is_front_page()) { ?>
      <?php include(TEMPLATEPATH . '/home.php'); ?>
      <?php } else { ?>
      <?php the_post(); ?>

      <?php
      $et_ptemplate_settings = array();
      $et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_settings',true) );

      $fullwidth = isset( $et_ptemplate_settings['et_fullwidthpage'] ) ? (bool) $et_ptemplate_settings['et_fullwidthpage'] : (bool) $et_ptemplate_settings['et_fullwidthpage'];

      $et_regenerate_numbers = isset( $et_ptemplate_settings['et_regenerate_numbers'] ) ? (bool) $et_ptemplate_settings['et_regenerate_numbers'] : (bool) $et_ptemplate_settings['et_regenerate_numbers'];

      $et_error_message = '';
      $et_contact_error = false;

      if ( isset($_POST['et_contactform_submit']) ) {
      if ( !isset($_POST['et_contact_captcha']) || empty($_POST['et_contact_captcha']) ) {
      $et_error_message .= '<p>' . __('Make sure you entered the captcha. ','TheCorporation') . '</p>';
      $et_contact_error = true;
      } else if ( $_POST['et_contact_captcha'] <> ( $_SESSION['et_first_digit'] + $_SESSION['et_second_digit'] ) ) {
      $et_numbers_string = $et_regenerate_numbers ? __('Numbers regenerated.') : '';
      $et_error_message .= '<p>' . __('You entered the wrong number in captcha. ','TheCorporation') . $et_numbers_string . '</p>';

      if ($et_regenerate_numbers) {
      unset( $_SESSION['et_first_digit'] );
      unset( $_SESSION['et_second_digit'] );
      }

      $et_contact_error = true;
      } else if ( empty($_POST['et_contact_name']) || empty($_POST['et_contact_email']) || empty($_POST['et_contact_subject']) || empty($_POST['et_contact_message']) ){
      $et_error_message .= '<p>' . __('Make sure you fill all fields. ','TheCorporation') . '</p>';
      $et_contact_error = true;
      }

      if ( !is_email( $_POST['et_contact_email'] ) ) {
      $et_error_message .= '<p>' . __('Invalid Email. ','TheCorporation') . '</p>';
      $et_contact_error = true;
      }
      } else {
      $et_contact_error = true;
      if ( isset($_SESSION['et_first_digit'] ) ) unset( $_SESSION['et_first_digit'] );
      if ( isset($_SESSION['et_second_digit'] ) ) unset( $_SESSION['et_second_digit'] );
      }

      if ( !isset($_SESSION['et_first_digit'] ) ) $_SESSION['et_first_digit'] = $et_first_digit = rand(1, 15);
      else $et_first_digit = $_SESSION['et_first_digit'];

      if ( !isset($_SESSION['et_second_digit'] ) ) $_SESSION['et_second_digit'] = $et_second_digit = rand(1, 15);
      else $et_second_digit = $_SESSION['et_second_digit'];

      if ( !$et_contact_error ) {
      $et_email_to = ( isset($et_ptemplate_settings['et_email_to']) && !empty($et_ptemplate_settings['et_email_to']) ) ? $et_ptemplate_settings['et_email_to'] : get_site_option('admin_email');

      $et_site_name = MULTISITE ? $current_site->site_name : get_bloginfo('name');
      wp_mail($et_email_to, sprintf( '[%s] ' . esc_html($_POST['et_contact_subject']), $et_site_name ), esc_html($_POST['et_contact_message']),'From: "'. esc_html($_POST['et_contact_name']) .'" <' . esc_html($_POST['et_contact_email']) . '>');

      $et_error_message = '<p>' . __('Thanks for contacting us','TheCorporation') . '</p>';
      }
      ?>

      <?php get_header(); ?>

      <div id="content-area" class="clearfix<?php if($fullwidth) echo(' fullwidth');?>">

      <div class="post clearfix">
      <?php $width = get_option('thecorporation_thumbnail_width_pages') ;
      $height = get_option('thecorporation_thumbnail_height_pages' );
      $classtext = 'thumbnail-post alignleft';
      $titletext = get_the_title();

      $thumbnail = get_thumbnail($width,$height,$classtext,$titletext ,$titletext);
      $thumb = $thumbnail["thumb"]; ?>

      <?php if($thumb <> '' && get_option('thecorporation_page_thumbnails') == 'on') { ?>
      <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext , $width, $height, $classtext); ?>
      <?php }; ?>
      <?php the_content(); ?>
      <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

      <div id="et-contact">

      <div id="et-contact-message"><?php echo($et_error_message); ?> </div>

      <?php if ( $et_contact_error ) { ?>
      <form action="<?php echo(get_permalink($post->ID)); ?>" method="post" id="et_contact_form">
      <div id="et_contact_left">
      <p class="clearfix">
      <input type="text" name="et_contact_name" value="<?php if ( isset($_POST['et_contact_name']) ) echo esc_attr($_POST['et_contact_name']); else _e('Name','TheCorporation'); ?>" id="et_contact_name" class="input" />
      </p>

      <p class="clearfix">
      <input type="text" name="et_contact_email" value="<?php if ( isset($_POST['et_contact_email']) ) echo esc_attr($_POST['et_contact_email']); else _e('Email Address','TheCorporation'); ?>" id="et_contact_email" class="input" />
      </p>

      <p class="clearfix">
      <input type="text" name="et_contact_subject" value="<?php if ( isset($_POST['et_contact_subject']) ) echo esc_attr($_POST['et_contact_subject']); else _e('Subject','TheCorporation'); ?>" id="et_contact_subject" class="input" />
      </p>
      </div> <!-- #et_contact_left -->

      <div id="et_contact_right">
      <p class="clearfix">
      <?php
      _e('Captcha: ','TheCorporation');
      echo '<br/>';
      echo esc_attr($et_first_digit) . ' + ' . esc_attr($et_second_digit) . ' = ';
      ?>
      <input type="text" name="et_contact_captcha" value="<?php if ( isset($_POST['et_contact_captcha']) ) echo esc_attr($_POST['et_contact_captcha']); ?>" id="et_contact_captcha" class="input" size="2" />
      </p>
      </div> <!-- #et_contact_right -->

      <div class="clear"></div>

      <p class="clearfix">
      <textarea class="input" id="et_contact_message" name="et_contact_message"><?php if ( isset($_POST['et_contact_message']) ) echo esc_attr($_POST['et_contact_message']); else _e('Message','TheCorporation'); ?></textarea>
      </p>

      <input type="hidden" name="et_contactform_submit" value="et_contact_proccess" />

      <input type="reset" id="et_contact_reset" value="<?php _e('Reset','TheCorporation'); ?>" />
      <input class="et_contact_submit" type="submit" value="<?php _e('Submit','TheCorporation'); ?>" id="et_contact_submit" />
      </form>
      <?php } ?>
      </div> <!-- end #et-contact -->

      <div class="clear"></div>

      <?php edit_post_link(__('Edit this page','TheCorporation')); ?>
      <div class="clear"></div>
      </div> <!-- end .post -->

      </div> <!-- end #content-area -->

      <?php if (!$fullwidth) get_sidebar(); ?>
      <?php get_footer(); ?>
      <?php } ?>
      {{ DiscussionBoard.errors[8903977].message }}
    • Profile picture of the author Zdenek Koukol
      Originally Posted by Zdenek Koukol View Post

      Can you provide source code of order.php? And how do you know which form is send over paypal? I tested your order form and looks that when you fill up data, then what is only displayed is paypal order button.

      Code:
      https://www.paypal.com/xclick/business=anthony.seamarks@sky.com&item_name=1000_fb_likes&item_number=01&amount=19&currency_code=USD
      What is paypal returning page when is payment done? How you will know which form to which form this is assigned?
      I think that here is not issue with sending email at all, but that he has not defined call back which can take care of that all.

      Go here https://developer.paypal.com/docs/cl...htmlvariables/

      What is important for you is
      Code:
      notify_url
      , so when customer finish order, then he will be redirected on this URL and you will parse in this URL id of stored form. So when user open page in notify_url, this will be your thank you page - which will display "THANK YOU FOR YOUR ORDER" and which will send you email with information about the order. All clear?
      {{ DiscussionBoard.errors[8912202].message }}
  • Profile picture of the author phpg
    Or you might just try replacing wp_mail with mail .
    {{ DiscussionBoard.errors[8911425].message }}
  • Profile picture of the author phpg
    First, notify_url is IPN url, not the url where customer is redirected. That one is specified in "return" and "cancel_return" variables.

    Second, if you look at that code and / or that example page, you'll see that it's submitted before paypal, not after.
    {{ DiscussionBoard.errors[8912640].message }}
  • Profile picture of the author Zdenek Koukol
    Originally Posted by phpg View Post

    First, notify_url is IPN url, not the url where customer is redirected. That one is specified in "return" and "cancel_return" variables.

    Second, if you look at that code and / or that example page, you'll see that it's submitted before paypal, not after.
    Yep, your are right:
    Code:
    wp_mail($et_email_to, sprintf( '[%s] ' .  esc_html($_POST['et_contact_subject']), $et_site_name ),  esc_html($_POST['et_contact_message']),'From: "'.  esc_html($_POST['et_contact_name']) .'" <' .  esc_html($_POST['et_contact_email']) . '>');
    I little missed it
    {{ DiscussionBoard.errors[8912912].message }}

Trending Topics