Textpattern Forum

You are not logged in. Register | Login | Help

#651 2012-02-12 10:50:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#652 2012-02-13 05:32:46

hidalgo
Member
From: Australia
Registered: 2008-02-05
Posts: 49
Website

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#654 2012-02-14 00:51:31

hidalgo
Member
From: Australia
Registered: 2008-02-05
Posts: 49
Website

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
Website

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

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.

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
Website

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

trenc
Plugin Author
From: Cologne
Registered: 2008-02-27
Posts: 508
Website

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

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

Board footer

Powered by FluxBB