Franz Holzinger

Verse of the day

Derhalben müßt ihr auch Schoß geben; denn sie sind Gottes Diener, die solchen Schutz handhaben. So gebet nun jedermann, was ihr schuldig seid: Schoß, dem der Schoß gebührt; Zoll, dem der Zoll gebührt; Furcht, dem die Furcht gebührt; Ehre, dem die Ehre gebührt.
Roemer 13:6-7

© Bible Gateway's Verse of the Day


autor  
22-02-11 22:47:26 1 basket for 2 sysfolder?
Julia Pekkonen
Necessary to organize a single basket for the entire site.
site, there are 2 large sections with different settings tt_products.
Each section has its own page with a LIST view,
its storage products (sysfolder1 and sysfolder2) and its page with the BASKET.
Explicit instructions for both sections of one basket for some reason does not work:
plugin.tt_products.PIDbasket = pid_of_basket1
Only products from the first section of the site fall into this basket (pid_of_basket1),
Products featured in the second section are still fall into the basket (pid_of_basket2),
in spite of these for this section is important:
plugin.tt_products.PIDbasket = pid_of_basket1
I realized that it depends on the parameter pid_list = pid_of_sysfolder.
Now, for each of the sections I have these settings:
For the first - pid_list = pid_of_sysfolder1
For the second - pid_list = pid_of_sysfolder2.
When I try to specify for one of the sections as follows:
pid_list = pid_of_sysfolder1, pid_of_sysfolder2
Then on the page with LIST see products from two sysfolder, but when you add to cart they all fall into one basket (what you want!).
However, I have to show content sysfolder separately.
Maybe I could help while filtering products by categories, but unfortunately the list categories of goods from the first and second section may be supplemented by the website editor.
What could be wrong?
Thank you in advance.
23-02-11 10:50:41 pid_list
Franz Holzinger
Set the pid_list to
pid_list = pid_of_sysfolder1, pid_of_sysfolder2
Then the basket will show the products of both sysfolders.

Or you can use also the starting point which will overwrite the settings of pid_list for only that shop plugin.

