2

This is a large gallery selling prints at A4 and A3 at a set price for both (but I don't know the prices yet) via paypal.

I don't think it needs a full store cart solution, almost an identical simple paypal button with dropdown for price modifier – but is it possible to pass a SKU to paypal in this way?

What might be a tidy solution for this?

Thanks Bruce.

2

If you don't need a large e-commerce add-on, you might want to try the native EE Simple Commerce module. It can be used to connect to PayPal easily.

If that doesn't work, try the newly released Simple Cart add-on.

1
  • It doesn't do the price modifier I need nor would it allow me to alter all the prices as and when they change (there are 4000+ items). – Bruce Stanley Oct 21 '13 at 15:35
2

It's actually quite easy to use the standard Paypal shopping cart with EE.

Use Paypal's cart/button generator to get the basic add to cart form code, you can add two product options fields using the generator, but it will actually support up to 10 option fields if you need more.

The next step is to add the form to your template and replace various values with EE custom field tags, example:

{exp:channel entries channel="products" limit="1"}
<h1>{title}</h1>

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="{your_email_address}">
<input type="hidden" name="item_name" value="{title}">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<input type="hidden" name="currency_code" value="GBP">

<!-- sku in hidden field -->
<input type="hidden" name="on1" value="SKU">
<input type="hidden" name="os1" value="{cf_product_sku}">

<!-- options -->
<input type="hidden" name="on0" value="Size">Size
<select name="os0">
    <option value="A4">A4</option>
    <option value="A3">A3</option>
</select>
<!-- options data hidden fields -->
<input type="hidden" name="option_select0" value="A4">
<input type="hidden" name="option_amount0" value="{cf_a4_price}">
<input type="hidden" name="option_select1" value="A3">
<input type="hidden" name="option_amount1" value="{cf_a3_price}">
<input type="hidden" name="option_index" value="0">


<input type="image" src="https://www.paypalobjects.com/en_GB/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_GB/i/scr/pixel.gif" width="1" height="1">
</form>
{/exp:channel entries}

For reference I added some sample channel fields, eg

{title}
{cf_product_sku} (your SKU code)
{cf_a4_price} (A4 price)
{cf_a3_price} (A3 price)

...obviously you'll want to tailor those as needed!

1
  • Thanks. That looks promising, I'll let you know how it works. – Bruce Stanley Oct 24 '13 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.