Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need help with customer account form and PWA


apmuskel

Recommended Posts

I am setting up a new test store using 2.3.4

Being a newbie to php I need some help.

 

I have installed the PWA addon (guest login/no sign up)

See attachment "help 1"

 

1. What is the best way to restyle the text in the red box? Is it OK to change font/add picture etc. in the languages file using divs?

2. I would like to change the button image in the red box to a custom made that say "guest checkout", how would I do that without change every other button that uses the same image?

 

 

See attachemnt "help2"

 

3. As you can see in red box, insted of show just a asterix there is the text "FORM_REQUIRED_INPUT" ..why? how do I solve this?

4. Green box, the date format is now MM/DD/YYYY.. in sweden we use YYMMDD-XXXX. How can I get this to work? XXXX is controll numbers. I know this is possible to add to the form input, have seen it on other stores.

5. Blue box, my shop will only sell to sweden so I dont feel the need for customers to choose land. How do I remove some of the options in the forms? This goes for the normal sign up aswell. So I want to remove some of the input fields and remove that theese fields is required

 

 

6. One more thing.. Today when I was trying to accses my admin page all I got was a blank page. What could be the reason for this?

Link if that helps: http://pokie.se/shop1/admin/login.php

 

Thx alot in advance

post-330087-0-34793000-1430478961_thumb.jpg

post-330087-0-15634000-1430478962_thumb.jpg

Link to comment
Share on other sites

I'll help with one issue. The button to say Guest Checkout. In your swedish.php language file add this before the ending ?> tag:

 

define('IMAGE_BUTTON_GC', 'Guest Checkout');

 

In the includes/modules/template/pwa_login.php

 

change this:

<p align="right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link('account_pwa.php', '', 'SSL'), 'primary'); ?></p>  
 

To this:

<p align="right"><?php echo tep_draw_button(IMAGE_BUTTON_GC, 'triangle-1-e', tep_href_link('account_pwa.php', '', 'SSL'), 'primary'); ?></p>  
 

Link to comment
Share on other sites

I'll help with one issue. The button to say Guest Checkout. In your swedish.php language file add this before the ending ?> tag:

 

define('IMAGE_BUTTON_GC', 'Guest Checkout');

 

In the includes/modules/template/pwa_login.php

 

change this:

<p align="right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link('account_pwa.php', '', 'SSL'), 'primary'); ?></p>  

 

To this:

<p align="right"><?php echo tep_draw_button(IMAGE_BUTTON_GC, 'triangle-1-e', tep_href_link('account_pwa.php', '', 'SSL'), 'primary'); ?></p>  

 

Great, Thx!

Allthou mine was in a diffrent path (...\includes\modules\content\login\templates) :)

And this also answers my first question.. only 4 more to go ;)

 

One more question regarding the button thou..

I edited the line you referd to, mine looked like this:

 

<p class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', tep_href_link('account_pwa.php', '', 'SSL'), null, null, 'btn-primary btn-block'); ?></p>

 

What in this line controlls that the button have a small up arrow? I would like a forward arrow insted.

Link to comment
Share on other sites

so i´ve been looking through the code for answers to my question #3

 

I found this in account_pwa.php(the file that generates the form):

 

<div class="col-xs-9">
        <?php
        echo tep_draw_input_field('firstname', NULL, 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME . '"');
        echo FORM_REQUIRED_INPUT;
        if (tep_not_null(ENTRY_FIRST_NAME_TEXT)) echo '<span class="help-block">' . ENTRY_FIRST_NAME_TEXT . '</span>';
        ?>
      </div>

 

And I guess this is the problem with the text before the asterix.. is it safe to just remove that echo and place a " " insted?

What I cant understand is that the page generates the text "FORM_REQUIRED_INPUT*" with an asterix.. but I cant see where the asterix in the end comes from and this is something I do want to keep

Link to comment
Share on other sites

Great, Thx!

Allthou mine was in a diffrent path (...\includes\modules\content\login\templates) :)

And this also answers my first question.. only 4 more to go ;)

 

One more question regarding the button thou..

I edited the line you referd to, mine looked like this:

 

<p class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', tep_href_link('account_pwa.php', '', 'SSL'), null, null, 'btn-primary btn-block'); ?></p>

 

What in this line controlls that the button have a small up arrow? I would like a forward arrow insted.

Yes, I see now it's different.  I'm using a slightly older version of PWA so it's different. Just change the text: IMAGE_BUTTON_CONTINUE  to IMAGE_BUTTON_GC (or whatever you named it) and the rest you can leave as is in your code.

Link to comment
Share on other sites

so i´ve been looking through the code for answers to my question #3

 

I found this in account_pwa.php(the file that generates the form):

 

<div class="col-xs-9">

        <?php

        echo tep_draw_input_field('firstname', NULL, 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME . '"');

        echo FORM_REQUIRED_INPUT;

        if (tep_not_null(ENTRY_FIRST_NAME_TEXT)) echo '<span class="help-block">' . ENTRY_FIRST_NAME_TEXT . '</span>';

        ?>

      </div>

 

And I guess this is the problem with the text before the asterix.. is it safe to just remove that echo and place a " " insted?

