Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#709 2012-08-13 08:18:54

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)

Hi palmkvist,

Is there a way to swith the order of the sum and the currency sign?
Swedish currency is written “ 150kr or 150,00kr “

Sorry, but there is no build-in method to achieve this.


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

Offline

#710 2012-08-31 11:05:29

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)

I bugfixed my version of Yab Shop and polished the admin UI a little bit for usage with TXP 4.5.0 themes:

12-08-31 – v0.8.1: yab_shop_v0.8.1.tar.gz
  • bugfix: fix a bug with PHP 5.3 and a deprecated warning (referencing new instances)
  • bugfix: fixed a bug in the install/update procedure
  • bugfix: refurnished admin UI for TXP 4.5.0
  • bugfix: partial using of plugin flags (prefs and delete)

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

Offline

#711 2012-09-10 14:28:34

Nate Mc
New Member
Registered: 2012-08-04
Posts: 6

Re: yab_shop (simple textpattern shop with paypal support)

I am developing a website for a florist so i needed to rewrite part of the yab_shop_core and admin to allow buyers enter in the name and address of where they want their flowers to be sent. Everything works fine if i use the purchase on delivery as it sends an affirmation email to the customer and the admin with all the details. However I now want to use paypal, but the affirmation mail doesn’t send as Trenc has said in a previous reply to a similar post:

An email will not be sent if the payment methods are Google checkout or Paypal checkout for the following reasons: If an customer is on the third party payment page (say Paypal) and he decide not to finish the order so I have no feedback from Paypal this time about the cancel of the order. So it would be logical Paypal would manage the customer and admin order mails. But Paypal does not. :(

Is there anyway i can change this to send an affirmation email (at least to the admin) even if the order is not completed. I am a little bit stuck. Any help at all would be greatly appreciated.

{Added bq. for quote display. – Uli}

Last edited by uli (2012-09-10 14:58:45)

Offline

#712 2012-09-10 14:53:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Nate Mc wrote:

Is there anyway i can change this to send an affirmation email (at least to the admin) even if the order is not completed.

In theory, a plugin such as smd_ipn (ask me if you’d like a copy) would be able to do this if the user cancels the request and yab_shop has set up the cancel_return field. However:

  • yab_shop does not currently set this variable (although it could be added to prefs easily enough)
  • there is no guarantee that a person on the PayPal site doesn’t just close the tab (or browser), without clicking the ‘Cancel’ button, thus nulling the transaction without paying or sending an IPN

So it’ll always be a bit nebulous in the same way that if you ask users for a shipping address in the yab_shop checkout form, and the user logs into PayPal with their PayPal username/password, then the shipping details they entered in the yab_shop checkout form are ignored — the ones used will be the ones set in their PayPal account. If, however, they opt to use credit/debit card payments, the details from the yab_shop checkout form are presented as pre-filled content in the PayPal shipping details box and they’re prompted for any additional (missing) items. Go figure.

The upshot is, there’s no way to rely on any info in the yab_hop checkout form, but if you want to at least have a shot at it, smd_ipn is probably the closest you’ll get as you can at least send a confirmation e-mail on success/cancel if the user goes through with the transaction.

The other way to do it would be to send off a “pre-confirmation” message to a nominated admin e-mail account that a user intends to buy the product. If the transaction goes through and an IPN confirmation is received then you know it’s gone through OK. If not, the user has cancelled for some reason (or something went wrong) and you at least have their details so you can (tactfully!) inquire why they didn’t place the order, under the guise of “improving the site experience for our customers” :-)

I think both options will require some code changes though. Hope that helps.

Last edited by Bloke (2012-09-10 14:55:21)


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

Txp Builders – finely-crafted code, design and Txp

Offline

#713 2012-09-10 15:29:55

Nate Mc
New Member
Registered: 2012-08-04
Posts: 6

Re: yab_shop (simple textpattern shop with paypal support)

wow ok, thanks so much for the reply. I would dearly love a copy smd_ipn, have you got any documentation on how it works?
I like the other way of doing it, the sending off a pre-confirmation message, I can always let the website owner know that its an ‘intention of purchase’ note and not to send off the flowers until he gets something through from paypal. Do you have any ideas on how i can send off an email like this?
Thank you so much for your fast reply, this is why the textpattern community is the best… FACT!

Offline

#714 2012-09-10 16:08:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Nate Mc wrote:

I like the… ‘intention of purchase’ note… Do you have any ideas on how i can send off an email like this?

Not without a few hacks to the code. In my mashed-up version of the plugin there’s a callback for that purpose so you can run custom functions on checkout, but it’s not in the official v0.81 that trenc just released. Probably not impossible to add it, but maintaining two branches is awkward enough. Discussing ways forward with trenc.

Thank you so much for your fast reply, this is why the textpattern community is the best… FACT!

Why thank you. My/our pleasure. You got mail, btw.


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

