CRE Loaded Community

Banner


Board index » Web Design and Development » Development Discussions

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Required Code
PostPosted: Fri Sep 23, 2011 12:10 pm 
Offline
CRE Newbie

Joined: Fri Sep 23, 2011 11:57 am
Posts: 4
Hello,

I'm looking to get a require code so my customers are forced to choose colors to the items there are ordering.

Any help would be appriciated.


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Fri Sep 23, 2011 8:15 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
Well, this sort of thing happens in the account creation area where certain fields are 'required' right?
So why not check to see how it does this there - it's all going to depend on the form you're using for specific code of course, but that'd give you a basic idea.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Sat Sep 24, 2011 4:10 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
Margarita_Happy-Feet wrote:
Hello,

I'm looking to get a require code so my customers are forced to choose colors to the items there are ordering.

Any help would be appriciated.



I'm assuming you mean they must select an attribute(colour) before they can add a product to their cart from the product info page?

Something like this, follow the link below and try adding the product to you basket without selecting a colour or size.. you are returned to the product page, with a warning on you must select an attribute..

http://mdjl40.mdjl-demo.co.uk/product_i ... ducts_id=1

I cant believe that this has not been implemented yet in the 6.4 series!!

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Sat Sep 24, 2011 4:40 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
TheLango wrote:
Margarita_Happy-Feet wrote:
Hello,

I'm looking to get a require code so my customers are forced to choose colors to the items there are ordering.

Any help would be appriciated.



I'm assuming you mean they must select an attribute(colour) before they can add a product to their cart from the product info page?

Something like this, follow the link below and try adding the product to you basket without selecting a colour or size.. you are returned to the product page, with a warning on you must select an attribute..

http://mdjl40.mdjl-demo.co.uk/product_i ... ducts_id=1

I cant believe that this has not been implemented yet in the 6.4 series!!

Sure you could do that - but the first attribute (which you'd probably make the best selling one) would be selected by default anyway, so if the customer didn't want the first one then they'd have to choose another. This would apply to radio button, dropdown selects etc so unless you made one of the actual options 'Please select' they'd always have something chosen. So adding in a 'required' field isn't really going to work - the first option is always selected anyway (unless you've made 'Please select' an option.)

