Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#685 2012-06-09 08:20:13

thijs
Member
Registered: 2012-04-17
Posts: 39

Re: yab_shop (simple textpattern shop with paypal support)

thank you, that did the trick.

Offline

#686 2012-06-10 15:05:53

luigiclaudio
New Member
From: Costa Rica
Registered: 2012-05-23
Posts: 3

Re: yab_shop (simple textpattern shop with paypal support)

Thanks mate! Sorry for late reply.
Yea, more than happy to share how it was built. I’m planning for an update in the coming weeks in the attempt of enhancing the design and the code.

maniqui wrote:

Just chimed in to say: what a great website, Luigi Claudio!
Impressive use of responsiveness, pushState, & Textpattern, with a very nice design.
Hope you find some time to share some tricks you did there :)
If not, I’ll have to dig thru the website’s front-end code… P

Offline

#687 2012-06-20 16:57:48

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: yab_shop (simple textpattern shop with paypal support)

How can i implement a check in yab_shop, which tells me, if an item is already in the cart or not?

I want to replace an item’s “add to cart” button with “This item is already in your cart” as soon as someone has added the item to the cart, because i only sell unique items and have to hinder the customer to even accidentally press the add to cart button twice.

Thanx in advance!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#688 2012-06-21 16:09:07

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: yab_shop (simple textpattern shop with paypal support)

In checkout section I can’t update quantity or eliminate items.
What could be the problem?

Offline

#689 2012-06-21 16:20:55

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

Re: yab_shop (simple textpattern shop with paypal support)

wornout

In checkout section I can’t update quantity or eliminate items.

Have you put a <txp:yab_shop_cart output="none" /> in your checkout section?

jayrope

I don’t recall the plugin having any conditionals for this, but you might be able to make one using the txp:variable trick:

<txp:variable name="has_qty"><txp:yab_shop_cart_quantity break="" label="" /></txp:variable>

<txp:if_variable name="has_qty" value="0">
   <p>Product already in cart</p>
<txp:else />
   <txp:yab_shop_add />
</txp:if_variable>

(untested)


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

Online

#690 2012-06-21 17:47:22

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: yab_shop (simple textpattern shop with paypal support)

wornout wrote

In checkout section I can’t update quantity or eliminate items.

Bloke wrote:

Have you put a <txp:yab_shop_cart output="none" /> in your checkout section?

Also, try setting “Send Last-Modified header” setting to “No” in Textpattern’s advanced preferences.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#691 2012-06-24 10:17:52

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: yab_shop (simple textpattern shop with paypal support)

@maniqui, @bloke thanks, it works :-)

Last edited by wornout (2012-06-24 10:20:29)

Offline

#692 2012-06-26 15:30:53

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

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

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.

Txp Builders – finely-crafted code, design and Txp

Online

#694 2012-06-26 15:41:44

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

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

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

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.

Txp Builders – finely-crafted code, design and Txp

Online

Board footer

Powered by FluxBB