Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#691 2012-06-24 10:17:52
Re: yab_shop (simple textpattern shop with paypal support)
Last edited by wornout (2012-06-24 10:20:29)
Offline
#692 2012-06-26 15:30:53
Re: yab_shop (simple textpattern shop with paypal support)
I couldn’t get rid of the common number_format() expects parameter 1 to be double, string given... on line xxx by setting “Send ‘Last-Modified’ header” to “no”, nor any of the other methods mentioned here before worked. After searching the error in general i found, though, that changing the line in question from
number_format($toform, 2, ',', '.')
to
number_format((double)$toform, 2, ',', '.')
gets rid of the error.
Just want to share this.
P.S.: My webhoster changed the server OS from Apache to Linux (edit: LiteSpeed), eventually this could be a reason for this behaviour? Unsure.
The error comes up oftenly in several different shop systems, so it might as well be connected to a PHP version upgrade.
Last edited by jayrope (2012-06-27 18:39:48)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#693 2012-06-26 15:38:46
Re: yab_shop (simple textpattern shop with paypal support)
jayrope wrote:
nor any of the other methods mentioned here before worked
Hmmm, I would have expected maniqui’s fix (or mine in the post after) to have solved it, but good that you fixed it. I may have to look at this again if my (cast) patch in the next version doesn’t work across the board.
Last edited by Bloke (2012-06-26 15:49:46)
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
#694 2012-06-26 15:41:44
Re: yab_shop (simple textpattern shop with paypal support)
@bloke: Thanx for the txp:variable suggestion. I now ended up having to rewrite a lot of the initial shop programming just for the special case of selling items, that exist just once, preferrably avoiding a whole set of new code and database tables which would only be dedicated to stock keeping.
I am also adding a more detailed checkout process following an idea similar to
-> edit cart
-> add address, email, payment method,
-> finally confirm all given information or jump back to edit
-> order
-> screen reprint of all given order data for the purpose of printing it to paper
each on subsequent pages.
Which gets me to: In what state is your version of yab_shop currently?
Very curious.
A hole turned upside down is a dome, when there’s also gravity.
Offline
#695 2012-06-26 15:45:41
Re: yab_shop (simple textpattern shop with paypal support)
Converting a variable type to another (string to double, in this example) is called a cast.
But in this case, it’s better to change
function yab_shop_currency_out($currency, $what, $toform = '')
into
function yab_shop_currency_out($currency, $what, $toform = 0.0)
Or, almost like maniqui did :
function yab_shop_currency_out($currency, $what, $toform = '')
{
$toform *= 1.0 ;
switch ($currency)
Apache is a webserver, Linux is the OS :)
Offline
#696 2012-06-26 15:46:45
Re: yab_shop (simple textpattern shop with paypal support)
jayrope wrote:
In what state is your version of yab_shop currently?
Functional and working well, but unreleasable until I get the plugin composer up to scratch so I can package up the yab_shop plugin with a textpack. If I release it as-is, everyone’s hard-crafted i18n strings will be trashed on upgrade, which is not good. You’re welcome to have a copy if you shoot me an email.
Lots of callbacks in it which might mean you can do the customisation you require in a companion plugin. And if you can’t, let me know where you want to make mods and I’ll put more callbacks in so you can :-)
Last edited by Bloke (2012-06-26 15:48:00)
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
#697 2012-06-26 15:51:00
Re: yab_shop (simple textpattern shop with paypal support)
@CeBe – sorry for the brain scatter (and your clarification): The web server runs LiteSpeed.
My coding skills are limited and improvised (though curious) – so any skilled insight helps. Thanx again.
A hole turned upside down is a dome, when there’s also gravity.
Offline
#698 2012-06-26 15:54:08
Re: yab_shop (simple textpattern shop with paypal support)
@ Bloke.
Thank you very much for the offer, i sent an email just now. Happy to provide as much feedback as possible.
Janek
A hole turned upside down is a dome, when there’s also gravity.
Offline
#699 2012-06-26 23:16:49
Re: yab_shop (simple textpattern shop with paypal support)
jayrope a écrit:
My coding skills are limited and improvised (though curious)
That’s a pretty good way to learn :)
Offline
#700 2012-06-27 18:33:29
Re: yab_shop (simple textpattern shop with paypal support)
Stef, thank you much for the code.
I wonder how to implement a very modular setup into yab_shop and would love to contribute, despite minor coding skills.
What i imagine is, that
- the cart display as well as the checkout process could be much more customizable in detail
example: cart displays any of the following in any user desired combination with separate stylable markup per entry:
item_name,
item_description
item_quantity (edible OR just display, respecting number in stock, see below),
item_delete,
item_price,
item_discount,
item_tax (another custom_field, if edible per item),
items_price_summary,
items_price_total,
client_address (edible OR just display),
client_contact (edible OR just display),
client_payment_option (edible OR just display),
cart_delete
(i probably forgot some)
That way we could customize anything between the smallest sidebar cart display and a full checkout process out of the same set of tags. Furthermore
- a simple form of stock keeping could be implemented, using a custom field containing the number of available items, counting down, when item got sold
- item could be reserved (automatically putting an “x” in custom_field “reserved”) or item article receiving a state change to “Pending” or whatever desired, when last item got sold, or upon manual editing of article.
I hope that wasn’t too much in one go, and how can i help to implement this?
A simple example on just one of the tags would help, i think i could go from there, even if developing just a companion plugin.
I sent this to your email, too. Please excuse subsequent data overflow :)
Last edited by jayrope (2012-06-27 18:44:03)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#701 2012-06-27 20:51:00
Re: yab_shop (simple textpattern shop with paypal support)
jayrope wrote:
a simple form of stock keeping could be implemented, using a custom field containing the number of available items, counting down, when item got sold
In addition to what I sent you via e-mail about the cart and checkout tags being containers (err, I think… haven’t checked) what you are after here is smd_ipn. It is a “listener” for completed PayPal transactions and allows you to run any custom code / tags of your choosing to do anything you like, e.g. update stock, store transactions, send off e-mail confirmations, deliver digital downloads, send off an smd_access_key to protected content. If you can dream it, you can do it. Plugin available on request at the moment, primarily because I haven’t got round to releasing it officially.
item could be reserved (automatically putting an “x” in custom_field “reserved”) or item article receiving a state change to “Pending” or whatever desired, when last item got sold, or upon manual editing of article.
That’s more tricky but I think the new callbacks would help you here as you could intercept the ‘add to cart’ action and change it to suit your needs.
Last edited by Bloke (2012-06-27 20:51:34)
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
#702 2012-06-28 14:49:24
Re: yab_shop (simple textpattern shop with paypal support)
Bloke wrote:
the cart and checkout tags being containers (err, I think… haven’t checked)
Apparently there isn’t enough customisable tags available inside those containers.
<txp:yab_shop_cart>
<txp:yab_shop_cart_item>
<txp:yab_shop_cart_item_name /> (<txp:yab_shop_cart_item_quantity />x = <txp:yab_shop_cart_item_price />
<txp:yab_shop_cart_item_delete />
</txp:yab_shop_cart_item>
<txp:yab_shop_cart_subtotal />
<txp:yab_shop_link_to_checkout />
</txp:yab_shop_cart>
is something i am thinking of. I managed to modify <txp:yab_shop_cart> so that i could do something similar to
<txp:yab_shop_cart_items_j showquantity="0" showquantity="1" showsubtotal="0" />
However, that approach doesn’t include editing the cart, which would be necessary put an item_delete button behind each item listed.
This feature only shows up in the checkout process.
Which gets me back to the modular construction i was trying to imagine in my earlier post.
This modular construction seems impossible without looking at the complete checkout process first for the purpose of merging the ability to ONLY display cart (as in the current <txp:yab_shop_cart />) but as well checkout data with the editing capabilities we currently only have in the checkout part, such as item_delete or item_change_quantity – or checkout_add_address etc.
Taking it all apart, putting everything possible into plugin tags individually accessible, provide full display and editing capability to the PHP-unsavy textpattern programmer.
How does that sound? What did i miss, which already provides features in that direction? smd_ipn?
Last edited by jayrope (2012-06-28 15:58:06)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#703 2012-07-26 07:13:33
Re: yab_shop (simple textpattern shop with paypal support)
Hi folks.
I’ve got some problems with accented characters send to Paypal website. Any idea how to correct it?
Thanks by advance.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#704 2012-07-30 13:29:09
Re: yab_shop (simple textpattern shop with paypal support)
… Really, no ideas ?
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#705 2012-07-30 17:13:21
Re: yab_shop (simple textpattern shop with paypal support)
Hi Patrick.
Have you checked PayPal documentation for hints?
You could try processing the strings with ut8_encode (at least, I fixed an issue with accented and special characters not being posted to Twitter via its API). rah_function plugin could be helpful for doing that.
Offline