Jump to content
Latest News: (loading..)
ArtcoInc

Purchase without account for 2.3.4 and BS2334

Recommended Posts

8 minutes ago, raiwa said:

it seems the right version.

Can you also check if in your database table "orders" the column " reviews_key" exists.

If I looked in the right place, it had stuff like orders_id, customers_id, all the way down to currency_value, but nothing like reviews_key at all, was I supposed to put that in there?

thanks

brian

Edited by brian_cee
spelling

Share this post


Link to post
Share on other sites

You have the old version still installed in your store. You posted the file from your local computer, not the one which is on your server, or you didn't uninstall and reinmstall the module.

 

Do the following:

  • uninstall the module.
  • upload the new module and make sure it replaced the old one or delete first the old one
  • you can check it downloading again the module and edit it and check for the version or open the module from your server in  your cpanel's file manager
  • once you are sure the new version is on your server, install again the module
  • if all is good you shoul have in the first line of the module panel showing "Version: 2.4 BS"

 

If we go back to your very first question, " should I scrap it, uninstall and start over " means exactly this. Uninstall and remove completely the old version, not just copy over or whatever you did.

Share this post


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

If we go back to your very first question, " should I scrap it, uninstall and start over " means exactly this. Uninstall and remove completely the old version, not just copy over or whatever you did.

Thanks, I made sure to remove all of the files and re-upload them, but it didn't occur to me to go to admin and uninstall the things from the previous version......

Share this post


Link to post
Share on other sites

during installation of the module database updates are executed which are different or lets say there are additional queries executed and entries added in the new version. That's why the old module need to be uninstalled and the new module installed again.

And that's also meant in the instructions when saying:

4. In Admin =>Modules => Content[login] install and configure the module 'Login without Account Form'.

Share this post


Link to post
Share on other sites
2 minutes ago, raiwa said:

 4. In Admin =>Modules => Content[login] install and configure the module 'Login without Account Form'.

Yes, I should learn to think better, thanks for your help......Now that I have the proper thing installed with no errors and it seems to be working, I wonder, if I only want customers who receive a product to be invited to write a review, can I remove the "write a review" button so random visitors can't try to leave a review?

And also, in my test, I clicked on the link in the email to leave a review, and my name was autofilled in the review. What could I do for those who don't want their names visible? Maybe if I sold items that people did not want others to know that they purchased, etc?

Share this post


Link to post
Share on other sites
10 minutes ago, brian_cee said:

 I wonder, if I only want customers who receive a product to be invited to write a review, can I remove the "write a review" button so random visitors can't try to leave a review?

Only registered customers or guests following the link in the order e-mail can write reviews, no random visitor can do it.

12 minutes ago, brian_cee said:

And also, in my test, I clicked on the link in the email to leave a review, and my name was autofilled in the review. What could I do for those who don't want their names visible? Maybe if I sold items that people did not want others to know that they purchased, etc?

You can modify the code in product_reviews.php to supress the name or show only the first name and abreviate the second name or whatever you wish. However it may give less credibility to the reviews, up to you.

Anyway both questions are not related to PWA. You should better post them in a more generic topic to get better visibility for other users and more help.

Share this post


Link to post
Share on other sites
5 minutes ago, raiwa said:

Anyway both questions are not related to PWA. You should better post them in a more generic topic to get better visibility for other users and more help.

Thanks again, but I thought that the ability for guests to write reviews could only be done in this particular version of PWA, since it seemed to evolve years ago in this very thread? I think it is related, in my opinion,  because currently, if I click on the "write a review" button, it kicks me to the login page, but the way that I modify PWA, all of my customers are funnelled to account_pwa when they click to checkout, so there are no logins or passwords possible, if I'm making myself clear.

So I don't want random visitors, or even customers, clicking on "write  a review' and goiong to a login page where they have no account, and can't make an account, because I don't do accounts the way I have PWA set up...... I'm just wondering if I can remove that "write a review" button.........

Share this post


Link to post
Share on other sites

OK, let me ask it this way, SPECIFICALLY about PWA, to qualify for this thread:

The old way to have reviews show up with first name and no last name was to replace:

tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) . "', '" . tep_db_input($rating) . "', now())");

 

With

tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . "', '" . tep_db_input($rating) . "', now())");

 

On product_reviews_write.php

But as far as I can tell, if you have PWA, then the relevant page is now product_reviews_write_pwa.php which doesn't have this code, or any specific reference to last name.

If anyone has any ideas, thanks for sharing.

 

Share this post


Link to post
Share on other sites

OK, I didn't know that you only use guest checkouts, I thought you wanted to supress the lastnames showing on the product_reviews.php page and keep the complete name in the database to be able to see it in admin.

In product_reviews_write_pwa.php  the customer name is retrieved from the orders data not from the customers account bacause it doesn't exist for guests.

