Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#649 2012-02-08 16:30:02
Re: yab_shop (simple textpattern shop with paypal support)
progre55 wrote:
I need to add a dropdown box to the form.
What form? You should have control over what options you display by using the cart / checkout as a container. If you mean on the ‘add to cart’ side of things, you specify product variants in custom fields and the drodown boxes are automatically populated. What input are you trying to capture?
all
As has become apparent from recent forum posts, trenc has taken a back seat on this excellent plugin for the time being. Perhaps when Txp 5 comes along it can be rewritten, but for now he has given me his blessing to take over day-to-day maintenance (need to get my site in order before I can host it).
Although I’ve still got a few things to track down, I’ve begun work on making the next version generally usable by adding an upgrade section which makes the necessary DB changes and stuff. I’ve rolled it into a single 4000+ line monstrosity plugin and I’ll go through the help at some point to document the new stuff.
Because of MLP support, there’s no need for the yab_shop language tab any more — even for those people not runninng MLP. The downside is that the upgrade will reset the strings back to the ones in the plugin — some of them have actually changed quite drastically with dynamic {values}
inserted into them depending on the configuration of other settings.
I’m thinking about how to to handle this properly — perhaps with Textpacks — so your strings remain and only new ones are added. Or perhaps it advises you of which ones are different and allows you to choose the ones to overwrite on upgrade. But since I have no “old” v.0.8.0 shop I’ve no place to test such an upgrade.
Bet you can see what’s coming: willing volunteers please to test out an upgrade in a non-production database so it doesn’t really matter if the plugin stomps on your strings.
To reiterate, at the moment there’s no yummy migration path for plugin strings so if you have a blank slate, the new plugin will work fine and you may request a beta copy once I’ve done the docs. This is just a heads-up for people wanting to upgrade existing shops: I’d love to have someone try it out when I’ve written the code to manage the string migration. And of course, if anyone can think of a neat way to manage single-language strings on upgrades, please let me know.
The good news is that once on v0.90, most of the strings are more generic and don’t have hard-coded numbers in any more so they should function like regular strings and can safely be updated (if necessary) in future versions. The only places where things get a little hairy are in strings like “This text will be on the end of the admin mail”. This is partly solved with the new admin e-mail Forms so you can entirely customise an e-mail template and you can thus elect not go near the language table. Ideas on what to do in this grey area welcome.
Anyway, I’ll post more as I have it.
Last edited by Bloke (2012-02-08 16:30:32)
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
#650 2012-02-11 23:15:44
Re: yab_shop (simple textpattern shop with paypal support)
Thinking aloud, hope anyone coould confirm some thoughts/findings:
On a website currently running v0.8.0, client noticed that order/affirmation emails weren’t arriving to shop admin nor to buyer, respectively.
I skimmed over the code and find, at function yab_shop_checkout
, that order/affirmation emails are only sent in the case that the payment methods aren’t PayPal or Google Checkout.
After a little WTF moment, I got to understand that this is a logic/expected way to work. In other words, it will be probably wrong, from a usability POV, to be sending emails during the checkout process but before the buyer confirming the purchase (i.e. doing the payment) via PayPal or Google Checkout. This would be wrong, for example, if after doing the checkout (hitting the checkout button in form and being redirected to PayPal) the buyer decides not to do the purchase. By that time, emails (wrongly) confirming purchase would have been already sent.
I suppose that’s where PayPal IPN (and so, smd_ipn) could enter the game & help to improve both buyer & seller experience (buyer getting some extra confirmation with the details of the purchase, and seller too).
Are these thoughts correct?
Thanks!
Offline
#651 2012-02-12 10:50:47
Re: yab_shop (simple textpattern shop with paypal support)
maniqui wrote:
Are these thoughts correct?
Yes. Also, I believe PayPal and Google checkout send their own confirmation e-mails so it would inundate the recipient with mails if we were to do so as well (possibly erroneously if they cancel the purchase). At least, that’s how I see it.
smd_ipn does indeed complete the loop. At least, in the case of PayPal. I have not had time to dive into Google’s API to find out if smd_ipn could actually be expanded to hook into Google’s processing system too. The plea still stands for anybody who does have experience with Google Chckout to give me a nudge and let me know it’s worth my while to pursue it.
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
#652 2012-02-13 05:32:46
Re: yab_shop (simple textpattern shop with paypal support)
I’m hoping someone can help me with the following possible product option bug.
If a user selects a product option of 0
(zero), for example Size: 0
, the option isn’t recored when the item is added to the cart. If the option is 00
, or 1
etc. it’s added to the cart correctly.
I’ve tried looking through the code, but haven’t been able to work out how to fix it. Any help would be much appreciated.
Offline
#653 2012-02-13 17:41:17
Re: yab_shop (simple textpattern shop with paypal support)
hidalgo wrote:
If a user selects a product option of
0
(zero)… the option isn’t recored when the item is added to the cart.
Confirmed bug. Squashed in the next version, thanks.
The essence of it is that PHP thinks that ‘0’ means ‘empty’. Thus if you want to fix it now, the way round it is to find anything in the code that uses empty
and if it’s a test that references the property_N elements, replace it with an explicit test as follows.
Replace constructs that resemble this:
if ( !empty($product_ps_1[1]) )
With:
if ($product_ps_1[1] != '')
And if the empty()
test doesn’t start with the negation operator !
you can use the positive test instead, using ==
like this:
if ($item['property_1'] == '')
That should be it. I’ve done that in the code wherever empty()
has been used and there’s a possibility that the input might contain a 0
: in some places it makes sense to keep empty()
, but in most cases when dealing with user input, the !=''
or ==''
is safer to avoid bugs like you found.
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
#654 2012-02-14 00:51:31
Re: yab_shop (simple textpattern shop with paypal support)
Thanks heaps Stef, I’ve corrected the code and it’s now working as expected.
Also, I’m happy to help test the string upgrades for the next version as mentioned in your earlier post.
Offline
#655 2012-02-17 15:08:42
- inkywillow
- Member
- From: France
- Registered: 2009-12-22
- Posts: 37
Re: yab_shop (simple textpattern shop with paypal support)
Hi all, I hope that somebody can help out here (winks in Stef’s general direction). I used this plugin on a website that I built a while back for my cousin. She has just come back and asked if it is possible to add a “where did you hear about us” drop-down select field to the checkout and make it required. Is this possible?
If you go to www.outoflove.co.uk, add an item to the cart and then click “checkout”, I would like to add the new field between the “message” text area and where it says “I have read the Terms and Conditions!”.
Any takers???
Tom
Last edited by inkywillow (2012-02-17 15:15:06)
The Design Works – Freelance website designer
Offline
#656 2012-02-17 15:45:21
Re: yab_shop (simple textpattern shop with paypal support)
inkywillow wrote:
add the new field between the “message” text area and where it says “I have read the Terms and Conditions!”.
The good news is that the new plugin has a callback checkout_cart_postamble
which allows you to add fields to the end of the form. Can’t remember exactly where it occurs — might be after the Terms of Use checkbox — but even if it is you can just insert the field with jQuery instead.
The downside at the moment is I’m not sure about the ‘required’ part. There’s a new option that allows you to nominate fields that are required but it’s currently limited to the fields that ship with the plugin. It’s not a bad idea to extend that to permit third party fields to be selected so I might relax that restriction and permit you to set our own fields as required. I’ll look into it, thanks.
For the time being, I wonder if adding required
to your custom <input>
tag will be enough in the current crop of browsers. I think most of them honour that as long as you’re using an HTML5 doctype, flashing up a box around the fields that aren’t completed (or something). Not sure it works for select lists though…
Of course, all this is dependent on the new plugin version. Getting there…
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
#657 2012-02-17 16:12:40
- inkywillow
- Member
- From: France
- Registered: 2009-12-22
- Posts: 37
Re: yab_shop (simple textpattern shop with paypal support)
Thanks for replying so quickly Stef.
I’ll take that as a no for now then. I had hoped that it might be possible to hack the old plugin’s source code. I don’t want to go to the trouble of upgrading the plugin at present, but it sounds like it’s going to be good. :)
The Design Works – Freelance website designer
Offline
#658 2012-02-27 18:51:17
- rsrc
- New Member
- Registered: 2012-01-25
- Posts: 9
Re: yab_shop (simple textpattern shop with paypal support)
I just set up yab_shop following these directions – http://www.yablo.de/article/404/howto-an-faq-about-the-textpattern-shopping-cart-plugin-yab_shop
I am adding code to an existing article form to add the price and ‘add to cart’ functionality as follows:
<div id=“addtocart”>
<p>Price: <txp:yab_shop_custom_field name=“Price” /></p>
<txp:yab_shop_add /></div>
The price does not show up however so I feel like somehow I must be missing something, I’ve gone through this thread to make sure that I have the field name spelled the same way in config and in the form.
Any suggestions?
Thanks,
rori
Offline
#659 2012-02-28 12:40:44
Re: yab_shop (simple textpattern shop with paypal support)
Hi rori,
I just set up yab_shop following these directions – http://www.yablo.de/article/404/howto-an-faq-about-the-textpattern-shopping-cart-plugin-yab_shop
I’m sorry. This howto is a bit outdated. Please use the plugin help.
<txp:yab_shop_custom_field name=“Price” />
is deprecated. Since version 0.8 you must use
<txp:yab_shop_price />
See the plugin help for further details.
trenc
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
#660 2012-02-28 18:58:25
- rsrc
- New Member
- Registered: 2012-01-25
- Posts: 9
Re: yab_shop (simple textpattern shop with paypal support)
Hi Tommy,
Thanks for that tip. I changed it, but the price is still not visible. I’m wondering if it matters that I put <yab_shop_cart /> in a sidebar form rather than directly in the section page template itself.. I’m not sure if that could be causing problems, although the ‘add to cart’ button does seem to work and update the number of items in the cart.
Here’s the page in question:
http://www.skol.ca/fr/salle-de-lecture/livraison-9
the add to cart is at the bottom of the page, cart is in the sidebar.
Offline