Jump to content
ArtcoInc

Purchase without account for 2.3.4 and BS2334

Recommended Posts

Hello Paul @@perinq,

 

The state drop down menu shows in a standard (no modifications) create account page and elsewhere only if a state no match error occurs, this is you filled in a state which doesn't match any state stored in the database for the selected country.

If it shows on the first page load in your store, it means that a state drop down menu add-on has been added - installed in your store.

In order to get the same on the PWA account page you need to add the same modifications to the code in this page. If you do not know/remember the add-on, you may get it added just comparing both files (create_account.php and account_pwa.php) and apply the code changes to account_pwa.php.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

Which addon  should i use for osc 2.3.3.4?


If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

Hello,

 

I have a trouble with this contribution, the customer account aren't deleted after checkout.

 

I tried with "Offer set password to guest" true and false

      // do things if a guest comes from checkout success
      if ( tep_session_is_registered('customer_is_guest') && isset($navigation->snapshot) && $navigation->snapshot['page'] == 'checkout_success.php' ) {
        if ( defined('MODULE_CONTENT_PWA_LOGIN_KEEP_ACCOUNT') && MODULE_CONTENT_PWA_LOGIN_KEEP_ACCOUNT == 'True' && 
             basename($PHP_SELF) == 'account.php' && strpos($messageStack->output('account'), 'alert-success') ) { 
          // Unregister and remove guest from customers table if password is successful set
          tep_session_unregister('customer_is_guest');
          tep_db_query("update customers set customers_guest = '0' where customers_id = '" . (int)$customer_id . "'");
        } elseif ( basename($PHP_SELF) != 'download.php' && basename($PHP_SELF) != 'set_password.php' && substr(basename($PHP_SELF), 0, 8) != 'checkout' ) {
          // else delete guest account
 	  tep_db_query("delete from customers where customers_id = '" . (int)$customer_id . "' and customers_guest = '1'");
          tep_db_query("delete from address_book where customers_id = '" . (int)$customer_id . "'");
          tep_db_query("delete from customers_info where customers_info_id = '" . (int)$customer_id . "'");
  
          tep_session_unregister('customer_default_address_id');
          tep_session_unregister('customer_first_name');
          tep_session_unregister('customer_country_id');
          tep_session_unregister('customer_zone_id');
          tep_session_unregister('customer_id');
          tep_session_unregister('customer_is_guest');
        }
 
      }

$navigation->snapshot['page'] shows current page or previous page? I think my troubles comes from this variable (for a mod).

 

The customer are delete in checkout_success.php or in the next visited page?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

@@PiLLaO,

 

