Jump to content
ArtcoInc

Purchase without account for 2.3.4 and BS2334

Recommended Posts

1 hour ago, PiLLaO said:

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

Hello @PiLLaO,

 

Yes, sorry, the variables are defined in the main page file:

    function build() {
      global $oscTemplate, $mimemessage, $order, $payment, $products_ordered, $insert_id, $order_totals, $customer_id, $sendto, $billto, $language, $languages_id;

      if ($oscTemplate->_email_data['orders']['enable_osc_mail'] == 'True') {
        if (is_object($GLOBALS[$payment])) {
          $payment_class = $GLOBALS[$payment];
        }

        // PWA guest checkout BEGIN
        $pwa_text = null;
        $products_review_links_html = null;
        $products_review_links_text = null;
        if(tep_session_is_registered('customer_is_guest')) {         
          $pwa_text .= constant('MODULE_CONTENT_PWA_EMAIL_WARNING_' . strtoupper($language)) . "\n\n"; 
          if($order->content_type != 'physical') {         
            $pwa_text .= constant('MODULE_CONTENT_PWA_DOWNLOAD_' . strtoupper($language)) . "\n";
          }
          $reviews_key = tep_create_random_value(12);
          tep_db_query("update orders set reviews_key = '" . $reviews_key . "' where customers_id = '" . (int)$customer_id . "' and orders_id = '" . (int)$insert_id . "'");
          if(MODULE_CONTENT_PWA_LOGIN_CHECKOUT_GUEST_REVIEW_LINKS == 'True') {
            for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
              $product_check_query = tep_db_query("select count(*) as total from products p, products_description pd where p.products_status = '1' and  p.products_quantity > '0' and p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
              $product_check = tep_db_fetch_array($product_check_query);
              if ($product_check['total'] > 0) {
                $products_review_links_html .= '<a href="' . tep_href_link('product_reviews_write_pwa.php', 'products_id=' . tep_get_prid($order->products[$i]['id']) . '&pwa_id=' . $reviews_key, 'SSL', false) . '">' . $order->products[$i]['name'] . '</a>' . "\n";
                $products_review_links_text .= tep_href_link('product_reviews_write_pwa.php', 'products_id=' . tep_get_prid($order->products[$i]['id']) . '&pwa_id=' . $reviews_key, 'SSL', false) . "\n";
              }   
            }
          }
        } elseif (MODULE_CONTENT_PWA_LOGIN_CHECKOUT_REGISTERED_REVIEW_LINKS == 'True') {
          for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
            $product_check_query = tep_db_query("select count(*) as total from products p, products_description pd where p.products_status = '1' and  p.products_quantity > '0' and p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
            $product_check = tep_db_fetch_array($product_check_query);
            if ($product_check['total'] > 0) {
              $products_review_links_html .= '<a href="' . tep_href_link('product_reviews_write.php', 'products_id=' . tep_get_prid($order->products[$i]['id']), 'SSL', false) . '">' . $order->products[$i]['name'] . '</a>' . "\n";
              $products_review_links_text .= tep_href_link('product_reviews_write.php', 'products_id=' . tep_get_prid($order->products[$i]['id']), 'SSL', false) . "\n";
            }   
          }
        }
        // PWA guest checkout END
        
        $set_passw_url = tep_href_link('ext/modules/content/account/set_password.php', '', 'SSL');

It's an excample from my store, you need to revise and maybe adapt it for your needs.

Rainer

Share this post


Link to post
Share on other sites

@reflex-ocasion,

can you please echo your

GUEST_CHECKOUT_TELEPHONE

constant in the account_pwa.php page to see if it is correct defined. It must show "True".
 

Share this post


Link to post
Share on other sites

It is not that the variable is false and therefore does not work. If it were set to false, the phone field would not be displayed. This is true and the phone field is displayed. Or I was because I deleted the variable.

My phone number is 630.xxx.xxx, a 9-digit number. 9 digits is the minimum length I have set in the admin for the phone field. If I only put 1 digit, no matter what, pwa gives it as valid when the valid is 9 digits. In the order leaves that number that pwa has given by valid. Let us assume that it is the first, 6.

If my phone is 9 digits but pwa is satisfied with only 1 to give it as valid, what do I call that number? Frame 6 and I hope the smartphone is so smart as to guess the rest of the numbers?

The question is not that the variable is true or false, the question is that the variable interferes and does not let you verify how many numbers have been set to minimum to give it as valid.

Do the test yourself, place a test order with pwa and the phone field set to several numbers. You can put any number of numbers you want as long as it is below the minimum set in the admin. You will see how you can follow the process. If you then go to the admin and look at the pwa client's tab before it is deleted alone, you will automatically see that in the phone field there is only that number that you have put before. Even if you look at the order at the end of the order, you will see that only the number in the phone field appears.

It assumes that the customer is going to enter all the numbers and that is not always the case, I have been given cases in which they do not want to give their number and have placed as many zeros as they have been necessary. Other times they have been wrong and have put more numbers.

Share this post


Link to post
Share on other sites

I try to help. Why can't you just do what I ask for and post the result

 

Share this post


Link to post
Share on other sites

Have you tried to put fewer numbers than the minimum set? I did it by mistake and that's why I know there is a bug.

For me now it works perfectly without the variable. If I put it gives me the error mentioned, I can put a number of a single number and pwa gives it as valid.

Share this post


Link to post
Share on other sites

@reflex-ocasion,

I checked and found that in the original version from de Dokta, it was written  "true", small letter. THis was changed in my versions to be identical for all configuration entries.

Please check that it's the same "True" with big letter in all places, the configuration entry in the login module should be:

      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, `set_function`) values ('Require Telephone Number', 'GUEST_CHECKOUT_TELEPHONE', 'True', 'Require Telephone Number?', 6, 5, '', now(),  'tep_cfg_select_option(array(\'True\', \'False\'),')");

Then in account PWA it should be in 2 places:

    if (GUEST_CHECKOUT_TELEPHONE == 'True'){

Please check also in your configuration table in the database if you have the entry "GUEST_CHECKOUT_TELEPHONE" duplicated and one entry holds the old version with small letter "true".

 

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

@reflex-ocasion,

did you check your database?

Please do what I asked, echo the constant anywhere in the account_pwa.php page, it's the only way to find out what is wrong.

Share this post


Link to post
Share on other sites

Sorry, I have written it in Spanish, I have not translated it. :blush:

Everywhere is big, appears as True. There is no difference between upper and lower case.

Share this post


Link to post
Share on other sites
echo 'test guest checkout constant:' . GUEST_CHECKOUT_TELEPHONE;

 

Edited by raiwa

Share this post


Link to post
Share on other sites

I have added some extra fields. To avoid conflicts I used YOUR file unmodified. The result is the same, there is an error.

Share this post


Link to post
Share on other sites

Sorry I can't help if you do not do what I asked for. If the constant is wrong defined in the database you can test the original file as you wish it will not work.

If you are not willing to foilow my instructions I will not loose my time any more.

Full stop-punto y aparte, con perdón y buenas noches!

Edited by raiwa

Share this post


Link to post
Share on other sites

If I put a single number in the telephone field, pwa admits it

pwa-1.jpg.9888aaf2ecf979f88c8cc4e2e4786ae8.jpg

 

It's what comes in the order.

pwa-2.jpg.45ea9bb705f162167b2d090b124c78c6.jpg

 

The minimum set pwa does not respect.

pwa-3.jpg.ba281d86eb92e84ac6b852cde73636f3.jpg

Share this post


Link to post
Share on other sites

@reflex-ocasion,

If you wish I can investigate this problem.

Please send me in a private message your following files (your cahnged files before removing the if statements):

create_account.php

account_pwa.php

includes/modules/content/login/cm_paypal_login.php

and a database backup of your configure table (important)

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

@raiwa

They are already sent but you will not find anything unusual.

I assume you meant the file cm_pwa_login instead of cm_paypal_login as indicated. If I am wrong, let me know.

Although I have it installed I do not have the option to identify through PayPal.

 

Deleting the variable will solve the problem, to me now it works me correctly.

Share this post


Link to post
Share on other sites

I have not looked at the addon that is being talked about, but I am confident that you are both talking about the same thing, but from different angles;

 

required simply means that something must go into the field so that the form can be submitted.

If you want to do more than simply requiring something, you can use a pattern on the input field, minlength maxlength and loads of other such things.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
6 minutes ago, burt said:

required simply means that something must go into the field so that the form can be submitted.

It is what I say from the first moment, that only serves to show or not the field.

That the requirement interferes in some way in the result is another question. The requirement is something so simple that it should not interfere in any way and yet it interferes, at least to me, in my concrete and particular case.

I do not know why it happens but it does. I use oscommerce BootStrap EDGE for about 1 year and this is the first time that something like that happens to me. Even in the 9 years that I have been using osCommerce in different versions I had happened before.

Share this post


Link to post
Share on other sites

Hola Alfonso @reflex-ocasion,

I checked your files and settings and if I set " Teléfono obligatorio" to "True " (it was set to false in your configuration) everything works as it should.

Please see the screenshots, first one with my original add-on file, second one with your modified file.

It works correct with both, the original account_pwa.php and your modified file.

I do not understand why you have the setting " Teléfono obligatorio" to "False in your config table.

You have this if condition "if (GUEST_CHECKOUT_TELEPHONE == 'True'){"  involving both, telephon and mobile:

<?php if (GUEST_CHECKOUT_TELEPHONE == 'True'){ ?>
  <h2><?php echo CATEGORY_CONTACT; ?></h2>

  <div class="contentText">
	<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>
	<div class="form-group has-feedback">
      <label for="inputTelephoneMovil" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_MOVIL_NUMBER; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('telephone_movil', NULL, 'required aria-required="true" id="inputTelephoneMovil" placeholder="' . ENTRY_TELEPHONE_MOVIL_NUMBER_TEXT . '"', 'tel');
        echo FORM_REQUIRED_INPUT;
        ?>
      </div>
    </div>
  </div>
<?php } ?>

Meanwhile in the validation part you are using different constants for each validation:

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

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

      if (GUEST_CHECKOUT_TELEPHONE_MOVIL == 'True'){
        if (strlen($telephone_movil) < ENTRY_TELEPHONE_MOVIL_MIN_LENGTH) {
          $error = true;

          $messageStack->add('account_pwa', ENTRY_TELEPHONE_MOVIL_NUMBER_ERROR);
        }
      }

This doesn't fit the explication you gave at all. Are you sure you send me the correct versions?

Anyway, problem are your modifications, not the original files.

 

@burt,

the files are modified, additional field for mobile phone added and the problem is for sure in that part.

I know about the html5 input validations, but as far as I'm informed minlength maxlength for input fileds is not yet suported by any browser. Only for text fields. Pattern is a possibility, but the account_pwa.php form is coded according to the core create_account.php standard.

Anyway, it is not the discussed subject.

 

rgds

Rainer

accountpwa original.jpg

accountpwa modified reflex.jpg

Edited by raiwa

Share this post


Link to post
Share on other sites

Perhaps a typo error ?  => MOVIL or MOBIL in ENTRY_TELEPHONE_MOVIL_NUMBER_ERROR


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

(Live   : OsC 2.2, php 5.4 & UTF-8  |  Local : OsC 234BS php7.2 Edge for future shop)

Share this post


Link to post
Share on other sites
1 minute ago, bonbec said:

Perhaps a typo error ?  => MOVIL or MOBIL in ENTRY_TELEPHONE_MOVIL_NUMBER_ERROR

MOVIL is spanish spelling, it's only the text constant name, as far as it is the same spelling everywhere it's no problem.

The configuration constant seems to be the same in all places

GUEST_CHECKOUT_TELEPHONE_MOVIL

Share this post


Link to post
Share on other sites

Whatever you feel is best.  I am simply pointing out that it is potentially the use of english by non-native english speakers that is maybe a sticking point here.

If something is set to required:  at least one character is needed.

Perhaps this needs to be separated;

"display an input field for XYZ"

"should XYZ be required?"

"should XYZ have a Pattern?"

should XYZ have a min/max length?"

 

etc etc

 

For ref;

https://caniuse.com/input-minlength

https://caniuse.com/maxlength


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
3 hours ago, burt said:

Thank you, something has changed there it seems since I checked last time.

Share this post


Link to post
Share on other sites

The online translator I use is not always perfect. I regret the bad translations.

In my case, in my particular case, The constant is what prevents the minimum length of the telephone field from being checked.

Once it is removed, check the minimum length of the field.

Do not add anything because the file is basically a clone with some modifications to create_account.php. If one file works perfectly the other must also do it. In fact it does in my case once I have removed the constant, now works correctly.

I do not know why it happens, I just know that it happens to me and it seems that my case is unique, nobody else has happened to him. It may also be that no one has checked it before, it is taken for granted the goodwill of the people, it is assumed that the customer will enter all the numbers. I discovered it by mistake, I entered a single number and to my surprise it was not verified if it was correct or not.

The question is that if someone else has the same problem already knows what to do, remove the constant. My specific case may be unique or not and there are more users with the same problem without knowing that they have this problem.

I give it for solving even if it does not really know why it happened.

 

I repeat. I do not speak English and I use an online translator. If the bad translation has caused any communication problem I apologize.

Edited by reflex-ocasion

Share this post


Link to post
Share on other sites
19 hours ago, raiwa said:

This doesn't fit the explication you gave at all. Are you sure you send me the correct versions?

As I said before, to solve my problem I had to eliminate the constant. When he asked me to send him my files for review, I had to add it again. It is very possible that at that particular point I did not put all the code, that something happened to me. I apologize for it. :blush:

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

×