Forum Replies Created
-
AuthorPosts
-
joanMember
I have found eShop has the perfect checkout pages, and Simple Paypal has the perfect button flexibility in placing buttons anywhere on the post. Both plugins use the wordpress post as the product. If only you could combine them
joanMemberyou should just be able to dump all the values to a database table inside WordPress easily. Look up some Ptutorials on how to do this and you should be set I think.
Ok I’m getting desperate, and on the verge of giving up with Simple Paypal. Can you please give me some websites which explain the above? I have tried so many versions of the above. Regards, Joan
joanMemberHi Ruhul,
Into your wp_shopping_cart.php file which displays the checkout page, within a form, I added two input boxes, as below:
<form action="http://www.travelhorizonstyle.com.au/wp-content/cust-write.php" method="post" name="book"><input type="text" size="10" value="" name="First"><br><input type="text" size="10" value="" name="Last"><input type="submit" value="NEXT"></form>';
Into the cust-write.php file I have tried various methods to get these two fields to be written to the database, without success as I keep getting an error about and invalid object… The variations are commented out below:
<?php
function save() {
global $wpdb;
$key1 = "user_login";
$key1 = "user_nicename";
$First = $_POST['First'];
$Last = $_POST['Last'];
$result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->customers} ( user_login, user_nicename ) VALUES ( %s, %s )", $First, $Last ) );
//$wpdb->insert( 'table', array( 'column1' => 'value1', 'column2' => 123 ), array( '%s', '%d' ) )
//$wpdb->insert( $wpdb->customers, array( user_login => $First, user_nicename => $Last ) );
//$wpdb->query( $wpdb->prepare( " INSERT INTO $wpdb->customers ( $key1, $key2 ) VALUES ( %s, %s )", $First, $Last ));
//$wpdb->query( $wpdb->prepare( " INSERT INTO $wpdb->customers ( user_login, user_nicename ) VALUES test, tester ));
//$wpdb->query("INSERT INTO $wpdb->customers VALUES(" .$First .",". $Last . ")");
$wpdb->flush();
//Parse error: syntax error, unexpected T_OBJECT_OPERATOR i
//Call to a member function insert() on a non-object in..line 7
//Call to a member function query() on a non-object in.. line 8
//return $result;
}
?>Can you give me suggestions as to why it will not write the the database table ‘customers’ ??
Kind regards,
Joan.
joanMemberHi Ruhul,
I hope you’re interested to know that I can embed your Simple Paypal Shopping Cart into an mm Form, simply by typing [show_wp_shopping_cart] into the mm form design area. This is quite exciting. mm forms then writes the extra info to the database, when its “submit” button is pressed. Of course I want the Paypal button to be pressed instead, so I could alter your code to execute the mm forms write to database function, but I’m not confident to do that.
Don’t worry about passing the Firstname/surname to paypal… I’ve got that sorted. So I’m back to creating a form to capture the extra info, in your code… Regards, Joan
joanMemberok thanks Ruhul, I’ll work on a custom form that writes to a database table and share the results (when I’ve figured it). BTW, I’m better on callback functions now, but still can work out the mm forms code. Finally, can you give me an intro on sending the collected Firstname/surname to the Paypal screen ?
joanMembereStore is great but
A) There are around 10 fields to collect, eg phone, mobile, passport#, Name of 2nd traveller, Name of 3rd traveller (etc), Insurance Req Y/N , Airfares Req Y/N, Special Instructions…(I dont think it can have that many custom fields, can it?)
With Simple Paypal I can use my own database table for the products (fields are code,date,RRPrice,ourPrice…etc). eStores tables are ‘fully normalised’ I presume, so that products and variations are in separate tables, which would be extra work to get the data into your tables, then I have to use your productID field in the post to display the table… I’m thinking it is more work. Perhaps if I could see your database structure I could see if I could load into your tables? Is that possible?
joanMemberThanks Ruhul for replying so soon. I’m not yet familiar with how callback functions work, so although I’ve combed through the mm forms code, I can’t figure how to call the php function. Probably other people would also need to collect extra info before Simple Shopping Cart checkout too. I see now that empowerednutrition.com/shop/ mentioned above is just using your eShop plugin to collect a coupon code. Using mm forms would make that easily customised and store the results, but the plugin seems to be unsupported (unlike yours which is fantastic!). If you have any ideas that can get me going, I’d be very grateful. Kind regards, Joan.
joanMemberSorry Ruhul, I spelt your name incorrectly.
joanMemberHi Ruhul
As always you are doing a fantastic job with Simple Paypal. I was wondering if the above ‘require login’ could be built on so that the users name is passed to Paypal’s form ?
Regards, Joan
-
AuthorPosts