Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

default --Please Select-- for product attributes


nickoleg

Recommended Posts

Posted

I'm setting up a store that has a ton of attributes for a lot of different products. And since these are custom orders, I need to make sure that the user actually picks their desired attribute and no default or random attributes show up in the cart. SO... is there a way that each product attribute dropdown can have a default -- Select -- as the first option?

Posted

Not sure how well this works so you may want to test it out first.

 

In catalog/product_info.php find

		$products_options_array = array();

Just below that add

		$products_options_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);

Posted

Brian -

 

Thanks for the help. This is what it did...

 

Made the top choice on the dropdown blank (which I'm fine with). But if you hit "add to cart" button without selecting something for EACH dropdown it takes you to the cart but does NOT add the product. And, of course there is no explination why. It took me 3-4 times to figure it out.

 

Wonder if there is another solution out there? Any and all help is greatly appreciated.

Posted

In a stock osc the above code should display Please Select or PULL_DOWN)DEFAULT. The part I was concerned about is what would happen if you clicked add to cart with that being selected. Is what happens is there is no id set to the option value. That is why you get your shopping cart page saying there are no products. I'm not sure what the work around would be.

 

Maybe you could use some javascript of ajax to check if the id firld is set.

  • 2 weeks later...

Archived

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

×
×
  • Create New...