Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#613 2011-11-14 10:45:50

Kreeltje
Member
Registered: 2008-12-23
Posts: 21

Re: yab_shop (simple textpattern shop with paypal support)

Hello you all!

I’m trying to get an order overlook before the definitive checkout, also is it possible to send the order confirmation mail in html format so i can edit the confirmation email?

Offline

#614 2011-11-16 13:38:48

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Hi Kreeltje,

I’m trying to get an order overlook before the definitive checkout,

An additional step in the order process is not implemented.

also is it possible to send the order confirmation mail in html format so i can edit the confirmation email?

If you have some PHP knowledge you can edit the plugin code to send the mails as text/html.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#615 2011-11-16 13:44:04

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

Re: yab_shop (simple textpattern shop with paypal support)

Kreeltje wrote:

is it possible to send the order confirmation mail in html format

Woudn’t be hard to implement as a preference in the plugin.

so i can edit the confirmation email?

That’s trickier. The format is fixed right now. I suppose it could be changed so it uses the built-in mail message unless you specify (maybe) some Txp Form: you could put {replacement} tags in the places you want the values to go. I do that kind of thing for breakfast in all my plugins so it may be something I can add (or send to trenc to add).


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

#616 2011-11-17 16:08:55

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 251
Website

Re: yab_shop (simple textpattern shop with paypal support)

Men I just managed to get it right: just put the checkout tag within the shop_cart tag, like this:

<txp:yab_shop_cart>
  <txp:yab_shop_checkout />
</txp:yab_shop_cart>

Cheers

Last edited by Manaus (2011-11-17 17:03:03)

Offline

#617 2011-11-19 14:43:54

Saldacenkaw
Member
Registered: 2006-12-28
Posts: 30

Re: yab_shop (simple textpattern shop with paypal support)

Hi! Why my page is reloading if I add a cart? Last-Modified header is off and I use Jquery 1.6.1 .

And this I see in testing mode

tag_error <txp:yab_shop_price /> -> Warning: number_format() expects parameter 1 to be double, string given on line 1559

thnx!

Last edited by Saldacenkaw (2011-11-20 12:54:48)


I know, my english is horrible

Offline

#618 2011-11-20 17:38:34

adamgamb
New Member
Registered: 2011-11-20
Posts: 3

Re: yab_shop (simple textpattern shop with paypal support)

I can’t see any way to actually link the “Terms of Use” button to a proper terms of use page??? i.e. currently it just links to http://demoshop.yablo.de/index.php?s=tou . Seems bizarre there is no option to set this in preferences, but I can turn it On/Off!

Offline

#619 2011-11-20 18:51:19

Saldacenkaw
Member
Registered: 2006-12-28
Posts: 30

Re: yab_shop (simple textpattern shop with paypal support)

adamgamb wrote:

I can’t see any way to actually link the “Terms of Use” button to a proper terms of use page??? i.e. currently it just links to http://demoshop.yablo.de/index.php?s=tou . Seems bizarre there is no option to set this in preferences, but I can turn it On/Off!

.yab-shop-required tou {display:none;} in css


I know, my english is horrible

Offline

#620 2011-11-21 10:20:04

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Hi Saldacenkaw,

Hi! Why my page is reloading if I add a cart? Last-Modified header is off and I use Jquery 1.6.1 .

What do you mean with reloading?
If you add a product in your cart, then the page is reloaded? That’s normal, because adding a product is like sending a form (it’s not ajaxified). Or do you mean another issue?

tag_error <txp:yab_shop_price /> ->  Warning: number_format() expects parameter 1 to be double, string given  on line 1559

You must write prices in decimal. So if a product will costs €12, so write the price as 12,00 or 12.00, then it should work.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#621 2011-11-21 10:24:45

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_shop (simple textpattern shop with paypal support)

Hi, adamgamb,

I can’t see any way to actually link the “Terms of Use” button to a proper terms of use page??? i.e. currently it just links to http://demoshop.yablo.de/index.php?s=tou . Seems bizarre there is no option to set this in preferences, but I can turn it On/Off!

You can find the text (and the link) for the TOU label in the »Yab_Shop L10n«. You have to look for »Checkout label for TOU«.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#622 2011-11-21 11:30:04

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

Re: yab_shop (simple textpattern shop with paypal support)

Here’s a conundrum, and I think it relates to my problems with the name/address details not being passed to PayPal. They actually are, but PayPal only uses the info in some circumstances.