In the order data the customer first and second name is merged into one field called customers_name. So it is not so easy to strip the customers second name and leave only the first name as it is in product_reviews_write where 2 separate fields exist (customers_firstname_and customers_lastname).

The relevant line in product_reviews_write_pwa.php  is line 79:

      tep_db_query("insert into reviews (products_id, customers_id, customers_name, customers_guest, reviews_rating, date_added) values ('" . (int)$_GET['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_name']) . "', '1', '" . tep_db_input($rating) . "', now())");

      tep_db_query("insert into reviews (products_id, customers_id, customers_name, customers_guest, reviews_rating, date_added) values ('" . (int)$_GET['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_name']) . "', '1', '" . tep_db_input($rating) . "', now())");

You see that there is only the entrance $customer['customers_name'].

So what is possible to use a php function strip everything following the first whitespace of the name and leave like this only the firstname. Only issue maybe that there are customers with 2 firstnames, so the second firstname would also be stripped off.

The function you need is strstr(... see freference:

http://php.net/manual/en/function.strstr.php

So change line 79 to:

      tep_db_query("insert into reviews (products_id, customers_id, customers_name, customers_guest, reviews_rating, date_added) values ('" . (int)$_GET['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input(strstr($customer['customers_name'], ' ', true)) . "', '1', '" . tep_db_input($rating) . "', now())");

hope this is what you wanted.

regards

Rainer

Share this post


Link to post
Share on other sites
12 hours ago, brian_cee said:

Thanks again, but I thought that the ability for guests to write reviews could only be done in this particular version of PWA, since it seemed to evolve years ago in this very thread? I think it is related, in my opinion,  because currently, if I click on the "write a review" button, it kicks me to the login page, but the way that I modify PWA, all of my customers are funnelled to account_pwa when they click to checkout, so there are no logins or passwords possible, if I'm making myself clear.

So I don't want random visitors, or even customers, clicking on "write  a review' and goiong to a login page where they have no account, and can't make an account, because I don't do accounts the way I have PWA set up...... I'm just wondering if I can remove that "write a review" button.........

Not sure here what you are concerned for.

Guests can only write a review if they have made a purchase and following the link they get in the order confirmation mail.

Other visitors can only write a review if they have an account. It's true that registered users can write reviews on any product, even they didn't purchase it.

So if I understand right, you do not offer the possibility to create a regular account, I guess you have the standard create account module uninstalled for this.

So if you just wish to hide the "Write review" button in product_reviews.php, you need to comment out or remove the relevant code:

    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW, 'fa fa-commenting', tep_href_link('product_reviews_write.php', tep_get_all_get_params()), 'primary', NULL, 'btn-success'); ?></div>

 

Share this post


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

The relevant line in product_reviews_write_pwa.php  is line 79:

      tep_db_query("insert into reviews (products_id, customers_id, customers_name, customers_guest, reviews_rating, date_added) values ('" . (int)$_GET['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_name']) . "', '1', '" . tep_db_input($rating) . "', now())");


      tep_db_query("insert into reviews (products_id, customers_id, customers_name, customers_guest, reviews_rating, date_added) values ('" . (int)$_GET['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_name']) . "', '1', '" . tep_db_input($rating) . "', now())");

You see that there is only the entrance $customer['customers_name'].

So what is possible to use a php function strip everything following the first whitespace of the name and leave like this only the firstname. Only issue maybe that there are customers with 2 firstnames, so the second firstname would also be stripped off.