Txp Builders – finely-crafted code, design and Txp

Offline

#715 2012-09-10 21:36:16

Nate Mc
New Member
Registered: 2012-08-04
Posts: 6

Re: yab_shop (simple textpattern shop with paypal support)

Im really stuck now, for some reason im not able to get the data which is sent back from paypal (im using the sandbox feature). Im starting to doubt myself really badly, the website is http://www.sunflorist.co.uk. If you have any way of helping me I WILL BUY YOU A BEER!! (Hope that’s incentive enough :D). Basically you have an option to fill in an extra section called ‘sendto’ however paypal doesnt seem to like this new section and misses it out entirely. Which is ok, however not so much ok when the admin doesn’t receive the yab_shop affirmation mail.

Offline

#716 2012-09-10 22:15:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Nate Mc wrote:

you have an option to fill in an extra section called ‘sendto’

OK, how are you adding that extra field to the checkout? The PayPal API only accepts a defined set of variables so yab_shop needs to tell PayPal how to transport it safely and umangled through its innards.

In my hacked plugin version I have a callback which allows you to insert an extra field, and it spirits that through PayPal — transparently — via a variable named custom. Quite how you achieve this with the official yab_shop plugin I don’t know. Once that value is passed through, it’s available in the IPN data block that PayPal sends you, so you can extract it the other end and do something with it.

As far as I could make out from PayPal’s shaky docs, that’s the only custom variable allowed. Everything else has a defined usage and is inappropriate for this type of application. If you can crack that nut and at least get the data packaged up into the PayPal data block sent to the portal, you’re 80% of the way there.

In terms of getting IPN working from the sandbox, have you managed to get the plugin to fire successfully after following the setup hoops that PayPal makes you jump through (as detailed in the plugin help)? There’s only a limited amount of help I can offer in this case because having access to your PayPal account is against the Ts and Cs. The best I can do is to advise on using the plugin itself once you manage to coerce PayPal into forwarding IPN data to the nominated Textpattern Section or Page. If you think it’d help, feel free to send me a Textpattern login and I’ll see what I can do once you have the PayPal side sending stuff.

Last edited by Bloke (2012-09-10 22:15:55)


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

Txp Builders – finely-crafted code, design and Txp

Offline

#717 2012-09-11 09:10:57

Nate Mc
New Member
Registered: 2012-08-04
Posts: 6

Re: yab_shop (simple textpattern shop with paypal support)

Happy Days! It lives! I actually went down the road of an intent to purchase email. This is sent when you click the purchase/order button, the user is sent to paypal to finish the order while the admin receives an email (and they know to wait until they get a paypal confirmation email before they do anything). Now Mr Dawson I believe I owe you a beer (or some flowers sent from this website :D) Or even a bottle of wine for you and the missus. Thank you so much for your help, if you would like a copy of my hacked to hell code then id be more than happy to send.

Offline

#718 2012-09-11 10:31:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Nate Mc wrote:

Happy Days! It lives!

Excellent.

I actually went down the road of an intent to purchase email… if you would like a copy of my hacked to hell code then id be more than happy to send.

Please do. Myself or trenc can then review it and fold the concept into the plugin (probably as a callback so it’s more generically applicable).

Now Mr Dawson I believe I owe you a beer (or some flowers sent from this website :D) Or even a bottle of wine for you and the missus. Thank you so much for your help

Too kind, thank you for the offer. But you did all the work, so there’s no need (unless you feel suitably compelled, in which case there’s my wish list :-) Glad you got it sorted and I could help out a bit.


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

Txp Builders – finely-crafted code, design and Txp

Offline

#719 2012-11-07 00:10:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

In the interestes of public scrutiny after this post, and because I’ve been such a slacker with bringing my shop hacks to market I’ve put my version of yab_shop under git.

Please don’t use it on a production site yet. Although it’s been working fine in a live environment of my own for the past six months, the plugin was developed in situ so the mods have been incremental. I don’t know exactly how a cold turkey upgrade from v0.8.0 will go, although I can tell you that any customisations you made to the plugin strings will be wiped out. Backup backup backup, and just disable the previous version so you can restore things if necessary. The plugin sorely needs some way to integrate both MLP and a Textpack so the strings can be removed from the code itself. Any thoughts (or code!) for this welcome.

Also, trenc’s latest v0.8.1 fixes and improvements have not been integrated yet. If anybody wishes to merge the changes then please do so and I’ll commit them to the master branch.

Over time I hope that trenc and I (and anyone else) can work on this plugin to make it even more of an absolute corker for e-commerce.


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

Txp Builders – finely-crafted code, design and Txp

Offline

#720 2012-11-07 15:00:59

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: yab_shop (simple textpattern shop with paypal support)

Yeah cool i can then make modification and put it on github for others!

Offline

Board footer

Powered by FluxBB