The same will be for the LIST plugin. Just set the starting point to the sysfolder you want to show in the Front End.
23-02-11 12:53:53 Yes, it's work!
Julia Pekkonen
Thanks Franz!
It's really work for me. I set to both section pid_list = pid_of_sysfolder1, pid_of_sysfolder2 AND set in page with shop plugin (LIST) "Record Storage Page" to each sysfolder. And all work properly!
Also I need to solve another 2 problems with basket and all will be ok! Maybe you could give me hint?
1. I need setup limit for total items in basket. As I understand it's not realised now in shop?
2. I can't set requiredInfoFields. When I write in setup: "requiredInfoFields = email" it's doesn't work and I see error after fill email and pressed next.
23-02-11 13:28:41 basket limit
Franz Holzinger
1. You can use basketMaxQuantity. However this is the maximum amount for one item only. More is not yet possible.
2. requiredInfoFields is only in setup, not in constants
23-02-11 14:20:55 requiredInfoFields
Julia Pekkonen
Yes I try to use SETUP.
Maybe problem due to the fact that I fill email placed in this part of template: ###BASKET_TEMPLATE### instead ###BASKET_INFO_TEMPLATE###?
I need fill only email (it's enough for me).
23-02-11 14:48:42 BASKET_INFO
Franz Holzinger
The BASKET_INFO should be used where the address data is filled in. Otherwise it could create much confusion.



23-02-11 22:46:01 BASKET_INFO
Julia Pekkonen
Thanks for answer. I tried use BASKET_INFO but with same results :(
Maybe problem with other thing?
I need that user fill one of two parts of form:
1. Just email
2. Email, phone, and date.
In both case after pressed NEXT-button user must be show next step (confirmation). I create this possibility with two submit-button in my form:
<!-- ###BASKET_INFO_TEMPLATE### begin
...
<form method="post" action="###FORM_URL###" name="basket" class="basketForm" id="registrationForm">
<input type="text" name="recs[personinfo][email]" size="15" value="###PERSON_EMAIL###" title="Ihre E-Mail" class="basket_fields"/>
<input type="submit" id="button4" name="products_payment" value="Absenden" onclick="document.forms[0].action='###FORM_URL_FINALIZE###';"/>
<input name="recs[delivery][desired_date]" size="15" value="###DELIVERY_DESIRED_DATE###" title="Ihr Wunschtermin" class="basket_fields" id="timepicker"/>
<input type="text" name="recs[personinfo][email]" size="15" value="###PERSON_EMAIL###" title="Ihre E-Mail"class="basket_fields"/>
<input type="text" name="recs[personinfo][telephone]" size="15" value="###PERSON_TELEPHONE###" title="Telefon" class="basket_fields"/>
<input type="submit" id="button5" name="products_payment" value="Absenden" onclick="document.forms[0].action='###FORM_URL_FINALIZE###';"/>
</form>
... <!-- ###BASKET_INFO_TEMPLATE### end -->
Maybe something wrong with this and tt_products don't understood what I need?
24-02-11 09:37:53 problematic JavaScript
Franz Holzinger
You have some problematic JavaScript in your HTML shop template:

"document.forms[0].action"

This only works if there is only one form on the page.
It is recommended to use 'getElementById('formName').action' instead of this, where 'formName' must be the name of the form which shall be submitted.
24-02-11 12:41:29 2 email fields
Julia Pekkonen
Thanks, I changed my template, but no results.
I think that I have other problem.
When I filled email field in 2nd part of my form (where also phone and date fields, but I leave them empty) - it's enough and I see confirmation page.
When I try fill email in 1st part of my form - I see problem with required fields. It's maybe because in one form I have 2 same fields with same name and same value? I mean both email fields! I don't understand how I need create this form for my target...
Thanks for your support!
24-02-11 17:55:30 HTML Form
Franz Holzinger
It is allowed to have the same field names in a HTML form. Only the tag id must be unique.
Each form must be complete and have its own submit button.

There must be a detail in the required fields error message.
<!-- ###BASKET_REQUIRED_INFO_MISSING### begin -->
Something is wrong: ###ERROR_DETAILS###
<!-- ###BASKET_REQUIRED_INFO_MISSING### end -->
24-02-11 20:33:50 HTML Form
Julia Pekkonen
You mean ID of DIV (in template not defined id of input):
<div id="field_PERSON_EMAIL">
<input type="text" name="recs[personinfo][email]" size="15" value="###PERSON_EMAIL###" title="Ihre E-Mail" class="basket_fields"/>
</div>
I need that user selected what he will fill: only email or email & other info, but in any case all entered information must be accept in shop.
25-02-11 08:37:23 requiredInfoFields
Franz Holzinger
You shall make the requiredInfoFields dependant on the form where the user has entered the values.
Add a hidden field with a different value 'formnumber' to each form.
Then use the TypoScript conditions to make a decision on the form.

[globalVar = GP:formnumber = 1]
requiredInfoFields = email
[globalVar = GP:formnumber = 2]
requiredInfoFields = email, telephone

[global]
26-02-11 13:41:43 formnumber
Julia Pekkonen
You mean that in BASKET_INFO_TEMPLATE I must create 2 forms (formnumber = 1, formnumber = 2)?
It's will be ok to tt_products?
Both forms must have same action="..."?
26-02-11 14:35:16 2 forms
Franz Holzinger
Yes, you create 2 different and independant forms on the BASKET_INFO page. And you use 2 hidden fields, one for each form. So you can decide, which of the 2 forms has been submitted.
The action can be the same, only the getElementById parameter of the action must be different.

3-03-11 12:15:32 Sorry, but it doesn't work...
Julia Pekkonen
Hi Franz. I'm very sorry, but I can't create your idea with 2 forms...
But with setting 2nd form (with date, phone, email) now doesnt'work too (error "please fill all required fields...")
If you have several minutes, please look at my code (see bellow). Do not leave me alone with tt_products! :)
I place tt_products with "Basket: input customer data" bellow "Basket" on basket page. Create TS code in setup (after main tt_products settings):
[globalVar = GP:formnumber = 1]
plugin.tt_products.requiredInfoFields = email
[globalVar = GP:formnumber = 2]
plugin.tt_products.requiredInfoFields = email, telephone
[global]
And template:
<!-- ###BASKET_INFO_TEMPLATE### begin
Subpart used if the GPvar "products_info" was set. This is normally used to let people enter address information separately from the real basket
Exact same features as BASKET_TEMPLATE
-->

<form method="post" action="###FORM_URL###" name="basket1" class="basketForm" id="registrationForm1">
<div id="label_PERSON_EMAIL">
<p>Als E-Mail<br />verschicken1</p>
</div>
<div id="field_PERSON_EMAIL">
<input type="text" name="recs[personinfo][email]" size="15" value="###PERSON_EMAIL###" title="Ihre E-Mail" class="basket_fields"/>
<input type="hidden" name="formnumber" size="30" id="billing_name" value="1" />
<input type="submit" id="button4" name="products_payment" value="Absenden" onclick="getElementById('basket1').action='###FORM_URL_FINALIZE###';"/>
</div>
</form>

<form method="post" action="###FORM_URL###" name="basket2" class="basketForm" id="registrationForm2">
<div id="label_DELIVERY_DESIRED_FORM">
<p>Beratungstermin<BR /> vereinbaren1</p>
</div>
<div id="DELIVERY_DESIRED_DATE_FORM">
<div id="field_DELIVERY_DESIRED_DATE">
<input name="recs[delivery][desired_date]" size="15" value="###DELIVERY_DESIRED_DATE###" title="Ihr Wunschtermin" class="basket_fields" id="timepicker"/>
</div>
<div id="field_PERSON_EMAIL">
<input type="text" name="recs[personinfo][email]" size="15" value="###PERSON_EMAIL###" title="Ihre E-Mail"class="basket_fields"/>
</div>
<div id="field_PERSON_TELEPHONE">
<input type="text" name="recs[personinfo][telephone]" size="15" value="###PERSON_TELEPHONE###" title="Telefon" class="basket_fields"/>
<input type="hidden" name="formnumber" size="30" id="billing_name" value="2" />
<input type="submit" id="button5" name="products_payment" value="Absenden" onclick="getElementById('basket2').action='###FORM_URL_FINALIZE###';"/>
</div>
</div>
</form>
<!-- ###BILLING_ADDRESS### end-->
<!-- ###BILLING_ADDRESS_LOGIN### start
If this part is not empty then this will be used instead of BILLING_ADDRESS if there is a FE-login user.-->


<!-- ###BILLING_ADDRESS_LOGIN### end-->
<!--
###GW1B###<strong>Kreditkarte:</strong>###GW1E###
###PERSON_CARDS_CC_TYPE###
<input name="recs[creditcard][cc_number]" value="###PERSON_CARDS_CC_NUMBER###" />
-->

<!-- ###BASKET_INFO_TEMPLATE### end -->
3-03-11 13:37:07 bug in JavaScript
Franz Holzinger
Kölle Alaaf Julia!

There is a bug in JavaScript:

<input type="submit" id="button4" name="products_payment" value="Absenden" onclick="getElementById('basket1').action='###FORM_URL_FINALIZE###';"/>
...
getElementById must have the id of the form!

<input type="submit" id="button4" name="products_payment" value="Absenden" onclick="getElementById('registrationForm1').action='###FORM_URL_FINALIZE###';"/>

And the second form must have:

<input type="submit" id="button5" name="products_payment" value="Absenden" onclick="getElementById('registrationForm2').action='###FORM_URL_FINALIZE###';"/>


And there is another issue:

id="billing_name"

You have used the same tag id twice. This must however be unique.
3-03-11 14:18:39 No results :(
Julia Pekkonen
Hi. I'm sorry for my inattention, but with your correction I have same result. In both forms - error after pressed "Absenden"...
How can I determine exactly where a bug in HTML or TS?
<form method="post" action="###FORM_URL###" name="basket1" class="basketForm" id="registrationForm1">
<div id="label_PERSON_EMAIL">
<p>Als E-Mail<br />verschicken1</p>
</div>
<div id="field_PERSON_EMAIL">
<input type="text" name="recs[personinfo][email]" size="15" value="###PERSON_EMAIL###" title="Ihre E-Mail" class="basket_fields"/>
<input type="hidden" name="formnumber" size="30" value="1" />
<input type="submit" id="button4" name="products_payment" value="Absenden" onclick="getElementById('registrationForm1').action='###FORM_URL_FINALIZE###';"/>
</div>
</form>

<form method="post" action="###FORM_URL###" name="basket2" class="basketForm" id="registrationForm2">
<div id="label_DELIVERY_DESIRED_FORM">
<p>Beratungstermin<BR /> vereinbaren1</p>
</div>
<div id="DELIVERY_DESIRED_DATE_FORM">
<div id="field_DELIVERY_DESIRED_DATE">
<input name="recs[delivery][desired_date]" size="15" value="###DELIVERY_DESIRED_DATE###" title="Ihr Wunschtermin" class="basket_fields" id="timepicker"/>
</div>
<div id="field_PERSON_EMAIL">
<input type="text" name="recs[personinfo][email]" size="15" value="###PERSON_EMAIL###" title="Ihre E-Mail"class="basket_fields"/>
</div>
<div id="field_PERSON_TELEPHONE">
<input type="text" name="recs[personinfo][telephone]" size="15" value="###PERSON_TELEPHONE###" title="Telefon" class="basket_fields"/>
<input type="hidden" name="formnumber" size="30" value="2" />
<input type="submit" id="button5" name="products_payment" value="Absenden" onclick="getElementById('registrationForm2').action='###FORM_URL_FINALIZE###';"/>
</div>
</div>
</form>
4-03-11 19:03:56 debug
Franz Holzinger
Install the Firebug Plugin for the Firefox browser. Then you can see, if the JavaScript is executed and which errors there are.

Install the 'Web Developer' Plugin for Firefox. The you have the context menu 'Web Developer' -> 'Tools' -> 'Validate HTML' to check the HTML validity.

Insert a debug statement into the PHP file, e.g in tt_products/control/class.tx_ttproducts_main.php

Install the extenion fh_debug.
Insert the debug statement:
debug ($_REQUEST, '$_REQUEST');
Enter your IP address in the EM for fh_debug.
Then have a look into the file fileadmin/debug.html.
Then you will know which data is sent by the HTML form.
5-03-11 12:12:42 Many thanks
Julia Pekkonen
Hi Franz. Many thanks for your support, now all working properly. I have more several question concerning tt_products, and I'll ask they on next week.
< Zurück zum Forum