The function you need is strstr(... see freference:

http://php.net/manual/en/function.strstr.php

So change line 79 to:


      tep_db_query("insert into reviews (products_id, customers_id, customers_name, customers_guest, reviews_rating, date_added) values ('" . (int)$_GET['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input(strstr($customer['customers_name'], ' ', true)) . "', '1', '" . tep_db_input($rating) . "', now())");

hope this is what you wanted.

regards

Rainer

Absolutely. Afterwards I saw that I also needed to change Line 171 from:

<p class="col-xs-9"><?php echo tep_output_string_protected($customer['customers_name'] ); ?></p>

to:

<p class="col-xs-9"><?php echo tep_output_string_protected(strstr($customer['customers_name'], ' ', true)); ?></p>

Because when a customer clicks the link to write a review, it was displaying their last name, and they might be scared off of leaving a review, not knowing that their last name wouldn't actually show up......if that makes sense, anyway, it looks like it works fine, so thanks for explaining how to do it.........

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

I have this working perfectly on the new 2.3.4BS  shop, but I'm now trying to import data from my old 2.2 shop, and I'm hitting a wall on the reviews....The reviews table has differently named columns slightly, not sure if that's the problem, but I can create and populate reviews table and reviews_descriptions table, everything looks OK, and in admin I can add a review, etc...but if I try to look at a review I've added from 2.2, I get errors:

Warning: array_merge(): Argument #1 is not an array in ....../admin/reviews.php on line 285 (and 286)

here are those lines:

$review_info = array_merge($reviews_text, $reviews_average, $products_name);
        $rInfo_array = array_merge($reviews, $review_info, $products_image);

and:

Warning: reset() expects parameter 1 to be array, null given in.... /admin/includes/classes/object_info.php on line 21(and 22)

here are those lines:

 function objectInfo($object_array) {
      reset($object_array);
      while (list($key, $value) = each($object_array)) {

 

At first glance, does anyone think I made an obvious mistake?

 

Share this post


Link to post
Share on other sites

Hello Brian,

The new database tables have different entries, column names etc as you already stated. So if you import data from the old database, you have to make sure to import only the data, not the structure.

  • export the data with the custom option and select: "dump table" "only data"
  • empty in the new database the tables you wish to import: select the tables in phpmysql root window, then choose at the bottom in the drop down menu "with selected: empty"
  • then import the data file from the old database

Make sure to restore first a correct working version of the new store's database

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

If you feel that transferring your data from one version to the other is too complicated, then pay someone to do it. Thats what I did and it was no where near as expensive as I thought it would be. It was also done quickly so the store was not down for long.


REMEMBER BACKUP, BACKUP AND BACKUP

Before installing the official version of oscommerce first look at a responsive version here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

A small detail I must have overlooked, but since account_pwa.php replaces create_account.php, I can't seem to find where I determine whether there is a checkbox for signing up to a newsletter anymore. I've searched maybe I've deleted it, but I've compared old and new files......Is it just not available for folks that choose to not create an account?

Share this post


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

Guests can't sign up for newsletters, their e-mail and other personal account data are deleted on order complete.

I see, I wonder, how possible would it be, if it hasn't already been done, to put a checkbox (or a yes/no dropdown) in the checkout that let's a guest check it to opt-in to your email list, so we could harvest their email address for the list? Then it would just appear in orders after all of the other information. Not sure if I described it correctly....

Share this post


Link to post
Share on other sites
12 hours ago, brian_cee said:

I see, I wonder, how possible would it be, if it hasn't already been done, to put a checkbox (or a yes/no dropdown) in the checkout that let's a guest check it to opt-in to your email list, so we could harvest their email address for the list? Then it would just appear in orders after all of the other information. Not sure if I described it correctly....

Why not add a module that would allow people to sign up to your newletter rather than keep the information of someone who does not want you to have it, or they would use a proper checkout, where the option is available.


REMEMBER BACKUP, BACKUP AND BACKUP

Before installing the official version of oscommerce first look at a responsive version here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites
13 hours ago, brian_cee said:

I see, I wonder, how possible would it be, if it hasn't already been done, to put a checkbox (or a yes/no dropdown) in the checkout that let's a guest check it to opt-in to your email list, so we could harvest their email address for the list? Then it would just appear in orders after all of the other information. Not sure if I described it correctly....

It's not that easy. The newsletter manager uses the account data (Customer Name, E-Mail) to send the newsletters. As there is no account data for guests, it would need to be modified to use a new separate table for guest subscribers. The guests newsletter subscribers data (name, e-mail) would need to be stored in that table on checkout succes and a new module added for guest subscribers.

It would be much easier to use mailchimp and add a checkout success module to subscribe via mailchimp or use the existing navbar mailchimp module and trigger the mailchimp subscribe popup in checkout success.

Edited by raiwa

Share this post


Link to post
Share on other sites

I like this version of PWA, but is it the case that "Use MIME HTML When Sending Emails= FALSE" must actually be set to true?

I know everybody has always insisted that this must be false, but when I set it to false, there are no hyperlinked products that I am asking them to click on and leave a review for. The products they ordered are listed, but just text, not clickable links. By setting MIME gto "true" they are fixed, but is this causing some other problem I am not aware of? Why is it always instructed to set this to false, I wonder?

 

Share this post


Link to post
Share on other sites

Out of the blue, I see a person's info in the customers section of admin, which is odd, since I thought PWA doesn't store customers info, and I have disabled account login, or thought I did.

And in the customers area of admin, I all of a sudden have errors at the top of page:

Warning: array_merge(): Argument #1 is not an array in /home/user/public_html/catalog/admin/customers.php on line 706

Warning: array_merge(): Argument #2 is not an array in /home/user/public_html/catalog/admin/customers.php on line 708

Warning: reset() expects parameter 1 to be array, null given in /home/user/public_html/catalog/admin/includes/classes/object_info.php on line 21

Warning: Variable passed to each() is not an array or object in /home/user/public_html/catalog/admin/includes/classes/object_info.php on line 22

 

Lines 706-108 of admin/customers.php :

$customer_info = array_merge($country, $info, $reviews);

        $cInfo_array = array_merge($customers, $customer_info);

 

Lines 21-22 of admin/includes/classes/object_info.php:

reset($object_array);
      while (list($key, $value) = each($object_array)) {

 

I thought everything was set up properly and was operating correctly, so this is weird to me. Is it obvious to anyone what I may have messed up?

 

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

×