Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 *How did you hear about us? dropdown
Author « Topic »  

dano2
Ecommerce Template Expert

USA
514 Posts

Pre-sales questions only
(More Details...)

Posted - 04/23/2020 :  07:33:09  
Hi, is it possible to add a couple more *How did you hear about us? to that dropdown?right now it just shows google and yahoo.

thanks in advance

Marshall
Ecommerce Template Guru

USA
1909 Posts

Posted - 04/23/2020 :  08:49:55  
Should be in your includes.php file. Just follow the coding format already in place.

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

dano2
Ecommerce Template Expert

USA
514 Posts

Pre-sales questions only
(More Details...)

Posted - 04/24/2020 :  09:13:50  
ok thank got it. However now, looks like its not resetting back to "Please Select" its remaining at the last one selected in the dropdown for example Yahoo or Google....

Edited by - dano2 on 04/24/2020 09:16:18

Marshall
Ecommerce Template Guru

USA
1909 Posts

Posted - 04/24/2020 :  10:09:15  
Can you put the code from your includes.php for the drop down here?

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 04/24/2020 :  10:18:48  
Hi dano2

This is the code used in includes.php for one of the sites I look after and works fine. If you replicate that and adjust to your needs that should work fine

$extracheckoutfield1="How did you hear about us?";
$extracheckoutfield1required=TRUE;
$extracheckoutfield1html="<select name=\"ectfield\" size=\"1\"><option value=\"\">Please Select...</option><option value=\"Google\">Google</option><option value=\"Facebook\">Facebook</option><option value=\"Twitter\">Twitter</option>
<option value=\"Returning Customer\">Returning Customer`</option><option value=\"Yahoo\">Yahoo</option><option value=\"Bing\">Bing</option><option value=\"Word of Mouth\">Word of Mouth`</option><option value=\"Trade Ad\">Trade Advertisement</option><option value=\"Other Search Engine\">Other Search Engine</option></select>";


Steve


Remember - Any edits to the ectcart.css file will be overwritten by updater's. ALL edits to ectcart.css rules should be placed in your style.css file

Edited by - 1818charlie on 04/24/2020 14:30:00

dano2
Ecommerce Template Expert

USA
514 Posts

Pre-sales questions only
(More Details...)

Posted - 04/24/2020 :  12:40:55  
Here is what I have in my code

$GLOBALS['extracheckoutfield1']="How did you hear about us?";
$GLOBALS['extracheckoutfield1required']=TRUE;
$GLOBALS['extracheckoutfield1html']="<select name=\"ectfield\" size=\"1\"><option value=\"\">Please Select...</option><option value=\"Google\">Google</option><option value=\"Yahoo\">Yahoo</option><option value=\"Bing\">Bing</option><option value=\"Facebook\">Facebook</option></select>";

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 04/24/2020 :  13:49:08  
Hi dano2

