Adding shipping via advanced variables or html code to paypal subscription button

82 views Asked by At

I run a small localised oatmilk making and delivery business, and we are trying to set up a subscription model via paypal. The subscription buttons and reports give us (almost!) everything we need, however there is one snag - I don't seem to able to add a shipping / delivery amount at the checkout. I would like this to be separate from the main price so the price of the product itself is evident. Here is the code below - the only thing I've changed is the hosted button ID value:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XYZ">
<table>
<tr><td><input type="hidden" name="on0" value="How many would you like?">How many would you like?</td></tr><tr><td><select name="os0">
    <option value="1">1 : £2.20 GBP - weekly</option>
    <option value="2">2 : £4.20 GBP - weekly</option>
    <option value="3">3 : £6.00 GBP - weekly</option>
</select> </td></tr>
<tr><td><input type="hidden" name="on1" value="Select your delivery area">Select your delivery area</td></tr><tr><td><select name="os1">
    <option value="Easton">Easton </option>
    <option value="St. Werburghs">St. Werburghs </option>
    <option value="St. Pauls">St. Pauls </option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="GBP">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_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_GB/i/scr/pixel.gif" width="1" height="1">
</form>

I've tried to add 'shipping=0.25' into the advanced variables, and tried putting the HTML in, but neither work. I know its possible, as I can go into 'manage subscriptions / shipping' and manually set the delivery price after the subscription has created (which I guess could be our back-up option - Does anyone have any ideas?

Thankyou!

Joshua

I tried to set up a shipping amount on a paypal subscription button, but it didn't work

1

There are 1 answers

2
Preston PHX On

There are no Legacy Payments Standard HTML recurring payment variables for separate shipping amounts.

Legacy payment standard integrations (including this pill "Subscribe" button) are deprecated and should not be used for new integrations.

Instead, see the current PayPal Subscriptions documentation.

A Subscribe button can be created interactively in the PayPal account via https://www.paypal.com/billing/plans

To add shipping to a button, include a shipping_amount object in the JSON of its subscription creation, alongside the plan_id (the only required parameter). The format of the create subscription payload is documented in the create subscription API reference.