What I cant understand is that the page generates the text "FORM_REQUIRED_INPUT*" with an asterix.. but I cant see where the asterix in the end comes from and this is something I do want to keep

I think it's because FORM_REQUIRED_INPUT is not defined. I would try adding a define to the includes/languages/english/checkout_pwa.php file:

 

 define('FORM_REQUIRED_INPUT', ' ');

 

and I would change all instances of help-block to inputRequirement in the account_pwa.php file or you can add a css class .help-block to the stylesheet.css file and style it your way.

Link to comment
Share on other sites

You guys are trying to install/use an addon that was made for osC2.3.4.Bootstrap and not for normal osC.

The add on says: IMPORTANT : In the standard/default or bootstrap version only for Osc 2.3.4 !!

 

does standard/default mean normal osC? That's what I thought it meant by standard.

Link to comment
Share on other sites

Yes, I did take note of the new addition of chevron/glyphicons and it made me wonder if this was for standard osC and I went back and re-read the addon info to make sure and it said for use with standard osC 2.3.4 or bootsrap.

Link to comment
Share on other sites

FORM_REQUIRED_INPUT or col-xx-x or glyphicon have no effect on a normal non-bootstrap shop so something is getting mixed up here. I haven't looked inside the addon files bu there must be codes in it for both versions so make sure you are looking at the right codes.

Link to comment
Share on other sites

well, silly me. I downloaded the addon from http://addons.oscommerce.com/info/9142..but did not check the history. The lates update was only BS version included.
I have downloaded the correct version for standard osc now :)

Thx for the help guys.

 

Have also solved the blank admin page problem. (removed blank spaces/rows in login.php and added a swedish admin files)

 

Now I only need help with getting swedish "birth dates" to work.. with the 4 extra numbers at the end and how to remove some of the input fields and the fact that they are requierd

Link to comment
Share on other sites

@@apmuskel

 

what date format do you have inside your language.php file?

For example inside the english.php you have

define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('JQUERY_DATEPICKER_I18N_CODE', ''); // leave empty for en_US; see http://jqueryui.com/demos/datepicker/#localization

what does your swedish language file say?

Link to comment
Share on other sites

it says

@setlocale(LC_TIME, 'sv_SE.ISO_8859-1');

define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
function tep_date_raw($date, $reverse = false) {
  if ($reverse) {
    return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
  } else {
    return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
  }
}


I do know I can change the DATE_FORMAT to YYMMDD without to mutch trouble.. its the last 4 extra numbers that is tricky

I looked in an old language file for another shop that was running with correct swedish "birth-date" ..it looked like this:

setlocale(LC_TIME, 'sv_SE.utf-8');
define('DATE_FORMAT_SHORT', '%Y-%m-%d');  // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'Y-m-d'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');


////
// Return date in raw format
// funktionens informat för $date är: YYYYMMDD-XXXX
// funktionens returvärde:	MMDDYYYY
function tep_pnummer_raw($date, $reverse = false) {
    return substr($date, 0, 4) .  substr($date, 4, 2) . substr($date, 6, 2) . substr($date, 8, 5);
}

It looks like the big diffrence here is the function "tep_pnummer_raw" <-old one  or "tep_date_raw" <-new one (dont know why these functions have diffrent names...)

It has 4 substings insted of 3(as my current swedish.php)
But I dont know how to go from here :S

 

Again, the format I want the form to accept is YYMMDD-XXXX

Would be great if you can help me with this :)

Link to comment
Share on other sites

Thoes are personal numbers.

All swedish citizents have them.. I guess its a form of social security number.

Every swedish person have a unique one.. mine is YYMMDD-7016. The for last once is radom but gives you a unique id nr.

 

This is used for alot of things in sweden. For example when sending invoice to someone or if I as a company would like to get credit report on a potential customer.

Its very usefull.

 

Edit: they are not totaly radom btw. There is some form of validateing thoes 4 numbers but that is not important. E.g. the 3:e of the 4 numbers determine gender. An odd number means I am a male.

Link to comment
Share on other sites

Ah! Cool! Didn't know that. Learned something new today. :thumbsup:

 

I found this addon.

 

http://addons.oscommerce.com/info/2748/category,all/search,personnr

 

It is old(er) so can't tell you if it would work with osC 2.3.4.

Just backup your shop data and database before trying to install it.

 

Might be also important:

 

http://www.oscommerce.com/forums/topic/98653-dissapointing-does-anyone-know/

Link to comment
Share on other sites

Ah! Cool! Didn't know that. Learned something new today. :thumbsup:

 

I found this addon.

 

http://addons.oscommerce.com/info/2748/category,all/search,personnr

 

It is old(er) so can't tell you if it would work with osC 2.3.4.

Just backup your shop data and database before trying to install it.

 

Might be also important:

 

http://www.oscommerce.com/forums/topic/98653-dissapointing-does-anyone-know/

Wow, this one gave me an headache :P

Been trying but it seems hard to implement on 2.3.4

 

I am about to give up on this matter.

Thinking of just using one of the other feild that I dont need and prompt the customer to add "personal nr" in that field.

 

Think that will work?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...