I have create for first time a shopping cart from scratch for a very special project.
At this time I have complete all the steps, from product selection / customization, to shopping cart product quantity update and other stuff that required.
My whole shopping cart is stored in session variable, encrypted.
My problem now, is that I don't know what is the best way to proceed to check out via PayPal.
Now I building the cart review page. The question is, how to send the cart information to paypal ?
Is it good way to add hidden fields in review page inside a form and send that information in PayPal with post method ?
This method is not so good, because an end user with knowledge, has the ability to alter that data.
Any idea on how to continue ?
Related
I have a need to create an advanced product with various discounts and conditional statements. I have tried several plugins including Gravity Forms Product Add Ons and various others but they dont seem to do what I need them to.
My need is I want to have a form the user fills out and I can handle all conditionals and when they hit the Add to cart button it will add their order to cart. I could use create order but not sure because it needs a product ID and I am kind of creating the product on the fly for each customer. I could also create the product as this thread suggests then add to cart but I fear if I manually create a product for each customer that we will have an absurd amount of products.
What would be the best way to create a form and then once filled out and submitted the total and details are sent to cart?
This link was a good resource but doesnt go into detail about the product id or how to do the form. Any guidance on the best way to tackle this?
UPDATE:
Here is a wireframe of what I want to do demonstrating the dynamic text boxes and discount rules. The deposits I am using the Woocommerce Deposits plugin. Just not sure the best way to do this.
I wish to use paypal to create a shop to an existing site, however I have reached a problem.
Paypal has a facility to 'add to cart' however when clicked on, it goes to their servers.The check out has no customisability what so ever, so looks completely out of sync with my site.
Is it possible to create a shopping cart on PayPal showing the list of items on MY site (so I can customise the look and feel of the shopping cart) and then only when the payment needs to be made, the user is sent to the PayPal Site.
Thanks
NOTE: I'm using pure HTML,CSS & PHP. I am not using a CMS such as WordPress.
Also when I mean I want to customise the look and feel of the shopping cart, I don't mean just the button, but the way the items is shown up along with details such as Qty.
If you're working with basic PHP code that you built on your own (no framework like WP) then you'll need to build your own shopping cart.
If you were to use WP, though, you could use WooCommerce which is a great shopping cart system and would probably save you lots of time.
I've been having difficulty trying to accomplish the passing of variables that a user inputs from within the product page into the cart so that when the user checks out I can utilize that data.
I'm confused on whether I should be using custom fields / variables / or some other means to make this work. I'll try to describe the exact workflow before so my use case is clear.
1) User lands on a specific simple product page
2) Before the user can click the add to cart button, they must validate their account credentials from my auth server that is decoupled from wordpress.
3) Once the details are validated the user can click add to cart and the product in the cart would have the user details attached to it in some form for querying at checkout.
4) * At this point user interaction is done
5) * At time of checkout I've hooked add_action( 'woocommerce_order_status_completed', 'order_system' ); to inspect the cart and the items within the cart
6) * *I need to retrieve the variables that were passed along with the item **
7) ** My checkout hook then POSTs the referenced variables to an API **
Any help is greatly appreciated, I've struggled with this for some time now.
This guide I wrote is probably perfect for what you need. This plugin is different, but it should have all of the hooks and info you need to modify it for your own needs.
I show all of the steps on adding a custom form and adding the values the user enters to the cart meta so you can query it out during the checkout process.
function is_xaik_wc_in_cart() {
global $woocommerce;
if (sizeof($woocommerce->cart->get_cart())>0) :
foreach ($woocommerce->cart->get_cart() as $item_id => $values) :
if (isset($values['_xatik_wc_data'])) :
return TRUE;
endif;
endforeach;
endif;
return FALSE;
}
Once you know it's in the cart, you can just query it doing another foreach loop on the cart. Or just modify the function to do it all at once.
All of these variables should stick with the cart meta information.
Here is a gist example that should work.
On a shopping cart your main objective is to make the shopping as easy as possible, so you should NOT use java script variables or custom hidden fields (i am assuming you were talking about these), if you do so those variables will be lost if the user exit of your website or he just hit back after adding something to the car.
Try using cookies or sessions.
You can find information about cookies Here
I need to dynamically generate the price of the full aggregate cart on my website - I've already built my own shopping cart. Only when the user is going to check out do I want to generate a button with the aggregate cart price.
What's a better approach? Should I create a hosted button through PayPal's interface and just update it whenever the user gets to the checkout stage? Or should I create a new button for every user checkout? Is either approach going to be more expensive than the other?
I'd suggest creating a saved hosted button for each item you sell. Because this way users can't tamper with the prices of the items.
If you use the "customized" button and change the form variables yourself without saving it on paypal, you'll have to verify the price of each order because frankly it is VERY easy to change them through DOM. (Especially true for anyone on this site)
If you have thousands of items, you might want to look into third-party merchant solutions that allows you to update items easier.
I am developing a website selling gardening products using PHP and SQL. The user searches for a plant, finds the one they want, clicks on it for more details and there they see an option to add to cart. I have signed up to Paypal's business account and used their add to cart button. But currently, when I try it out and click the button, it doesn't do anything. Obviously this is because know variables have been passed about that specific product. What do I need to do in order to get each item into the cart?
#QUESTION:
To impliment a normal POST to pass to standard form, follow this tutorial:
http://www.evoluted.net/thinktank/web-development/paypal-php-integration
#INTEGRATED SOLUTION:
Integrated solutions will allow you to make these transactions without going offsite.
Using this method requires alot more security.