Jump to content
haroons

Can I force customer to select attribute?

Recommended Posts

Hi

 

A product has different sizes to choose from.

 

If the customer doesn't select a size and just presses add to cart the first size is automatically selected.

 

Is there a way to force the customer to select the size before adding to the cart?

 

I know you can disable add to cart when viewing products in lists but you can still add when viewing individual products.

 

Help appreciated, thanks in advance.

Share this post


Link to post
Share on other sites

Thanks but these dont work for 1.6

you may then want to post in job offers

Share this post


Link to post
Share on other sites

Haroons, 

 

Did you find the way to do it? Im having the same trouble and dont know how to fix it. Did you find any addon or module to solve it? Thanks a lot.. 

Share this post


Link to post
Share on other sites

I use a module that allow for required to be set for attributes but that is not the primary purpose of the module so a bit of overkill just to have this one feature. Presto-Chango Attribute Wizard Pro will do it for you but I would suggest looking around as there might be a simpler solution.

Share this post


Link to post
Share on other sites

Well guys i searched around and found this: http://www.prestashop.com/forums/topic/274265-how-to-enable-choose-size-text-in-drop-down-on-combinations/?p=1754797

 

I commented out the original code and added this in my product.tpl

<option value="choose" selected="selected" title="--choose--">{l s='--Please Select--'}</option>
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute|intval}" {if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute)} selected="selected" {/if} title="{$group_attribute|escape:'html':'UTF-8'}">
{$group_attribute|escape:'html':'UTF-8'}
</option>
{/foreach}

Then in back office i changed translation to:

This combination does not exist for this product. Please select another combination.=  "Please select your combinations !!!"

 

And lastly in themes/my_theme/css/product.css on line 747 changed colour to red

  background-color: #ff0000;

Seems to work with mutiple dropdowns as well

 

 

 

Please back-up before trying this on your own site..

post-535854-0-27001200-1413653693_thumb.jpg

post-535854-0-43518600-1413653701_thumb.jpg

  • Like 1

Share this post


Link to post
Share on other sites

You said you changed translation, I guess you changed the out of stock one, but then if you really have a product out of stock it will show please select? or can you change it only for the required product? 

Share this post


Link to post
Share on other sites

I changed this one:

This combination does not exist for this product. Please select another combination.=

It originally said something like " The product is not available in this combination but is available in another"

 

I havent tried this with lots of combinations so will be glad to hear from others.

 

Shall do some more testing on this and report back

Share this post


Link to post
Share on other sites

This only seems to work if you have attributes which are dropdowns.

It does not work with radio buttons or the colour picker.

 

Have removed this from my test site

 

Maybe someone will make a module for this!!!

  • Like 1

Share this post


Link to post
Share on other sites

Hey today i was thinking, maybe what you could do to improve your way is to make it so that when o specific attribute is not available any more, instead of showing your translated message, it cold just disappear hide, now i don't know how to write code so I can't help you there, but if you know you could give this a try, if you further want to improve your way. Let me know if it is clear, and what do you think.

 

Ex.

 

from

select attrib

attr 1 size a

attr 2 size b

attr 3 size c

 

to

select attrib

attr 1 size a

attr 3 size c

Share this post


Link to post
Share on other sites

Strange you can`t do this in prestashop it is normal in almost all other e-commerce..

 

Why do we have to choose a standard attribute? If not, that would almost solve the problem - And it IS a problem, costumers actually do forget to chose, and then it is on to costumerservice.

Edited by piercingpusher (see edit history)
  • Like 2

Share this post


Link to post
Share on other sites

Well interested in the outcome of this. I was actually building an ecommerce website based on prestashop but this problem has stopped me from doing so since all products I have are combination products (it really is not an option to make them all individual products...)

 

This definitely is a huge problem and will result in a negative user experience with all the consequences to follow...

  • Like 1

Share this post


Link to post
Share on other sites

If anyone is still interested i kind of solved it with half of "mickeyboy1" solution:

Change the translation:
This combination does not exist for this product. Please select another combination. To what ever you want/need 

​Than you need access to the database on line 5398:

 

INSERT INTO `ps_product_attribute_shop` (`id_product_attribute`, `id_shop`, `wholesale_price`, `price`, `ecotax`, `weight`, `unit_price_impact`, `default_on`, `minimal_quantity`, `available_date`) VALUES

 

And change this:

(7,1,0.000000,0.000000,0.000000,0.000000,0.00,1,1,'0000-00-00'),

to this:
(7,1,0.000000,0.000000,0.000000,0.000000,0.00,0,1,'0000-00-00'),
 
this way you need to do products one by one or
 
with phpMyAdmin go to ps_product_attribute_shop and change all the 1 to 0 in the "default on" column 
 
This way when you open the product, all the combination will be deselected and you get a warning message of what ever you put in the translation and if you have an out of stock product you will get the standard one with those attributes but is available with others.
 
 
Now i need some help in changing the background color of the message i know that it can be changed on:
themes/my_theme/css/product.css on line 747
But this will change both the message that you've just translated and the out of stock one, does anyone know how to make it so it would be 2 different color? Thanks
Edited by benedettopresta (see edit history)

Share this post


Link to post
Share on other sites

This issue realy needs attention from developers. This should be implemented by default.

  • Like 3

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More