Page 1 of 2

Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 03, 2015 2:32 am
by ColinM
Hi Pablo,

I'm just assisting a client set up a new PayPal account and have noticed that PayPal has the ability to create custom buttons that allows you add a drop down combo selection box for, say, selection of a clothing size - you configure the button in the PayPal account and then imbed the HTML in an HTML box.

I love the simplicity of the PayPal mini cart extension and how it keeps the buyer on the website, but it appears it needs to be the standard cart buttons?

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 03, 2015 6:01 am
by Pablo
Although I did not test it, the PayPal mini cart may also work with custom code.

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 03, 2015 6:17 am
by ColinM
Pablo wrote:Although I did not test it, the PayPal mini cart may also work with custom code.
It doesn't seem to Pablo - it opens the standard second tab browser window as if you had a std cart button without the Paypal Mini Cart extension in it.

Not sure if you can suggest anything from the PayPal Custom Button code snippet in the HTML area:

Code: Select all

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="RK2N3UWQR44U8">
<table>
<tr><td><input type="hidden" name="on0" value="Please select size">Please select size</td></tr><tr><td><select name="os0">
	<option value="Size S">Size S $60.00 AUD</option>
	<option value="Size M">Size M $60.00 AUD</option>
	<option value="Size L">Size L $60.00 AUD</option>
	<option value="Size XL">Size XL $60.00 AUD</option>
	<option value="Size XXL">Size XXL $60.00 AUD</option>
	<option value="Size 3XL">Size 3XL $60.00 AUD</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="AUD">
<input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
</form>

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 03, 2015 6:44 am
by Pablo
Change

Code: Select all

<input type="hidden" name="cmd" value="_s-xclick">
to

Code: Select all

<input type="hidden" name="cmd" value="_cart">

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 03, 2015 8:00 am
by ColinM
Pablo wrote:Change

Code: Select all

<input type="hidden" name="cmd" value="_s-xclick">
to

Code: Select all

<input type="hidden" name="cmd" value="_cart">
OK, that got us one step closer - it now displays the Mini cart - but it doesn't add the selected item to the cart ?

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 03, 2015 9:04 am
by Pablo
Your code does not have fields for amount and item ID

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 03, 2015 9:44 pm
by ColinM
Pablo wrote:Your code does not have fields for amount and item ID
I agree Pablo, but that's the code that is generated by PayPal - I've tried adding the code:

Code: Select all

<input type="hidden" name="amount" value="54.00">
<input type="hidden" name="tax" value="6.00">
<input type="hidden" name="currency_code" value="AUD">
but it still says my cart is empty if I use the mini cart.

In addition, I've noticed two other issues:

1) If I add the mini cart and add an item to the cart using the original WB add to cart button the mini cart doesn't show the tax only a pre-tax sub total.
2) If I test the same item without the mini cart - it (of course) reverts back to PayPal cart page but shows the GST.
3) If I use the code that PayPal provides to select a size with the Custom button and not the mini cart, it also doesn't show the GST.

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Fri Sep 04, 2015 6:12 am
by Pablo
I think you should also include the item name/number

Code: Select all

<input type="hidden" name="item_name" value="">
<input type="hidden" name="item_number" value="">
Note that I did not create the PayPal minicart, this is an external script. I only create an extension 'wrapper' for it, on request.
So I have no control over the behavior of this script. It is provided "AS IS".

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Fri Sep 04, 2015 11:35 am
by BaconFries
Hi Colin lets see if this helps the first part is the code you have already provided which is the buying options for the sizes and price.

Code: Select all

<select name="os0">
   <option value="Size S">Size S $60.00 AUD</option>
   <option value="Size M">Size M $60.00 AUD</option>
   <option value="Size L">Size L $60.00 AUD</option>
   <option value="Size XL">Size XL $60.00 AUD</option>
   <option value="Size XXL">Size XXL $60.00 AUD</option>
   <option value="Size 3XL">Size 3XL $60.00 AUD</option>
</select>
The second part should output the size and the price for what you need.

Code: Select all

<input type="hidden" name="on0" value="Size" />
   <input type="hidden" name="option_select0" value="Size S" />
   <input type="hidden" name="option_amount0" value="60.00" />
   <input type="hidden" name="option_select1" value="Size M" />
   <input type="hidden" name="option_amount1" value="60.00" />
   <input type="hidden" name="option_select2" value="Size L" />
   <input type="hidden" name="option_amount3" value="60.00" />
   <input type="hidden" name="option_select3" value="Size M" />
  <input type="hidden" name="option_amount4" value="60.00" />
  <input type="hidden" name="option_select4" value="Size L" />
  <input type="hidden" name="option_amount5" value="60.00" />
  <input type="hidden" name="option_select5" value="Size XL" />
  <input type="hidden" name="option_amount6" value="60.00" />
  <input type="hidden" name="option_select6" value="Size XXL" />
  <input type="hidden" name="option_amount7" value="60.00" />
  <input type="hidden" name="option_select7" value="Size 3XL" />
Hope this helps...

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 10, 2015 9:57 am
by ColinM
Pablo and BC - Thank you so much, my apologies for the delay in getting back to you, been away.

I haven't got down to testing all that code yet, but I will. Doing it one step at a time...

One question for you please Pablo, at this stage, why does the Mini cart by itself show only the Pre-tax amount as the item amount, the same page using the std external PayPal method shows the gross (GST included) amount?

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 10, 2015 10:17 am
by Pablo
I'm sorry I do not have any control over the behavior of this (third party) script. it is provided "AS IS".

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 10, 2015 10:57 am
by ColinM
Pablo wrote:I'm sorry I do not have any control over the behavior of this (third party) script. it is provided "AS IS".
Ahh, ok - no worries Pablo, thank you anyway 8)

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 10, 2015 4:15 pm
by BaconFries
Colin there may be a way I havent tried it as not at my PC on what you refer to as a"Walkabout: but will be back soon and try what I am thinking and will post results.

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Thu Sep 10, 2015 10:35 pm
by ColinM
BaconFries wrote:Colin there may be a way I havent tried it as not at my PC on what you refer to as a"Walkabout: but will be back soon and try what I am thinking and will post results.
BaconFries wrote:on what you refer to as a"Walkabout
:lol: hahaha we do indeed.

BC, that would be awesome mate - thank you - looking forward to that post!

Re: Integrating PayPal Mini cart with PayPal Custom Buttons

Posted: Fri Sep 11, 2015 7:45 am
by BaconFries
Hi Colin ok have looked at this and my initial thought to maybe what could be done.....cant sorry. I paid a visit to the following from the original author (jeff harrell ) of the script is it is not possible but it will show in the checkout.
https://github.com/jeffharrell/minicart/issues/66