Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#625 2011-11-23 06:37:11
- Saldacenkaw
- Member
- Registered: 2006-12-28
- Posts: 30
Re: yab_shop (simple textpattern shop with paypal support)
maniqui, thnx! it’s works.
trenc, maybe ajaxified form is better? I like it, but I can’t develop it )
I know, my english is horrible
Offline
#626 2011-11-25 05:01:14
Re: yab_shop (simple textpattern shop with paypal support)
I’m slowly learning the ins & outs of this plugin, while trying to implement it on a client’s website.
Please, could anyone explain me what these different payment methods mean?
- Purchase on account
- Purchase on delivery
- Purchase against prepayment
In any case, I think client will be using just Paypal, but I’d really like to know what this other payment concepts really are.
Thanks.
Offline
#627 2011-12-04 17:35:33
- Saldacenkaw
- Member
- Registered: 2006-12-28
- Posts: 30
Re: yab_shop (simple textpattern shop with paypal support)
somebody now, how can do ajaxified form? I found this (http://forum.textpattern.com/viewtopic.php?pid=228580#p228580), but it not work correctly.
It’s work (thnx Jan!)
$(document).ready(function(){
$('article > form').submit(function(){
var thisForm = $(this);
var url = thisForm.attr('action');
var url = url.substr(0,url.indexOf('#'));
var data = thisForm.serialize()+'&add=1';
$.post(url, data, function(content){
$('#topz').html(content);
});
return false;
});
});
Last edited by Saldacenkaw (2011-12-14 12:00:58)
I know, my english is horrible
Offline
#628 2011-12-15 11:46:00
Re: yab_shop (simple textpattern shop with paypal support)
It appears that there’s a problem with PayPal discarding product options (e.g. Size, Colour etc.) when a customer uses a mobile phone to pay for the order.
I’ve spent a good amount of time testing this today with a fresh TXP and yab_shop install, along with a PayPal sandbox account and think I’ve narrowed it down.
When PayPal detects that a customer is using a mobile phone, it automatically redirects the user to a ‘Mobile express checkout’ (cmd=_express-checkout-mobile) portal to process the payment and in the process discards the product options. The order email arrives with the product name and price, but is missing the product options.
Changing the browser User Agent to iPad or iPhone in Safari is enough to cause PayPal to redirect to the mobile portal which discards the product options. The exact same order using the default desktop User Agent arrives correctly as it always has.
I’ve looked through the PayPal developer documentation and PayPal preferences but can’t find anyway to disable the mobile redirect, or to stop the options from being discarded.
Is this happening to other sites using yab_shop? Maybe I’ve missing something obvious, or someone here has encountered this before and found a solution?
Update
It turns out that this is a current PayPal bug. Their response:
We are aware of this bug and are working towards a fix early in January. In the meantime you can add one of the unsupported parameters for mobile which should prevent the mobile view from being displayed. Please try to add the following to your script:
<INPUT TYPE="hidden" NAME="item_category" VALUE="Digital">
Last edited by hidalgo (2012-01-04 01:23:30)
Offline
#629 2011-12-20 11:06:13
- Saldacenkaw
- Member
- Registered: 2006-12-28
- Posts: 30
Re: yab_shop (simple textpattern shop with paypal support)
Hi! I posted js-source ajaxified form for yab_shop. But it have a trouble, POST go back all html-page. How make that POST return only cart-block?
I know, my english is horrible
Offline
#630 2011-12-30 22:01:39
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: yab_shop (simple textpattern shop with paypal support)
Group:
I think I have a simple and straight forward question — don’t most start that way — how using this plug in can I reorganize the form so that the title and field are on the same line so that it condenses the length —
progre55
Offline
#631 2012-01-04 16:42:27
Re: yab_shop (simple textpattern shop with paypal support)
As already stated previously, you can’t use <txp:yab_shop_cart></txp:yab_shop_cart>
twice in the same page, as it will mangle the maths when adding products, each tag outputting different quantities and subtotals.
Also, I’ve noticed these issues, related to the code order.
If I’ve something like this:
<!-- let's call this one "the widget" -->
<div>
<txp:yab_shop_cart_quantity output="all" break="" />
<txp:yab_shop_cart_subtotal break="" />
<txp:yab_shop_cart_link break="" />
<txp:yab_shop_cart_message break="" />
</div>
... more codez...
<!-- let's call this one "the list" -->
<txp:yab_shop_cart>
<txp:yab_shop_cart_items break="" />
</txp:yab_shop_cart>
When interacting with this page, this will happen:
- on adding a product,
- the widget: will stay almost unchanged: Quantity at 0, Subtotal at 0.00, but will show message “Product has been added” , while
- the list: will show the added product
- on trying to add a second product:
- the widget: same than previous action: will stay almost unchanged: Quantity at 0, Subtotal at 0.00, but will show message “Product has been added” , while
- the list: will show the added product, replacing the previously added one.
- on reloading page (or visiting any other page):
- the widget: will get reseted
- the list: will get reseted (emptied) too.
Now, the weird thing is that things will work properly with the following variations of the above code.
Variation 1: inverting the code order (list first, widget second)
<!-- "the list" -->
<txp:yab_shop_cart>
<txp:yab_shop_cart_items break="" />
</txp:yab_shop_cart>
... more codez...
<!-- "the widget" -->
<div>
<txp:yab_shop_cart_quantity output="all" break="" />
<txp:yab_shop_cart_subtotal break="" />
<txp:yab_shop_cart_link break="" />
<txp:yab_shop_cart_message break="" />
</div>
Both chunks of code will output the correct stuff.
Variation 2: removing some yab_shop tags from the widget
<!-- "the widget" -->
<div>
<txp:yab_shop_cart_message break="" />
</div>
... more codez...
<!-- "the list" -->
<txp:yab_shop_cart>
<txp:yab_shop_cart_items break="" />
</txp:yab_shop_cart>
As you can see, compared to the first example, I’ve removed <txp:yab_shop_cart_quantity>
, <txp:yab_shop_cart_subtotal>
and <txp:yab_shop_cart_link>
. It seems that only having the <txp:yab_shop_cart_message>
doesn’t trigger the issues stated on first example.
So, it seems that for things to work properly, <txp:yab_shop_cart>...</txp:yab_shop_cart>
has to come first in the page template, only exception is that you can use <txp:yab_shop_cart_message>
before it, without mangling things.
Offline
#632 2012-01-04 16:59:58
Re: yab_shop (simple textpattern shop with paypal support)
maniqui
Good sleuthing. I’ve found a couple of other places where using certain tag combos didn’t yield the expected results. I fixed those in my implementation so I’ll add these ones to the list to test as well.
I’ve not tried it your way because I’ve stuck to the standard list-first approach, but I’ll do some tests and see if I can figure out what’s going on, then add it to the pile of stuff to consider.
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
#633 2012-01-07 01:59:34
Re: yab_shop (simple textpattern shop with paypal support)
Good to know you have your coding fingers on it, Stef.
In the meanwhile, I’ve overcome this issue/limitation on a somewhat nasty & textpatternish way :)
I create these two widgets in the “right order” at the very top of the page templates, and I save each one inside a txp:variable. Then, I print the variables in the place I need them, overcoming the problem of them being in the “incorrect” order.
Offline
#634 2012-01-13 16:27:53
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: yab_shop (simple textpattern shop with paypal support)
maniqui/bloke (or anyone else)
Two questions:
(1) I need to add a dropdown box to the form. I have modified the form before — but only by adding new input fields —-
(2) Is there a way to take them so when they click add to cart they go directly to the checkout form —-
Thanks.
progre55
Last edited by progre55 (2012-01-13 16:30:24)
Offline
#635 2012-01-31 16:00:10
- tom1
- Member
- Registered: 2009-03-20
- Posts: 36
Re: yab_shop (simple textpattern shop with paypal support)
first of all, yab_shop seems like a a great plugin to go with my all time favourite CMS!
Since this thread is 64 pages long, i thought a recap of everything might be in a order for ‘newbies’ like me.
Trenc has listed small feature list on first page, which all seemed to work as should on my fresh install of 4.4.1 and 0.8.
Bloke, you mentioned on some page of this thread that you’ve hacked a shipping cost by weight – thingie, which sounds very good. In what state is that, can it be shared with others within yab_shop?
I would prefer saving orders to database, instead of only mailing them. In case mail dosen’t go thru, orders might get lost. This is not so important, but i see many benefits in having history of orders on admin side.
What about stock control? Not sure if i saw somebody mentioning it, but didn’t find anything on quick glance over to fresh yab_shop install.
Other thing, which is crucial in measuring targeted marketing, is multiple discount codes. I noticed that yab_shop supports only 1 code at the time, but the way i see it, its not very big thing to build. Does anybody have pointers which i should take in consideration when building concept of this?
The reason im asking about this is that i have 3 customers needing small but efficient webshop. I’ve done few with Zen Cart, and everytime promised myself i wouldn’t touch it again. I have about 10year php-background, and am ready to contribute to make yab_shop suitable for my and others’ needs. As i haven’t ever got familiar in making plugins for txp, its all a bit new to me.
Heres something for starters.
br,
Tom
Offline
#636 2012-01-31 16:33:35
Re: yab_shop (simple textpattern shop with paypal support)
tom1 wrote:
Bloke, you mentioned on some page of this thread that you’ve hacked a shipping cost by weight – thingie, which sounds very good. In what state is that, can it be shared with others within yab_shop?
Yes it works a treat as it’s live on a site I’m running. BUT you still have to paste the values into the tiny text box which is not very nice. It could do with a separate screen for defining stuff like this, or at very least a textarea.
While the plugin is working, it’s not what I’d call publicly releasable because there’s currently no upgrade path in the code. I’ve been modding tables as I go and noting down what’s been done so I can go back and add some MySQL ALTER TABLE commands somewhere to allow a smooth upgrade for people. Until that’s done (and I’ve found an excuse to test all the changes with Google Cart) then it’s a private playground.
Of course if you want to hop in and help then wow, yes please! Get in touch and I’ll share the code and the way to get it up and running.
For the record, here’s the list of changes I’ve made to date:
- Added MLP support (well, net-carver did 99.9% of this bit)
- Added callbacks (again, net-carver began the process here) :
- yab_shop_cart_add
- yab_shop_cart_item_update
- yab_shop_cart_remove
- yab_shop_on_checkout_empty_cart
- yab_shop_on_checkout; steps:
- paypal
- default,success
- default,failure
- default,partial;
- default,no_affirmation
- Added pluggable_ui callbacks:
- event: yab_shop; steps:
- checkout_cart_preamble
- checkout_cart_postamble
- checkout_form_preamble
- checkout_form_postamble
- event: yab_shop; steps:
- Added multiple tax bands
- Added shipping by weight
- Added country select list option
- Added RRP support for price custom field. Specify as: price|RRP
- Added yab_shop_price attributes:
type
(price/rrp/saving)raw
(to retrieve value without currency prefix)
- Permitted checkout fields to be optional — required fields are configurable form the prefs
- Permitted customisable body admin/affirmation e-mail via a Txp Form
- Affirmation e-mail no longer triggers required e-mail field (if missing, e-mailing is skipped)
- Fixed yab_shop_cart_quantity for standalone use
- Fixed ‘currency not double’ warning
- Fixed item_number_N being passed in encrypted paypal buttons
- Swapped merchant_return_link for return IPN var (still undergoing testing as it’s not quite working as expected: suspect that PayPal have changed their API, or I don’t understand it!)
I’ve not done multiple promo codes yet. Not rocket science, and I have a version (somewhere) that has discount tiers in it based on a customer’s ‘status’ (e.g. a Gold partner might receive a better discount than a Silver partner). I could try and fold one or both of those in at some point if it’s helpful.
I was also mulling over the idea of price breaks recently after I was contacted by someone who wanted them. It’s a great idea but I’ve not got my head round the best way to configure them, since it could be on a per-product basis (implies the breaks go in a custom field) or you could get a price break on total order value (e.g. 10% off if you order over $100; $25% off with orders over $500; free car with orders over $10000; etc). Or maybe both types at once(?), which gets very confusing. We already have “free shipping at $N” so that part of it is covered. Ideas on this welcome.
I would prefer saving orders to database, instead of only mailing them.
Then you’ll need the companion plugin smd_ipn which trips when a successful PayPal notification comes back. You can then trigger any custom code you like — update stock control tables, mail out stuff like digital downloads / orders, etc. I’m e-mailing a unique, one-time use smd_access_key out to anyone who has bought a downloadable product so they can click to get it within a week of ordering.
smd_ipn automatically logs all transactions so you can retrieve them later and reformat them, perhaps to give to your accountant (or you can make an admin-side dashboard — as I’m playing with — so they can log in and balance the books that way).
I think that’s about it for now. Any help you’re willing to give, please let me know.
Last edited by Bloke (2012-01-31 16:34:46)
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