Community Support Forums — WordPress® ( Users Helping Users ) — 2011-07-20T23:07:55-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=10443 2011-07-20T23:07:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10443&p=28771#p28771 <![CDATA[Re: Custom Success URL]]>
Code:
<input type="hidden" name="custom" value="www.MyWebsite.org|<?php echo $qty; ?>" />

in my initial subscription process, the code above gets submitted to paypal and then gets put into the users custom field upon payment finalization (see image).
Image

The issue is when the user does a paypal subscription modification, even though I am sending a different value to paypal, it doesn't ever come back and update the users custom field quantity.

I'm not sure if that is the intended process? If it is, then I will look into the alternative you mentioned. If it isn't then something isn't updating correctly. The code I posted in my previous post is the code for the subscription modification page that contains the custom field input. The form itself is actually pulled directly from the modification button.

Image

Statistics: Posted by joelcpatterson — July 20th, 2011, 11:07 pm


]]>
2011-07-20T21:51:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10443&p=28754#p28754 <![CDATA[Re: Custom Success URL]]>
joelcpatterson wrote:
Not WORKING:
members Custom field is not updating (http://www.mywebaddress.com|2 ---> http://www.mywebaddress.com|3)


The custom shortcode attribute is not the same as a custom profile field.

What you could try is use the Notifications API to give the custom value with the quantity to a script that'll update the user's custom profile field. WP Admin -> s2Member -> API / Notifications

Statistics: Posted by Cristián Lávaque — July 20th, 2011, 9:51 pm


]]>
2011-07-20T10:13:02-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10443&p=28708#p28708 <![CDATA[Re: Custom Success URL]]>
Code:
<?php
   $user_id = S2MEMBER_CURRENT_USER_ID;
   $s2member_custom_fields = get_user_option('s2member_custom_fields', $user_id);

   $qty = $_GET["qty"];
   $step = $_GET["step"];
   if(!$qty){
      $qty = substr(S2MEMBER_CURRENT_USER_CUSTOM,26);
   }
   $a3 = ($qty * .5);
?>
<!-- noformat on -->   
<div class="contentBackground setHeight">
<div class="contentHeader">Modify Membership</div>
<table>
    <tr>
    <?php
   if($step == 1){
      echo "<th class='selected' style='width:306px;'>Update Quantity</th>";
   }else{
      echo "<th style='width:306px;'>Update Quantity</th>";
   }
   if($step == 2){
      echo "<th class='selected' style='width:306px;'>Submit Modification</th>";
   }else{
      echo "<th style='width:306px;'>Submit Modification</th>";
   }
    ?>
    </tr>
    <tr>
    <td colspan=2>
   <?php if($step == 1){ ?>
   <form action="http://www.MyWebAddress.org/" method="get">
      <fieldset>
      <legend>Quantity:</legend>
      <input type="hidden" name="page_id" value="561">
       <input type="hidden" name="step" value="2">
      <label>I would like to receive </label>
      <input type="text" value="<?php echo $qty; ?>" name="qty" style="width:20px;">
      <label> Bible(s) a month.</label>
      <input type="submit" value="Update Quantity" name="submit">
      </fieldset>
   </form>
   <?php } ?>
   <?php if($step == 2){ ?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   <fieldset>
   <legend>Place Order:</legend>
   <label>I want <strong><?php echo $qty; ?></strong> Bible(s) per month, for a total cost of <strong>$<?php echo $a3; ?></strong> per month.</label>
   <input type="hidden" name="business" value="webmaster@MyWebAddress.org" />
   <input type="hidden" name="cmd" value="_xclick-subscriptions" />
   <input type="hidden" name="notify_url" value="http://www.MyWebAddress.org/?s2member_paypal_notify=1" />
   <input type="hidden" name="cancel_return" value="http://www.MyWebAddress.org/" />
   <input type="hidden" name="return" value="http://www.MyWebAddress.org/?s2member_paypal_return=1" />
   <input type="hidden" name="rm" value="2" />
   <input type="hidden" name="lc" value="" />
   <input type="hidden" name="no_shipping" value="1" />
   <input type="hidden" name="no_note" value="1" />
   <input type="hidden" name="custom" value="www.MyWebAddress.org|<?php echo $qty; ?>" />
   <input type="hidden" name="currency_code" value="USD" />
   <input type="hidden" name="page_style" value="paypal" />
   <input type="hidden" name="charset" value="utf-8" />
   <input type="hidden" name="item_name" value="Description and pricing details here." />
   <input type="hidden" name="item_number" value="1" />
   <input type="hidden" name="on0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>" />
   <input type="hidden" name="os0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>" />
   <input type="hidden" name="on1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; ?>" />
   <input type="hidden" name="os1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?>" />
   <input type="hidden" name="modify" value="1" />
   <input type="hidden" name="src" value="1" />
   <input type="hidden" name="srt" value="" />
   <input type="hidden" name="sra" value="1" />
   <input type="hidden" name="a3" value="<?php echo $a3; ?>" style="width:40px;" />
   <input type="hidden" name="p3" value="1" />
   <input type="hidden" name="t3" value="M" />
   <input type="submit" value="Submit Order Modification" />
   
   <input type="hidden" name="first_name" value="[s2Get user_field="first_name" /]">
        <input type="hidden" name="last_name" value="[s2Get user_field="last_name" /]">
        <input type="hidden" name="address1" value="[s2Get user_field="address" /]">
        <input type="hidden" name="address2" value="[s2Get user_field="address2" /]">
        <input type="hidden" name="state" value="[s2Get user_field="state" /]">
        <input type="hidden" name="city" value="[s2Get user_field="city" /]">
        <input type="hidden" name="zip" value="[s2Get user_field="zip_code" /]">
        <input type="hidden" name="night_ phone_a" value="[s2Get user_field="phone_number" /]">
        <input type="hidden" name="email" value="[s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]">
   </fieldset>
</form>
<strong>NOTE:</strong>You must process this modification through your paypal account. This will remove your previous montly subscription and update it to your desired subscription.<br /><br />
   <?php } ?>
    </td>
