[TYPO3-commerce] Force payment method selection

Morten Olesen mo at idefa.dk
Wed Feb 18 08:20:07 CET 2009


Hey Rik

No I mean that you insert a blank option when onload/domready fires

ala.

var newOpt=document.createElement('option');
newOpt.text='--select one--';
newOpt.value=-1;
var paySelect=document.getElementById('id goes here');

try{
	paySelect.dd(newOpt,pySelect.options[0]);
}catch(ex){
	paySelect.add(newOpt,0);
}

or easier still use jquery ^^

ofcourse the very simplest solution would be to simply create a payment 
method with the name '--select one--';

and then have the form validation refuse to submit the form when that is 
select.

hope it helped.

/Morten Olesen

Rik Willems wrote:
> Hi Morten,
> 
> I think that won't be very user friendly. One of the two solution is 
> always selected. Than the javascript would ask whether thas the right 
> selection with ok and cancel. People will tend to just click it away. 
> I'd like a real forced choice. Inserting into the core isn't that big a 
> change.
> 
> Cheers!
> 
> Morten Olesen schreef:
>> Hey Rik,
>>
>> Just use the quick and "dirty" solution - a javascript formvalidation.
>>
>>
>> /Morten
>>
>> Rik Willems wrote:
>>> Hi Hartmut,
>>>
>>> Thank you for look into it. The defaultPaymentArticleId is set in the 
>>> constants or setup. Unsetting it didn't help. I looked into the 
>>> source and found that there is no empty option created at all. I 
>>> think I'd be a  good option to add.
>>>
>>> If all goes well in getting the project I'll write it into the core 
>>> and submit. Where do I have to do this?
>>>
>>> Regards,
>>>
>>> Rik
>>>
>>> hartmut wrote:
>>>> Hi rik,
>>>>
>>>> I can't give you specific help because I don't use payment options 
>>>> at all.
>>>> But a very useful tool for all questions concerning the setup of 
>>>> commerce is the TS object browser.
>>>> When searching for the phrase "payment" I saw this in my setup:
>>>>
>>>> plugin.tx_commerce_pi2.defaultPaymentArticleId = 1
>>>>
>>>> So maybe unsetting this could do something.
>>>>
>>>> Good Luck
>>>> hartmut
>>>>
>>>>
>>>> Rik Willems schrieb:
>>>>> Hi all,
>>>>>
>>>>> I'm new to commerce extension but can already see that it's a great 
>>>>> extension. Good work, thank you! For a new client I'm asked to make 
>>>>> changes to his website, a challenge I'm looking forward to.
>>>>>
>>>>> Please excuse me if my first question here is 'dumb' one, but I 
>>>>> can't find anything about it and hope you are willing to help. The 
>>>>> shop now has two payment methods, of which one is automatically 
>>>>> selected from a typoscript id. But, this means the customer can 
>>>>> just click 'next' and order on prepayment. We like to force the 
>>>>> customer to make a choice, so he has to select one of the two, the 
>>>>> default is blank. Is that possible?
>>>>>
>>>>> Looking forward to your responses.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Rik


More information about the TYPO3-project-commerce mailing list