Simon

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Sat Sep 24, 2011 4:53 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
soundzgood2 wrote:
Sure you could do that - but the first attribute (which you'd probably make the best selling one) would be selected by default anyway, so if the customer didn't want the first one then they'd have to choose another.


Why would you have the best selling attribute pre selected, the whole purpose of what "Margarita_Happy-Feet " wants is to make sure the customer chooses which colour THEY want
soundzgood2 wrote:
This would apply to radio button, dropdown selects etc so unless you made one of the actual options 'Please select' they'd always have something chosen. So adding in a 'required' field isn't really going to work - the first option is always selected anyway (unless you've made 'Please select' an option.)

Simon


Thats exactly what has been done albeit a different wording (Please Select" - "Select One")


class Attributes - case 0: -
Code:
$tmp_html = '<select name="' . $name . '">';
       $tmp_html .= '<option>-- Select One --</option>';


Then in application_top put a check into the add_product to make sure an actual attribute for this spcific product has been selected..

To be honest Simon, I'm not sure what you are saying in your reply?

Paul

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Sat Sep 24, 2011 5:02 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
Not sure if we're talking about the same thing here - please select is to the left of the actual options right?
What I'm saying is that by default the first option is preselected anyway, so how would a 'required' field work?
Attributes don't go through blank ... well they don't on my 641a CE/Pro/B2B versions. Mind you, they're pretty modified over time.

Generally, the less effort the customer has to make with the least amount of popup warnings (which only alarm people and then they'll probably bail out) is better - if the first attribute is preselected and this happens to be the one that sells the most then wouldn't that make things quicker? Sure the customer who doesn't want the first option would then (probably) have the nounce to choose the one they want right.

(Have you checked a 641a version with attributes? How do you not get one preselected?)

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Tue Sep 27, 2011 11:27 am 
Offline
CRE Newbie

Joined: Fri Sep 23, 2011 11:57 am
Posts: 4
I have drop down menus in which they have to oick from and a radio button to identify if they want lefts only or rights only or a right and left.

In the drop down menus I have made a black attribute so the customers have to choose something.

I also I a fill in the blank in which some customers are limited to a certain amount, through some customers have to fill in the limit of 3 but only use up to 2, which is something I wanted to avoid.

If there is a limit of 3 then I need a code that will make them fill the 3 initials prior to adding the item to the cart.

Where would I put the codes?

I know how to log into the coding and change or add things as I need but I'm not really good with this. (PHP5 coding)

To get more of an idea of what I'm talking about take a look at the items on my website please. http://www.xraymarkers4you.com

If you see something on the site that you think would also help, I am open to suggestions.

Thanks for all of your replies. =]


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Tue Sep 27, 2011 11:36 am 
Offline
CRE Newbie

Joined: Fri Sep 23, 2011 11:57 am
Posts: 4
A more exact place for the items I'm talking about are as follow:

http://www.xraymarkers4you.com/product_info.php?cPath=4&products_id=26&osCsid=hmcc7v0lo330d01o91jks90f50

http://www.xraymarkers4you.com/product_info.php?cPath=4&products_id=29


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Wed Sep 28, 2011 3:10 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
Ok so with radio buttons (as you have with 1. on your first example page) I'd make one selected by default ... it's not really a good idea to use radio buttons and have none selected. The Lango is quite right - Cre doesn't have this coded in with radio buttons, and it's a mistake.

So here's some basic code that you can copy into /includes/classes/creAttributes.php that will make the first radio button selected by default. Remeber you can use attribute sort order to change which is the first option.

Code:
case 2:
          $tmp_html = '';
          $i = 0;
          foreach ( $this->values[$oID] as $vID => $ov_data ) {
          $i++;
            if ( (float)$ov_data['price'] == 0 ) {
              $price = '&nbsp;';
            } else {
              $price = '(&nbsp;' . $ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate) . '&nbsp;)';
            }
           
            if (defined('PRODUCT_INFO_SUB_PRODUCT_ATTRIBUTES') && PRODUCT_INFO_SUB_PRODUCT_ATTRIBUTES == 'True' ) {
              $name = 'id[' . $this->products_id . '][' . $oID . '][r]';
            } else {
              $name = 'id[' . $oID . ']';
            }
           if ($i === 1) {
            $tmp_html .= '<input type="radio" name="' . $name . '" value="' . $vID . '" checked="checked">' . $ov_data['name'] . '&nbsp;' . $price . '<br>';
           } else {
            $tmp_html .= '<input type="radio" name="' . $name . '" value="' . $vID . '">' . $ov_data['name'] . '&nbsp;' . $price . '<br>';
            }
       } // End of foreach option value
         
          $label = $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br><span class="smallText">' . $op_data['instructions'] . '</span>' : '' );
         
          $this->HTML_tags[] = array('label' => $label, 'HTML' => $tmp_html);
          break;

As for all the dropdowns where you have blanks - why? You'd either use 'Please select' in there OR remove the blank / please select altogether and go in with the first option. If the customer doesn't change this then that's what'll end up in the cart selected - that's how dropdown menus work.

The checkboxes could be handled the same way as the radio buttons.

My theory on customer selections VS popup warnings is that'd be better to get the customer to decide by changing a preselected choice than blasting them with a warning about not selecting anything at all. After all, it's their decision right?

The attribute in there that would need a 'required' check would be the 7. provide initials / numbers ... which could be solved by my original post (ie checking how this is done in eg create account)

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Required Code
PostPosted: Thu Oct 27, 2011 5:21 pm 
Offline
CRE Freak

Joined: Sat Aug 01, 2009 9:54 am
Posts: 36
Quote:
My theory on customer selections VS popup warnings is that'd be better to get the customer to decide by changing a preselected choice than blasting them with a warning about not selecting anything at all. After all, it's their decision right?
Soundzgood, the problem is you're assuming the customer is always paying attention to everything on the page, and not just skimming through and hitting Add to Cart. That's the customer's fault of course but that kind of unchecked shopping leads to returns and exchanges and can be compounded if the order needs to be shipped, and that's all extra time and effort on our end that could have been avoided.

I get that sometimes it's better to just make sure the customer gets from start to finish as quickly and smoothly as possible but sometimes you've got to slow them down for their own good. We shopping cart admins should be able to choose if we want a product option to be "required to select from a list first" or just "default to the first option on the list" and I wish this was already built into the CRE shopping cart.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

Board index » Web Design and Development » Development Discussions

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Thu May 17, 2012 8:47 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy