Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#106 2008-05-02 09:53:00

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Is there a way to put a limit to the quantity of things I’d like to sell? Say I have 20 bags to sell, and I want a SOLD OUT button to display after selling the 20th piece…

No, sorry! This will work when a store management is implemented. You have to handle it manually at the moment.

I’m also puzzled on how to get the Private Key and Public Certificate from OpenSSL. I don’t understand a word of what I’m supposed to do to get a cert! Can anyone guide me please?

First you need an access to a unix or linux machine with an installed openssl. Maybe you have an ssh access to your hosting or web account and this is a unix or linux so you can do this. For windows maybe this port will work (not tested).

If you have an access so follow the steps of the paypal site:

  1. First create a private key with the following command: openssl genrsa -out my-private-key.pem 1024 – this will produce a 1024bit long RSA key for you, where my-private-key.pem is the name of the file which will be saved in your home directory.
  2. With this key/file you can create your public certificate now: openssl req -new -key my-private-key.pem -x509 -days 365 -out my-public-certificate.pem – During the generating process you will be asked some questions about the owner of the certificate. The file my-public-certificate.pem will also be saved in the same place as your private key.
  3. Then you have to upload your public certificate to your paypal account. After this procedure you will get your paypal certificate id (CERT ID).
  4. Now you can grab the paypal public certificate (it’s a file, too) from you paypal account.
  5. As the last step place the three files (your own generated my-private-key.pem, my-public-certificate.pem and the paypal certificate paypal_cert.pem) in your hosting account and configure the shop in yab_shop_config as described in the plugin help.

Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#107 2008-05-04 21:00:43

King Rat
Member
Registered: 2004-11-11
Posts: 20

Re: yab_shop (simple textpattern shop with paypal support)

Hmm. I noticed something irksome over the weekend. Yab_shop supports three product options (size, color, etc.) but PayPal only supports two :( It took me a while to figure out why my third property wasn’t showing up in PayPal. I think I may hack the plugin to put the third option in the PayPal API ‘custom’ variable, which is passed through to the seller, and not seen by the buyer.

Oh, and Amy, I’ve used the Windows OpenSSL port linked to by trenc, and haven’t had any problems with it. The encryption chapter in Damon Williams’s book, Pro PayPal E-Commerce, walks the reader through the process fairly well.

Trenc, that answer above makes it sound like you intend to eventually add store management. I can imagine that development is a fair ways off, but the tease certainly whets my appetite ;)

Offline

#108 2008-05-05 10:19:25

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Hmm. I noticed something irksome over the weekend. Yab_shop supports three product options (size, color, etc.) but PayPal only supports two :( It took me a while to figure out why my third property wasn’t showing up in PayPal. I think I may hack the plugin to put the third option in the PayPal API ‘custom’ variable, which is passed through to the seller, and not seen by the buyer.

Holy crap, your right!

I thought the paypal optional parameters would be incrementally, but paypal only allow two of them. I wil fix it next version. I think I will merge only two optional parameters/properties and not all three, ‘cause of 200 characters length issue of the paypal parameters.

Trenc, that answer above makes it sound like you intend to eventually add store management. I can imagine that development is a fair ways off, but the tease certainly whets my appetite ;)

Well, ‘cause some users have asked about it so I think I could implement it. This will be not so complicated with an additional custom field, I think.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#109 2008-05-06 11:41:22

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: yab_shop (simple textpattern shop with paypal support)

Anyone seen this before? It would cool if this plugin could have Amazon S3 support for digital goods.

Offline

#110 2008-05-06 13:36:10

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: yab_shop (simple textpattern shop with paypal support)

Not quite the same thing, But I’ve been using e-junkie for digital stuff (fonts). They integrate seamlessly with paypal, so when someone pays, they get the files sent automatically, and has lots of advanced options like activation codes, packages, etc.


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#111 2008-05-06 13:55:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,439
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

FireFusion wrote:

Anyone seen this before? It would cool if this plugin could have Amazon S3 support for digital goods.

That’s a neat script, thanks for sharing. Shame it relies on Amazon S3 which is not always to everybody’s (well, my) tastes. But the source is available so I guess there’s no reason the idea couldn’t be ported to a more open system using something like mediafire for storage. Maybe then, with judicial use of this plugin — perhaps with smd_remote_file and/or some authentication — we could offer paid digital downloads of images/music/video with fairly easy management of the shop within TXP. I’d like that.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#112 2008-05-30 20:00:37

mauricenaef
Member
Registered: 2008-01-31
Posts: 23

Re: yab_shop (simple textpattern shop with paypal support)

Hi there

I’ve played around with the plugin, and it really works very well.

Only thing I cant figure out is weather it is possible to only show the updated number of items in the Shopping cart (yab_shop_cart), and not the whole summary… or is there a way to make it sum up instead of list?

Thanks for the help in advance!
Regards Marcel

Offline

#113 2008-05-30 21:36:28

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: yab_shop (simple textpattern shop with paypal support)

trenc wrote:

I don’t know yet where the prices for the specific property (e.g. size) will be stored. It have to be such an form that I can build an array from it. But I will think about it. [taken from post #103

trenc, have you incidentally read Bloke’s thread already, where he’s thinking aloud about a possible future Semi-persistent general storage plugin, as he calls it? A shop solution is could be just one of the possible applications of his focused plugin.

Last edited by uli (2008-05-30 21:39:44)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#114 2008-05-31 10:21:22

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Only thing I cant figure out is weather it is possible to only show the updated number of items in the Shopping cart (yab_shop_cart), and not the whole summary… or is there a way to make it sum up instead of list?

No sorry, but if you have little bit php knowledge, you can edit the output of the cart in the function yab_shop_build_cart(). It begins around line 840 in the commented source code.

trenc, have you incidentally read Bloke’s thread already, where he’s thinking aloud about a possible future Semi-persistent general storage plugin, as he calls it? A shop solution is could be just one of the possible applications of his focused plugin.

Oh, I’ve totally missed this thread. Thanks for the hint. This could be a nice solution for some things, not only for some shop enhancements.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#115 2008-05-31 13:46:59

mauricenaef
Member
Registered: 2008-01-31
Posts: 23

Re: yab_shop (simple textpattern shop with paypal support)

Okay,.. ive tried to figure it our and can’t say i succeded.
I keep on getting error messages regarding some commas! I really only know very little PHP.

Is there anyone who can help me with this part?

How do I only output the qty in this funtion and add my own text in front?
Kind regards

Marcel

<code>
function yab_shop_build_cart($cart)
{ $cart_display = ‘’;

if ($cart->itemcount > 0) { foreach ($cart->get_contents() as $item) { $cart_display .= tag( $item[‘name’].tag( tag(yab_shop_lang(‘price’).’:&nbsp;’.yab_shop_currency_out(yab_shop_config(‘currency’), ‘cur’).yab_shop_currency_out(yab_shop_config(‘currency’), ‘toform’, $item[‘price’]), ‘li’, ‘ class=“yab-price”’). tag(yab_shop_lang(‘quantity’).’:&nbsp;’.$item[‘qty’], ‘li’, ‘ class=“yab-qty”’), ‘ul’), ‘li’, ‘ class=“yab-item”’); } $cart_display = tag($cart_display, ‘ul’, ‘ class=“yab-cart”’); $cart_display .= tag(yab_shop_lang(‘sub_total’).’:&nbsp;’.yab_shop_currency_out(yab_shop_config(‘currency’), ‘cur’).yab_shop_currency_out(yab_shop_config(‘currency’), ‘toform’, $cart->total), ‘span’, ‘ class=“yab-subtotal”’); $cart_display .= tag(yab_shop_lang(‘to_checkout’), ‘a’, ‘ href=”’.pagelinkurl(array(‘s’ => yab_shop_config(‘checkout_section_name’))).’” title=”’.yab_shop_lang(‘to_checkout’).’” class=“yab-to-checkout”’); } else { $cart_display = tag(yab_shop_lang(‘empty_cart’), ‘span’, ‘ class=“yab-empty”’); } return $cart_display; } <code />

Offline

#116 2008-05-31 21:00:44

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: yab_shop (simple textpattern shop with paypal support)

trenc wrote:

This could be a nice solution for some things, not only for some shop enhancements.

No, this is of course once again a Swiss Army Knife plugin (the like he often bakes), and I hope it will see the light of day.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#117 2008-06-01 09:58:20

mauricenaef
Member
Registered: 2008-01-31
Posts: 23

Re: yab_shop (simple textpattern shop with paypal support)

So I kind of figured out how to stripp the PHP appart that it doesnt output everything in the cart section. Only thing I cant seem to fix is that it wont display all items (quantity) in summary. I would like to have it to display only the numbers of Items in my cart.

Since im a reall newby at PHP, is there any one who can help me figure out this function so it will do that?
Im sure I have to replace the foreach function, but dont know whit what or how!

foreach ($cart->get_contents() as $item) {

$cart_display .= tag(yab_shop_lang(‘quantity’).’:&nbsp;’.$item[‘qty’], ‘li’, ‘ class=“yab-qty”’);

}

Thanks in advance and regards Marcel

Offline

#118 2008-06-02 09:05:32

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

function yab_shop_build_cart($cart)
{
  $cart_display = '';
  if ($cart->itemcount > 0)
  {
    $tmp_qty = 0; // set a new variable to 0
    foreach ($cart->get_contents() as $item)
    {
      $tmp_qty += $item['qty']; // per each pass through the array add up the single quantity to the new variable
    }
    $cart_display = tag($tmp_qty, 'span', ' class="yab-cart-qty"'); // create a <span>-tag with the new quantity
  }
  else
  {
    $cart_display = tag(yab_shop_lang('empty_cart'), 'span', ' class="yab-empty"');
  }
  return $cart_display;
}

If you want an additional message you can use the existent tag <txp:yab_shop_add_message message="your message here" />.

Last edited by trenc (2008-06-02 09:07:21)


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#119 2008-06-04 12:30:11

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Small bugfix version v0.3.3:

I’ve fixed the bug related with all three used product properties and and paypal. Now it should work. I’ve merged the the property 2 and 3 for paypal if both are used.

Btw: If you use the encrypted paypal button and you have generated the key and certificates on a debian etch machine please update the openssl package and regenerate the key and certifiactes. It’s urgent! See debian announcement!


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#120 2008-06-06 14:50:45

mauricenaef
Member
Registered: 2008-01-31
Posts: 23

Re: yab_shop (simple textpattern shop with paypal support)

Ive put my site using this plugin live on the server and am getting a very strange behaviour.
If I add products it shows in my cart, when I checkout it displays as normal, but when I delete or modify it doesnt always respond imediatly and the deleted products return back in the cart when going back to the products..

Any one else experiance this? Here is the page so far (not yet fixed any IE bugs and didnt set up Paypal yet) shop.individua.ch

Kind regards
Marcel

Offline

Board footer

Powered by FluxBB