Currently, First & Last names, Street, City, Zip, E-mail and (optionally) State are designated required in the yab_shop checkout form. This is fine if you are offering purchase on account / on delivery / on prepayment, but of limited use with PayPal.

When you reach PayPal’s payment gateway page, you can choose to either:

  1. log in with your PayPal account. In this case your PayPal address details are used and the ones on the yab_shop checkout form are ignored.
  2. pay by debit/credit card. In this case the shipping address details from the yab_shop checkout form are used in the PayPal form. Any you do not supply are presented as input boxes for you to fill in before proceeding.

In the first case, having the fields as required inputs means you have (possibly) wasted someone’s time — ignoring the fact that the info is stored as a cookie to save you typing them in future. They do not need to enter shipping details.

In the 2nd case, PayPal will prompt for shipping details if they are not encoded in the button used to submit the cart contents, so it could be argued that it’s not necessary for them to be required on the shop site.

With this particular implementation I’m pursuing now I’ve allowed people to optionally create a Txp account at the checkout page. Any details they supply are stored in their bio. If they don’t put anything in they could fill it out later with a mem_self_register profile edit form. Even in this case, it may suit people to say that they want to create an account on our site, but they don’t want to fill their address in just yet.

So I’m leaning more towards making all the fields on the checkout form optional. This is reasonably easy in the code (just find the |r when it pertains to a field that is either displayed or read back in, and remove it; also removing the yab-shop-required class if necessary). The question is whether it’s the right thing to do for ALL transactions by hacking the code, or if the required fields should be user-definable from the yab_shop prefs page.

Anybody got any thoughts on this? Have I missed a use case where it is vital that the address details are required? For example, what happens if you try to buy on account and there’s no address data supplied? Perhaps the optional/required state could be set depending on the payment method? (although that creates a real headache when submitting the form as the field name is potentially different).

One possible avenue of exploration is the HTML5 required="required" attribute. If the inputs used that, it’s then down to the browser to enforce instead of yab_shop. The form processing in yab_shop is consequently simplified and the required/optional status of each field could be decided in the yab_shop prefs so it’s down to the application instead of the plugin to decide.

Any thoughts?

Last edited by Bloke (2011-11-21 11:30:34)


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

#623 2011-11-21 21:36:05

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

Re: yab_shop (simple textpattern shop with paypal support)

tag_error <txp:yab_shop_price /> ->  Warning: number_format() expects parameter 1 to be double, string given  on line 1559

trenc wrote:

You must write prices in decimal. So if a product will costs €12, so write the price as 12,00 or 12.00, then it should work.

Hi trenc.
While currently learning & configuring this plugin, I’m getting the same error, even if I write the price as 12,00 or 12.00.
Error message goes away if I set website’s production status to Live, but I’m not sure that would avoid any potential issue propagatin, as yab_shop internal code may still evaluate that the price is wrongly written.


… a little more time researching…

OK, it seems that the error goes away also if I apply this little mod to function yab_shop_currency_out:

function yab_shop_currency_out($currency, $what, $toform = '')
{

	// MOD: make sure that the "string" is properly converted into a "double" (float) value
	$toform = floatval($toform);
	// END MOD
	switch ($currency)
	{
...

Trenc, as you seem to be confident that inputting the price using commas or dots should fix the issue, I’m not sure why that proposed solution didn’t work for me.

Also, I’m not sure at all if the mod I suggested above covers every possible place where this issue/error may pop up. And less sure if it opens or not another can of worms :)

So, a comment by you on this will really help to achieve some peace of mind :)

Tanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#624 2011-11-21 22:15:26

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

Re: yab_shop (simple textpattern shop with paypal support)

maniqui

If it’s any consolation I applied this very similar mod to my copy today, in exactly the same place you did:

$toform = (double)$toform;

The net effect is the same — casting the value to a double, or converting the value to a float using floatval().

I haven’t tested my version yet but I’m pretty sure it works and I would guess (might be wrong: this is PHP after all!) that casting is a nano quicker because it doesn’t involve a function call opcode or the stack.

EDIT: incidentally I think the warning also rears its head if the combined value of things in your cart works out to an exact integer value. Not sure, just a hunch. But either way the mod above covers it because everything calls that function prior to display.

Last edited by Bloke (2011-11-21 22:18:25)


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

Board footer

Powered by FluxBB