</table>
</div>
<!-- noformat off -->   

Statistics: Posted by joelcpatterson — July 20th, 2011, 10:13 am


]]>
2011-07-20T09:28:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10443&p=28705#p28705 <![CDATA[Re: Custom Success URL]]>
My initial registration works great. The field gets updated perfectly. I am now having trouble with trying to modify a membership after the fact. I'm using the paypal subscription modification button. I'm not really doing a membership upgrade,(level 1 to level 2), however I'm modifying the price based on the "qty" value they specify.

I am able to successfully complete a membership modification through paypal, updating the price from $1 to $2. But the custom field is not being updated on my site accordingly.

Things that I know are WORKING:
My modify button form is correctly submitting the new Qty value. (www.mywebaddress.com|3)
Paypal handles the subscription price correctly. (updates from $1 to $2)

Not WORKING:
members Custom field is not updating (www.mywebaddress.com|2 ---> www.mywebaddress.com|3)

Thanks!

Statistics: Posted by joelcpatterson — July 20th, 2011, 9:28 am


]]>
2011-07-08T17:33:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10443&p=22695#p22695 <![CDATA[Re: Custom Success URL]]> viewtopic.php?f=36&t=309#p1333

You can customize the PayPal return URL in your form adding this input tag

Code:
    <input type="hidden" name="return" value="URL goes here" />


I hope that helps. :)

Statistics: Posted by Cristián Lávaque — July 8th, 2011, 5:33 pm


]]>
2011-07-08T14:18:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10443&p=22672#p22672 <![CDATA[Custom Success URL]]> I own pro forms, but it seems preferable to go with a custom form that I have written, as I don't like the look of the "Modify" pro form template.

Here is the process I'm trying to accomplish.
1. User registers...fills out info. Submit --->sent to step 2
2. User logs in --->Sent to step 3
3. User selects a qty per month of something I ship to them. Then subscribes to a price based on that quantity.

In my php code I'm just creating the subcription form dynamically. qty of 1 = $34, qty of 2 = $68

What I need to be able to do, is have them input a quantity, have them pay for the subscription, verify that payment went through, then update their qty entry on my site. I need to make sure they paid for the qty they selected.

I saw in the pro forms there is a success url...Is there a way to implement that with a custom form? If so, I could then just send the qty data along to paypal, redirect after paypal, verify they have a subscriber ID and update the qty in my users meta info.

Maybe there is an easier way to do this, if so, I would be delighted.

Thanks a bunch for any help!
Joel

Statistics: Posted by joelcpatterson — July 8th, 2011, 2:18 pm


]]>