WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<!-- BEGIN cust_textfields_block --><tr id="{TR_ID}"> <td class ="mod_bakery_form_label_f">{LABEL}</td> <td><input type="text" class="{CSS_ERROR_CLASS}mod_bakery_form_input_f" name="{NAME}" value="{VALUE}" maxlength="{MAXLENGHT}" /></td></tr><!-- END cust_textfields_block -->
<!-- BEGIN cust_textfields_block --><tr id="{TR_ID}"> <td class ="mod_bakery_form_label_f">{LABEL}</td> <td><textarea type="text" class="{CSS_ERROR_CLASS}mod_bakery_form_input_f p{NAME}" name="{NAME}" value="" maxlength="{MAXLENGHT}">{VALUE}</textarea></td></tr><!-- END cust_textfields_block -->
.pcust_email, .pcust_confirm_email, .pcust_first_name, .pcust_street, .pcust_zip, .pcust_city {height:14px;}
tr#cust_last_name_text { vertical-align:top;}
if (strpos($field, 'last_name') !== false) { if (!preg_match('#^[A-Za-z'.$add_chars.' -]{1,50}$#', $value)) { $error_bg[] = $field; $errors[] = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_NAME']; } }
// Make array for the customer address form with state fieldif ($setting_state_field == "show") { if ($setting_zip_location == "end") { // Show zip at the end of address $cust_info = array("cust_email" => $MOD_BAKERY['TXT_CUST_EMAIL'], "cust_confirm_email" => $MOD_BAKERY['TXT_CUST_CONFIRM_EMAIL'], "cust_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "cust_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "cust_tax_no" => $MOD_BAKERY['TXT_CUST_TAX_NO'], "cust_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "cust_city" => $MOD_BAKERY['TXT_CUST_CITY'], "cust_state" => $MOD_BAKERY['TXT_CUST_STATE'], "cust_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "cust_country" => $MOD_BAKERY['TXT_CUST_COUNTRY'], "cust_phone" => $MOD_BAKERY['TXT_CUST_PHONE']); $length = array("cust_email" => "50", "cust_confirm_email" => "50", "cust_first_name" => "50", "cust_last_name" => "50", "cust_tax_no" => "20", "cust_street" => "50", "cust_zip" => "10", "cust_city" => "50", "cust_state" => "50", "cust_phone" => "20"); } else { // Show zip inside of address $cust_info = array("cust_email" => $MOD_BAKERY['TXT_CUST_EMAIL'], "cust_confirm_email" => $MOD_BAKERY['TXT_CUST_CONFIRM_EMAIL'], "cust_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "cust_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "cust_tax_no" => $MOD_BAKERY['TXT_CUST_TAX_NO'], "cust_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "cust_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "cust_city" => $MOD_BAKERY['TXT_CUST_CITY'], "cust_state" => $MOD_BAKERY['TXT_CUST_STATE'], "cust_country" => $MOD_BAKERY['TXT_CUST_COUNTRY'], "cust_phone" => $MOD_BAKERY['TXT_CUST_PHONE']); $length = array("cust_email" => "50", "cust_confirm_email" => "50", "cust_first_name" => "50", "cust_last_name" => "50", "cust_tax_no" => "20", "cust_street" => "50", "cust_zip" => "10", "cust_city" => "50", "cust_state" => "50", "cust_phone" => "20"); }}// Make array for the customer address form w/o state fieldelse { if ($setting_zip_location == "end") { // Show zip at the end of address $cust_info = array("cust_email" => $MOD_BAKERY['TXT_CUST_EMAIL'], "cust_confirm_email" => $MOD_BAKERY['TXT_CUST_CONFIRM_EMAIL'], "cust_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "cust_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "cust_tax_no" => $MOD_BAKERY['TXT_CUST_TAX_NO'], "cust_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "cust_city" => $MOD_BAKERY['TXT_CUST_CITY'], "cust_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "cust_country" => $MOD_BAKERY['TXT_CUST_COUNTRY'], "cust_phone" => $MOD_BAKERY['TXT_CUST_PHONE']); $length = array("cust_email" => "50", "cust_confirm_email" => "50", "cust_first_name" => "50", "cust_last_name" => "50", "cust_tax_no" => "20", "cust_street" => "50", "cust_zip" => "10", "cust_city" => "50", "cust_phone" => "20"); } else { // Show zip inside of address $cust_info = array("cust_email" => $MOD_BAKERY['TXT_CUST_EMAIL'], "cust_confirm_email" => $MOD_BAKERY['TXT_CUST_CONFIRM_EMAIL'], "cust_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "cust_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "cust_tax_no" => $MOD_BAKERY['TXT_CUST_TAX_NO'], "cust_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "cust_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "cust_city" => $MOD_BAKERY['TXT_CUST_CITY'], "cust_country" => $MOD_BAKERY['TXT_CUST_COUNTRY'], "cust_phone" => $MOD_BAKERY['TXT_CUST_PHONE']); $length = array("cust_email" => "50", "cust_confirm_email" => "50", "cust_first_name" => "50", "cust_last_name" => "50", "cust_tax_no" => "20", "cust_street" => "50", "cust_zip" => "10", "cust_city" => "50", "cust_phone" => "20"); }}
I will post here my results Smiley
1) Since all fields were converted to small textareas, they have the sizing box option activated, which doesn't look ok and can lead to confusion with customers trying to add more text into the fields. I tried adding box-sizing:none; to the frontend.css but it didn't work. How can I get rid of the box sizing on those fields?
.pcust_email, .pcust_confirm_email, .pcust_first_name, .pcust_last_name, .pcust_zip, .pcust_city {height:16px;resize: none;}
Hello, could someone please tell me if it's possible to fix the above mentioned problems, as the solution provided by Jacobi won't work because Bakery won't accept the address when the customer hits the [enter] key.
if (strpos($field, 'street') !== false) { if (!preg_match('#^[\sA-Za-z0-9'.$add_chars.' +&-]{1,500}$#', $value)) { $error_bg[] = $field; $errors[] = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_STREET']; } }
// If all fields correct, write into db foreach ($_POST as $field => $value) { if ($field != 'summary' && $field != 'cust_confirm_email') { $field = $admin->add_slashes(strip_tags($field)); $value = $admin->add_slashes(strip_tags($value)); $updates[] = "$field = '$value'"; } }
// If all fields correct, write into db foreach ($_POST as $field => $value) { if ($field != 'summary' && $field != 'cust_confirm_email') { $field = $admin->add_slashes(strip_tags($field)); $value = $admin->add_slashes(strip_tags($value)); $value = nl2br($value); $updates[] = "$field = '$value'"; } }
// Join customer first and last name$cust_name = $cust_first_name." ".$cust_last_name;
// Join customer first and last name$cust_name = $cust_first_name." ".$cust_last_name;$cust_street = nl2br($cust_street);
if (strpos($field, 'street') !== false) { if (!preg_match('#^[\sA-Za-z0-9'.$add_chars.' áéíóúñÑ+&-]{1,500}$#', $value)) { $error_bg[] = $field; $errors[] = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_STREET']; } }
.pcust_email, .pcust_confirm_email, .pcust_first_name, .pcust_last_name, .pcust_zip, .pcust_city, .pcust_phone, .pship_first_name, .pship_last_name, .pship_city, .pship_zip {height:16px; resize:none;}
<!-- BEGIN ship_textfields_block<tr id="{TR_ID}"> <td class ="mod_bakery_form_label_f">{LABEL}</td> <td><textarea type="text" class="{CSS_ERROR_CLASS}mod_bakery_form_input_f p{NAME}" name="{NAME}" value="" maxlength="{MAXLENGHT}">{VALUE}</textarea></td></tr>END cust_textfields_block -->
2) Then in form.htm I changed the ship textfield blocks so it now looks like this:Code: [Select]<!-- BEGIN ship_textfields_block<tr id="{TR_ID}"> <td class ="mod_bakery_form_label_f">{LABEL}</td> <td><textarea type="text" class="{CSS_ERROR_CLASS}mod_bakery_form_input_f p{NAME}" name="{NAME}" value="" maxlength="{MAXLENGHT}">{VALUE}</textarea></td></tr>END cust_textfields_block -->I just tried repeating what you told me for the shipping address but it wasn't as easy as I hoped, what did I do wrong?
<!-- BEGIN ship_textfields_block --><tr id="{TR_ID}"> <td class ="mod_bakery_form_label_f">{LABEL}</td> <td><textarea type="text" class="{CSS_ERROR_CLASS}mod_bakery_form_input_f p{NAME}" name="{NAME}" value="" maxlength="{MAXLENGHT}">{VALUE}</textarea></td></tr><!-- END ship_textfields_block -->
// Join customer first and last name $ship_name = $ship_first_name." ".$ship_last_name;
// Join customer first and last name $ship_name = $ship_first_name." ".$ship_last_name; $ship_street = nl2br($ship_street);
if (strpos($field, 'street') !== false) { if (!preg_match('#^[\s"\,\$\&\A-Za-z0-9'.$add_chars.' áéíóúñÑ+-]{1,500}$#', $value)) { $error_bg[] = $field; $errors[] = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_STREET']; } }
$cust_address = str_replace("<br>", "\r\n", $cust_address);$cust_address = str_replace("<br />", "\r\n", $cust_address);$ship_address = str_replace("<br>", "\r\n", $ship_address);$ship_address = str_replace("<br />", "\r\n", $ship_address);
if ($customer['invoice'] != '') { // Convert string to array $invoice = stripslashes($customer['invoice']); $invoice_array = explode('&&&&&', $invoice); // Email vars to replace placeholders in the email body $setting_shop_name = $invoice_array[1]; $bank_account = $invoice_array[2]; $cust_name = $invoice_array[3]; $cust_email = $invoice_array[7]; $shop_email = $invoice_array[10]; $address = $invoice_array[11]; $cust_address = $invoice_array[12]; $ship_address = $invoice_array[13]; $item_list = $invoice_array[14]; $cust_tax_no = $invoice_array[15]; }
$cust_address = str_replace("<br>", " \r\n", $cust_address);
$MOD_BAKERY['ADD_REGEXP_CHARS'] = '';
$MOD_BAKERY['ADD_REGEXP_CHARS'] = 'ÃÀÂÃÄÅáà âãä寿ÇçČÄÃðÉÈÊËéèêëÃÌÎÃÃìîïÑñÓÒÔÕÖØóòôõöøŒœÞþÚÙÛÜúùûüŠšßßýÿŽžÂ';