Remove the three $GLOBALS[' & just add $ to the start of the three lines, as in the example I posted. As I say that works fine for the site's I have setup.

Also, bear in mind that if you don't want the extra checkout / order fields to appear on the printable invoice or packing slip, use the following in includes.php
$extraorderfield1noprint=TRUE;
$extraorderfield2noprint=TRUE;
$extracheckoutfield1noprint=TRUE;
$extracheckoutfield2noprint=TRUE;

For that you must be running a minimum ECT version of 6.6.3

Steve
Bolton, Lancashire, UK

Remember - Any edits to the ectcart.css file will be overwritten by updater's. ALL edits to ectcart.css rules should be placed in your style.css file

Edited by - 1818charlie on 04/24/2020 13:55:57

insight
ECT Moderator

USA
4479 Posts

Posted - 04/24/2020 :  14:10:52  
quote:
Remove the three $GLOBALS[' & just add $ to the start of the three lines, as in the example I posted.

There isn't anything wrong with what he has there already, though. Probably just the browser remembering prior choices...

Peter


Professional ecommerce web hosting services
Shared hosting Windows & Linux | Dedicated servers | Domains | SSL
Ecommerce Templates specialists since 2003
https://servelink.com

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 04/24/2020 :  14:28:00  
Hi Peter

The online PHP Parameters help page https://www.ecommercetemplates.com/phphelp/ecommplus/parameters.asp doesn't make mention of the GLOBALS for the fields, unless it's for WordPress.

I know if an entry is copied from the language file to the includes file then the GLOBALS is required; that's my understanding.

Steve


Remember - Any edits to the ectcart.css file will be overwritten by updater's. ALL edits to ectcart.css rules should be placed in your style.css file

Edited by - 1818charlie on 04/24/2020 14:29:41

dano2
Ecommerce Template Expert

USA
514 Posts

Pre-sales questions only
(More Details...)

Posted - 04/24/2020 :  14:53:41  
ok so I actually copied the same code that Steve has. It works fine but it still doesn't default back to Please select. I also tried it on another computer and did a F5 first...

insight
ECT Moderator

USA
4479 Posts

Posted - 04/24/2020 :  15:01:41  
quote:
The online PHP Parameters help page https://www.ecommercetemplates.com/phphelp/ecommplus/parameters.asp doesn't make mention of the GLOBALS for the fields, unless it's for WordPress.

I know if an entry is copied from the language file to the includes file then the GLOBALS is required; that's my understanding.

Neither of those statements are true, actually. While $GLOBALS is required for WordPress, it'll work just fine for the PHP cart also. The alternate style $parameter and $xxLanguage both work with the PHP cart only.

Peter


Professional ecommerce web hosting services
Shared hosting Windows & Linux | Dedicated servers | Domains | SSL
Ecommerce Templates specialists since 2003
https://servelink.com

Edited by - insight on 04/24/2020 15:03:22

insight
ECT Moderator

USA
4479 Posts

Posted - 04/24/2020 :  15:21:22  
quote:
It works fine but it still doesn't default back to Please select. I also tried it on another computer and did a F5 first.

Clear your cookies for the site and it'll behave as expected with "please select". If the same choice is presented on a return visit it doesn't really matter, as the original source of the customer won't be something that ever changes, saves them choosing that same option again.

Although I seriously doubt the value of a "how did you hear about us" thing anyway; I'd just pick a random choice and move to the next required input if it was me, not wasting time cruising through a list and picking an answer. You should get that information from your tracking/analytics and the referer in the order detail page.

Peter


Professional ecommerce web hosting services
Shared hosting Windows & Linux | Dedicated servers | Domains | SSL
Ecommerce Templates specialists since 2003
https://servelink.com

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 04/24/2020 :  15:21:32  
I'm no 'PHPologist' and I accept what you are saying.
quote:
Neither of those statements are true, actually

In that case the page needs amending. If either or will give the same end result, that's fine.
quote:
I know if an entry is copied from the language file to the includes file then the GLOBALS is required; that's my understanding.

Going back a few years, I can't say how many, that is what Andy posted quite a while back. If an entry from the language file is being reworded then add the entry to the includes file exactly and just amend the wording for the site in question, thus saving any issue with overwrites from the updaters.

Steve
Manchester England

Remember - Any edits to the ectcart.css file will be overwritten by updater's. ALL edits to ectcart.css rules should be placed in your style.css file

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 04/24/2020 :  15:46:42  
quote:
dano2 - ok so I actually copied the same code that Steve has. It works fine but it still doesn't default back to Please select. I also tried it on another computer and did a F5 first...

Hi Dano

On your safety pro shop site I added 1/2oz Inert Practice Defensive Spray to be shipped to the ZipCode 90505, and then when I get to the checkout to put in shipping details I scroll down to how did you hear about us and select Yahoo. Refreshing the page does clear the Yahoo selection and shows Please Select, so as far as I can tell it is working the same as the sites I manage and my ECT test site

Steve
Manchester England

Remember - Any edits to the ectcart.css file will be overwritten by updater's. ALL edits to ectcart.css rules should be placed in your style.css file

Edited by - 1818charlie on 04/24/2020 15:48:50

dano2
Ecommerce Template Expert

USA
514 Posts

Pre-sales questions only
(More Details...)

Posted - 04/24/2020 :  16:14:37  
thanks Guys and thanks Steve, I am good then with the way it works.. thanks for all the help and looking into this!! much appreciated everyone

insight
ECT Moderator

USA
4479 Posts

Posted - 04/24/2020 :  16:43:16  
quote:
If either or will give the same end result, that's fine.

Yes, that's right, with the PHP cart either/or will give the same result. If you want to modify a language file entry, then sure, you copy the line into the includes file to avoid overwrites. But it doesn't matter whether it's written as $GLOBALS or $xxLanguage, whatever you have will be fine for the PHP cart.


Peter


Professional ecommerce web hosting services
Shared hosting Windows & Linux | Dedicated servers | Domains | SSL
Ecommerce Templates specialists since 2003
https://servelink.com

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 04/24/2020 :  17:32:56  
Hi Peter

Thanks for that. As the old saying goes, every day is a school day!

Steve
Manchester England

Remember - Any edits to the ectcart.css file will be overwritten by updater's. ALL edits to ectcart.css rules should be placed in your style.css file
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000