in the next visited page (if he doesn't tick the "keep account" option).

$navigation->snapshot['page'] shows previous page.

Share this post


Link to post
Share on other sites

Ok, I think that I have something that block the set_snatshop to checkout_success.php and customer aren't deleted.

 

I continue searching,

 

Thanks!!

Share this post


Link to post
Share on other sites

I drop on top the modified files and new files on a fresh install, active header tags modules and login without account form, with Offer set password to guest as true

 

But when I finish an order y click to continue, customer still in BBDD.

 

I don't know where look now :\

 

I'm getting mad :wacko:

Share this post


Link to post
Share on other sites

Hola Gustavo @@PiLLaO,

 

Do you see the customer flagged as guest in admin/customers and the order flagged as guerst order in admin/orders??

Share this post


Link to post
Share on other sites

Hola Gustavo @@PiLLaO,

 

The guest orders are flagged in the cm_cs_pwa_products_purchased.php module. Please make sure you are using that content module instead of the core module in the checkout_success page.

The related code lines are:

      if (tep_session_is_registered('customer_is_guest')){
        $navigation->set_snapshot();
        // flag guest order
        tep_db_query("update orders set customers_guest = '1' where customers_id = '" . (int)$customer_id . "'");

You also could check if the session parameter "customer_is_guest" gets correct registered during checkout process.

 

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

This is the problem, I don't install this module, I thinked that isn't important :( Sorry

 

Thanks for all!!

Gustavo

Share this post


Link to post
Share on other sites

I have been playing around with the latest version of this (PWA for BS 2.4 r1),, and the latest version of 234 BS Edge.

 

I seldom visit the Orders page in admin, but rather work through the dashboard. I like to be able to quickly see how many orders have been through the guest checkout -vs- by registered customers. So, I just did a quick edit of the orders dashboard file to display a check mark for guest orders.

 

post-327952-0-65565200-1494625042_thumb.jpg

 

In case anyone is interested ...

 

/admin/includes/modules/dashboard/d_orders.php

<?php
/*
  $Id$

  Modified for:
  Purchase without Account for Bootstrap
  Version 2.4 BS
  by @[member=raiwa]
  info@[member=oscaddons.com]
  www.oscaddons.com
  all credits to @deDocta

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

  class d_orders {
    var $code = 'd_orders';
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

    function __construct() {
      $this->title = MODULE_ADMIN_DASHBOARD_ORDERS_TITLE;
      $this->description = MODULE_ADMIN_DASHBOARD_ORDERS_DESCRIPTION;

      if ( defined('MODULE_ADMIN_DASHBOARD_ORDERS_STATUS') ) {
        $this->sort_order = MODULE_ADMIN_DASHBOARD_ORDERS_SORT_ORDER;
        $this->enabled = (MODULE_ADMIN_DASHBOARD_ORDERS_STATUS == 'True');
      }
    }

    function getOutput() {
      global $languages_id;

      $output = '<table border="0" width="100%" cellspacing="0" cellpadding="4">' .
                '  <tr class="dataTableHeadingRow">' .
                '    <td class="dataTableHeadingContent" width="20"> </td>' .
                '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_ORDERS_TITLE . '</td>' .
                '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_ORDERS_TOTAL . '</td>' .
                '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_ORDERS_DATE . '</td>' .
                '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_ORDERS_ORDER_STATUS . '</td>' .
                '  </tr>';

      $orders_query = tep_db_query("select o.customers_guest,
                                           o.orders_id,
                                           o.customers_name,
                                           greatest(o.date_purchased, ifnull(o.last_modified, 0)) as date_last_modified,      
                                           s.orders_status_name,
                                          ot.text as order_total
                                    from " . TABLE_ORDERS . " o,
                                         " . TABLE_ORDERS_TOTAL . " ot,
                                         " . TABLE_ORDERS_STATUS . " s
                                    where o.orders_id = ot.orders_id
                                      and ot.class = 'ot_total'
                                      and o.orders_status = s.orders_status_id
                                      and s.language_id = '" . (int)$languages_id . "'
                                    order by date_last_modified desc limit 6");

      while ($orders = tep_db_fetch_array($orders_query)) {
        $output .= '  <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .
                   '    <td class="dataTableContent" align="lefy">' .

                          ($orders['customers_guest'] == '1' ? tep_image('images/icons/tick.gif') : '') .

                   '    </td>' .

                   '    <td class="dataTableContent"><a href="' . tep_href_link('orders.php', 'oID=' .
(int)$orders['orders_id'] . '&action=edit') . '">' . tep_output_string_protected($orders['customers_name']) . '</a></td>' .
                   '    <td class="dataTableContent">' . strip_tags($orders['order_total']) . '</td>' .
                   '    <td class="dataTableContent">' . tep_date_short($orders['date_last_modified']) . '</td>' .
                   '    <td class="dataTableContent">' . $orders['orders_status_name'] . '</td>' .
                   '  </tr>';
      }

      $output .= '</table>';

      return $output;
    }

    function isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('MODULE_ADMIN_DASHBOARD_ORDERS_STATUS');
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Orders Module',
'MODULE_ADMIN_DASHBOARD_ORDERS_STATUS', 'True', 'Do you want to show the latest orders on the dashboard?', '6', '1',
'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order',
'MODULE_ADMIN_DASHBOARD_ORDERS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
    }

    function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) .

"')");
    }

    function keys() {
      return array('MODULE_ADMIN_DASHBOARD_ORDERS_STATUS', 'MODULE_ADMIN_DASHBOARD_ORDERS_SORT_ORDER');
    }
  }
?>

HTH

 

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

I am sorry for my bad english. But below I repeat it in Spanish in case there is any translation error.

I have a problem with the phone field, if I leave the field blank it gives an error and that is correct, but if I only indicate 1 single digit does not verify if it is correct or not, it simply follows the process. I have established that the minimum is 9 digits so if I only indicate 1 should give error and does not give it.

In other pages it does not happen, only in account_pwa, in other pages if it does not reach the minimum error.

This happens from the first moment, it is not new now,
at least since version 2.2r2 is the one I am currently using. The version 2.4r1 does not convince me to insist that the customer write a comment about the product that just bought, I have never used that option and I will not start using it now, I have disabled since 2008.

It also happens that the registered customer loses the session at the end of the purchase process, but I do not care, I prefer that the registered client loses the session at the end of the purchase process to the unregistered client continue as a registered client without deleting his Account at the end of the purchase process, for me it is more urgent to solve the field telephone, a field necessary for messaging.

----------------------------------------------

Ahora en español, por si hubiera algún error en la traducción.

Tengo un problema con el campo teléfono, si dejo el campo en blanco da error y eso es correcto, pero si sólo indico 1 único dígito no verifica si es correcto o no, simplemente sigue el proceso. Tengo establecido que el mínimo sean 9 digitos por lo que si sólo indico 1 debería dar error y no lo da.

En otras páginas no ocurre, sólo en account_pwa, en otras página si no llega al mínimo da error.

Esto ocurre desde el primer momento, no es nuevo de ahora, por lo menos desde la versión 2.2r2 que es la que estoy usando actualmente. La versión 2.4r1 no me convence por lo de insistir en que el cliente escriba un comentario sobre el producto que acaba de comprar, nunca he usado esa opción y no voy a empezar a usarla ahora, la tengo deshabilitada desde 2008.

También ocurre que el cliente registrado pierde la sesión al finalizar el proceso de compra, pero no me importa, prefiero que el cliente registrado pierda la sesión al finalizar el proceso de compra a que el cliente sin registrar continúe como cliente registrado sin que se elimine su cuenta al finalizar el proceso de compra, para mi es mas urgente solucionar el campo teléfono, un campo necesario para los envíos por mensajería.

Share this post


Link to post
Share on other sites

Hola Alfonso @reflex-ocasion,

Don't worry, we for sure apreciate you effort posting in english.

1. The form validation which seems you are still using and which was included in earlier 2.3.4 BS versions, has been removed already some time ago in 2.3.4 BS and therefore also in the PWA add-on in the account_pwa.php. Javascript form validation is considered obsolete. But the php validation for the telephone length is exact the same in account_pwa.php like in create_account.php, so the error message should be displayed after form submission and no incorrect phones should be saved in a customer account.

Anyway if you like to use the old  javascript validation in the pwa_account.php file, just compare to your create_account.php and copy these lines into the same place:

  require('includes/form_check.js.php');

2. The customer reviews support for guests introduced in v2.4, is an option, there is no obligation for the shop owner to install the support, and there is no obligation for the customer to leave a review if the support is installled.

It says " A link to review the purchased products can be OPTIONAL added ..." Optional => Opcional, use if you wish, no obligation.

The same for the option to offer guests to create a regular account on checkout success, it's OPTIONAL

So there is no reason not to update.....

3. I just checked once again with your version 2.2r2 and yes, it had the bug you explain, regular customers are logged out on checkout_success.php

This has been solved in version 2.3, so please update to the latest version.

 

kind regards

Rainer

Share this post


Link to post
Share on other sites

1. About 1 year ago I use the BS EDGE version. The Javascript validation format has not been used since. I think I did not even use it with version 2.3.4.

2. I had seen that it was optional but ... I forgot! :blush:

3. I will reinstall version 2.4r1 and will be more aware of the options to disable them. If I remember correctly from the first test I did, the registered client did not lose the session. I do not know, I do not remember.

Regarding other previous contacts, I was right about one thing, in my stores there was something that was badly installed (it was configuration) that caused, among other things, that the wholesale price (SPPC Lite) did not come out in its correct place. Now it works properly.

There is a Spanish phrase that says "look for the 3 feet to the cat". In osCommerce it means that you seek to solve the problems by editing files when the simplest thing is to change the configuration from the admin. That instead of leaving the first one that comes out the second. That instead of leaving to the right you leave to the left. Etc etc. It is module configuration, not file editing. In spite of knowing it, it happened to me. :blush:

 

Well, in 1 hour I inform you if the new version works well. I think I remember that. :biggrin:

Share this post


Link to post
Share on other sites

Well ... it works halfway.

The registered customer does not lose the session and that is fantastic. The bad thing is that the telephone field remains the same, just enter 1 digit and give it as valid and continue the process.:sad:

In order for the registered client to not lose the session, it must be in true of modules->content->cm_cs_pwa_products_purchased. If you change it to false the unregistered client continues as if it were registered and your account is not deleted when you press to exit or to expire your session.

This was already version 2.2r2, not a novelty.

Share this post


Link to post
Share on other sites
7 hours ago, reflex-ocasion said:

Well ... it works halfway.
. The bad thing is that the telephone field remains the same, just enter 1 digit and give it as valid and continue the process.:sad:

@reflex-ocasion,

I didn't say that this point will be fixed by the update. I said that the php validation check is exact the same like in create_account.php. It works for me and that part of code has never been changed in account_pwa.php. If it doesn't work in your store it should be due to your store installation/configuration or any modification you applied.

If it works in create account, just compare pwa_account.php with your create_account.php. The relevant code is this:

    if (GUEST_CHECKOUT_TELEPHONE == 'True'){
      if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
        $error = true;

        $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
      }
    }

 

7 hours ago, reflex-ocasion said:

In order for the registered client to not lose the session, it must be in true of modules->content->cm_cs_pwa_products_purchased. If you change it to false the unregistered client continues as if it were registered and your account is not deleted when you press to exit or to expire your session.

This was already version 2.2r2, not a novelty.

Yes, of course, if you refer to disable the module, PWA will not work correct, what do you expect. All 3 modules of PWA (login, header tag and checkout success) need to be installed and enabled.

All Add-ons need to be complete installed to work properly :ohmy:

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

I'm installing "HTML emails" @Gergely addon (https://forums.oscommerce.com/topic/399712-html-emails/)

In checkout_process.php this contribution replace code that uses PWA addon.

The code replaced is:

// lets start with the email confirmation
    $email_order = STORE_NAME . "\n" .
                   EMAIL_SEPARATOR . "\n" .
                   EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                   EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                   EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

  // PWA guest checkout
    echo $OSCOM_Hooks->call('pwa', 'PwaCheckoutMailMod');

    if ($order->info['comments']) {
      $email_order .= tep_db_output($order->info['comments']) . "\n\n";
    }
    $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
                    EMAIL_SEPARATOR . "\n" .
                    $products_ordered .
                    EMAIL_SEPARATOR . "\n";

    for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
      $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
    }

    if ($order->content_type != 'virtual') {
      $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
                      EMAIL_SEPARATOR . "\n" .
                      tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
    }

    $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                    EMAIL_SEPARATOR . "\n" .
                    tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
    if (is_object($$payment)) {
      $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
                      EMAIL_SEPARATOR . "\n";
      $payment_class = $$payment;
      $email_order .= $order->info['payment_method'] . "\n\n";
      if (isset($payment_class->email_footer)) {
        $email_order .= $payment_class->email_footer . "\n\n";
      }
    }
    tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

  // send emails to other people
    if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
      tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
    }

for this code:

// lets start with the email confirmation
$oscTemplate->getContent('email_checkout_process');

The HTML Emails addons move the code replaced to includes/modules/pages/

if I put $OSCOM_Hooks in the "HTML email" module function... would the $OSCOM_Hooks work? or I need to make another thing?

I hope I have explained

Gustavo

Share this post


Link to post
Share on other sites

The phone field does not fail in the create_account file. However if it fails in the account_pwa file.

To prevent something previously installed conflict I have used its original file without modification and still giving error. When entering 1 only digit it gives by valid and continues the process, does not verify if the field has established that they are but digits or not.

In the end I have managed to work by deleting the variable GUEST_CHECKOUT_TELEPHONE, asking if you want to display the field or do not want to display it. Now if you check how many digits are set at least.

If I do not want the field (that is to say that if I want it) I just have to comment on your request when creating the account and set it in the admin nothing. Do not zero, nothing, leave the field empty.

Share this post


Link to post
Share on other sites
1 hour ago, PiLLaO said:

I'm installing "HTML emails" @Gergely addon (https://forums.oscommerce.com/topic/399712-html-emails/)

In checkout_process.php this contribution replace code that uses PWA addon.

Hola Gustavo @PiLLaO,

 

The PWA modifications for html e-mails must be applied in the includes/module/pages/templates/email_checkout_process_html.php and ...text files instead of checkout_process.php

 

Here the relevant codse examples I'm using in my store. Youll need to revise them for your store:

email_checkout_process_html.php:

    // Support for PWA guest orders BEGIN
    if (tep_db_num_rows(tep_db_query("select * from information_schema.columns where table_schema='". DB_DATABASE . "' and table_name='orders' and column_name like 'customers_guest'")) == 1 ) {
      $check_query_mail = tep_db_query("select customers_email_address from customers where customers_id = '" . (int)$customer_id . "'");
      $check_mail = tep_db_fetch_array($check_query_mail);
      if (!empty($check_mail['customers_email_address'])) {
        $check_query_order_guest = tep_db_query("select count(*) as orders from orders where customers_email_address = '" . $check_mail['customers_email_address'] . "' and customers_guest = '1'");
        $check_order_guest = tep_db_fetch_array($check_query_order_guest);
        $orders_count = $orders_count + $check_order_guest['orders'];
      }
    }
    // Support for PWA guest orders END

................

                            <td><?php echo EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id; ?></td>
                          </tr>
                          <?php
                          // PWA guest checkout BEGIN
                          if(!tep_session_is_registered('customer_is_guest')) { ?>
                            <tr>
                              <td><?php echo EMAIL_TEXT_INVOICE_URL . ' <a href="' . tep_href_link('account_history_info.php', 'order_id=' . $insert_id, 'SSL', false) . '">' . EMAIL_TEXT_MY_ORDER . "</a>"; ?></td>
                            <tr>
                          <?php
                          }
                          // PWA guest checkout END
                          ?>
                          <tr>
                            <td><?php echo EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG); ?></td>
                          </tr>
                          <?php
                          // PWA guest checkout BEGIN
                          if($pwa_text) { ?>
                            <tr>
                              <td>
                                <hr>
                                <?php echo $pwa_text; ?>
                              </td>
                            <tr>
                          <?php
                          }
                          if($products_review_links_html) { ?>
                            <tr>
                              <td>
                              <hr>
                              <h2><?php echo constant('MODULE_CONTENT_PWA_REVIEWS_' . strtoupper($language)); ?></h2>
                              <blockquote style="background: #f9f9f9; border-left: 10px solid #ccc; margin: 1.5em 10px; padding: 0.5em 10px;"><?php echo tep_convert_linefeeds(array("\r\n", "\n", "\r"), "<br />", $products_review_links_html); ?></blockquote>
                              </td>
                            <tr>
                          <?php
                          }
                          // PWA guest checkout END
                          ?>
                          <tr>
                            <td>
                            <?php if ($order->info['comments']) { ?>
                              <h2><?php echo EMAIL_COMMENTS; ?></h2>
.................................

in the text version, the first part is the same, the second part looks like this:

....................................
$set_password_email_text .
       EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n";       
// PWA guest checkout BEGIN       
  if(!tep_session_is_registered('customer_is_guest')) { 
  	echo EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link('account_history_info.php', 'order_id=' . $insert_id, 'SSL', false) . "\n";
  }
// PWA guest checkout END       
  echo EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n" . 
       EMAIL_SEPARATOR . "\n";
..........................................

Hope this helps

un saludo

Rainer

Share this post


Link to post
Share on other sites
2 hours ago, reflex-ocasion said:

In the end I have managed to work by deleting the variable GUEST_CHECKOUT_TELEPHONE, asking if you want to display the field or do not want to display it. Now if you check how many digits are set at least.

Hola Alfonso @reflex-ocasion,

 

if it works when you remove the GUEST_CHECKOUT_TELEPHONE constant, it means that you haven't set this setting in the pwa login module to "true".

What I do not understand then how you got to show the telephone input field in the pwa form. Did you remove the

if (GUEST_CHECKOUT_TELEPHONE == 'True')

statement in that part:

<?php if (GUEST_CHECKOUT_TELEPHONE == 'True'){ ?>
    <div class="form-group has-feedback">
      <label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('telephone', NULL, 'required aria-required="true" id="inputTelephone"', 'tel');
        if (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT)) echo '<span class="help-block">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>';
        ?>
      </div>
    </div>
<?php } ?>

 

2 hours ago, reflex-ocasion said:

If I do not want the field (that is to say that if I want it) I just have to comment on your request when creating the account and set it in the admin nothing. Do not zero, nothing, leave the field empty.

Sorry, I do not understand what you wants to say here.

 

un saludo

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

In true it shows the field, false does not show it. Deleting the variable no longer gives an error.

Here are the changes I have made in account_pwa.php

Point 1

    if (GUEST_CHECKOUT_TELEPHONE == 'True'){
      if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
        $error = true;

        $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
       }
    }

Changed by

    if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
      $error = true;

      $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
    }

 

Point 2

      $sql_data_array = array('customers_firstname' => $firstname,
                              'customers_lastname' => $lastname,
                              'customers_email_address' => $email_address,
                              'customers_guest' => '1');
      if (GUEST_CHECKOUT_TELEPHONE == 'True') $sql_data_array['customers_telephone'] = $telephone;
      if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;

Changed by

      $sql_data_array = array('customers_firstname' => $firstname,
                              'customers_lastname' => $lastname,
                              'customers_email_address' => $email_address,
                              'customers_telephone' => $telephone,
                              'customers_guest' => '1');
      if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;

 

Point 3

<?php if (GUEST_CHECKOUT_TELEPHONE == 'True'){ ?>
    <div class="form-group has-feedback">
      <label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('telephone', NULL, 'required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER_TEXT . '"', 'tel');
        echo FORM_REQUIRED_INPUT;
        ?>
      </div>
    </div>
<?php } ?>

Changed by

    <div class="form-group has-feedback">
      <label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('telephone', NULL, 'required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER_TEXT . '"', 'tel');
        echo FORM_REQUIRED_INPUT;
        ?>
      </div>
    </div>

 

It seems that the variable interferes. Once it is removed it works perfectly.

And the last thing I was referring to was to make a field not mandatory without editing any files. Also make sure that a field never leaves. This is what was done in version 2.2 of osCommerce.

 

Best Regards

Share this post


Link to post
Share on other sites

@reflex-ocasion,

 

I can only tell you that if you set in the pwa login module the setting " Require Telephone Number: " to "True", your modifications are not needed.

If you wants the field to be optional, just remove the "required" attribute.

I do not understand how you can complain that something doesn't work, if you apply uncorrect settings and/or modifications.

 

Share this post


Link to post
Share on other sites

Hello Rainer

Thank you so mutch.

I thought that I needed to move the PWA hooks to the includes/module/pages/templates/email checkout_process html.php and ...text

Now, I suppose that I must remove the call to pwa hooks, it's ok?

// PWA guest checkout
  $OSCOM_Hooks->register('pwa');

Best regards.

Gustavo

 

Share this post


Link to post
Share on other sites

If I set it to true it displays the phone field. If I put it in false does not show it, it does not come out.

Being true does not verify if the field is 1 digit or are 9 digits, at the moment there is 1 digit goes to the next point in the process.
I can put only 1 digit, I can put 2 digits, I can put 3 digits, it does not matter, it does not verify the amount of digits that I have set in the admin like minimum quantity, at the moment that there is something, no matter what quantity, it happens to the next one He passed.

When deleting the variable now if it verifies how many digits has to have the field and gives error if it is not correct. I think the variable interferes.

My store is about 1 year old with the BS EDGE version, it was installed from zero so I very much doubt that it is anything else that interferes.

I used your original file, not the one I have modified with more additional fields, and the same thing happens, go to the next point when entering 1 digit. Does it look normal that my phone number is 1, 12 or 123? Not because it is 123456789 which is what I have set in admin. Where are the other numbers? Put what you put it is recorded like this, without checking if it is correct or not. Can I explain myself better now?

 

 

Lo repito en Español, lo siento, parece que la traducción no es correcta o yo no soy capaz de explicarme.

Si lo pongo en true muestra el campo teléfono. Si lo pongo en false no lo muestra, no sale.

Estando en true no verifica si el campo es 1 digito o son 9 digitos, en el momento que hay 1 digito pasa al siguiente punto del proceso. Puedo poner sólo 1 digito, puedo poner 2 digitos, puedo poner 3 digitos, no importa, no verifica la cantidad de digitos que tengo establecido en el admin como cantidad mínima, en el momento que hay algo, no importa que cantidad, pasa al siguiente paso.

Al eliminar la variable ahora si verifica cuantos digitos tiene que tener el campo y da error si no es correcto. Pienso que la variable interfiere.

Mi tienda tiene 1 año aproximadamente con la versión BS EDGE, se instaló desde cero así que dudo mucho que sea otra cosa la que interfiera.

He usado su archivo original, no el que tengo modificado con mas campos adicionales, y ocurre lo mismo, pasa al siguiente punto al introducir 1 digito. ¿Ve normal que mi número de teléfono sea 1, 12 o 123? no porque es 123456789 que es lo que tengo establecido en el admin. ¿Donde están los demás números? ponga lo que ponga se graba así, sin verificar si es correcto o no. ¿Me explico mejor ahora?.

Share this post


Link to post
Share on other sites

raiwa, the code that you send me have 3 variables that aren't present in PWA

$pwa_text, $products_review_links_html, $set_password_email_text

I'm look for this variables in the addon files and I can't find them.

Are this files from a personal modification?

Thanks in advance :)

Gustavo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×