How To Set Default Product Option

Hello all! We use to have CS-Cart 3.05 and on the product options the first one in the option variant would show as default to the customer. Now that we have upgraded to the latest version of cs-cart it no longer sets the first option variant as the default. Instead is says "Please, select one". Is there a way to have is have the first variant set? For example if we have two sizes available one "Small" and one "Large" the Small variant would be set to default. Note that When set to "Required" is when the "Please, select one" appears as the first selection. I'll attach screenshot for reference.

https://drive.google.com/file/d/1IvcpA9CqdEHKTmexQZFJZQgMeh4Oy3pe/view?usp=sharing

Thanks for any feedback!

Mike

Hello, Mike!

You can comment out this part of the code in the design/themes/[active_theme]/templates/views/products/components/product_options.tpl file:

 {elseif $product.options_type == "ProductOptionsApplyOrder::SIMULTANEOUS"|enum}
                                {if !$po.value}
                                    
                                        {if $po.disabled || $disabled}
                                            {__("select_option_above")}
                                        {else}
                                            {__("please_select_one")}
                                        {/if}
                                    
                                {/if}

Clean up the templates cache after this.

Hello, Mike!

You can comment out this part of the code in the design/themes/[active_theme]/templates/views/products/components/product_options.tpl file:

Clean up the templates cache after this.

But in this case, options will not be selected, right? For example, price and weight modifiers will not be applied after page is loaded

I have checked this and the options with modifiers are selected.

But this condition means that the variant for this option is not selected. Isn't it?

{if !$po.value}

If variant is not selected, how can the system apply modifiers?

Hello, Mike!

You can comment out this part of the code in the design/themes/[active_theme]/templates/views/products/components/product_options.tpl file:

 {elseif $product.options_type == "ProductOptionsApplyOrder::SIMULTANEOUS"|enum}
                                {if !$po.value}
                                    
                                        {if $po.disabled || $disabled}
                                            {__("select_option_above")}
                                        {else}
                                            {__("please_select_one")}
                                        {/if}
                                    
                                {/if}

Clean up the templates cache after this.

Thank you for posting. Im trying to access the "design/themes/[active_theme]/templates/views/products/components/product_options.tpl file" in the Design->Templates->Bright Theme and for some reason I'm unable to access the file there. It shows that the "Bright Theme is my default. Can you let me know if I'm looking in the wrong place to locate the "Product_options.tpl" file? Please see screenshot for reference. Thank you and warm regards!

https://drive.google.com/file/d/1_MMEOgqd2q2J7eSaNRQ9UtR3snou4NT1/view?usp=sharing

Have you looked in your responsive or other themes, are you sure bright theme is your default

Change the same file in the responsive theme since responsive is parent theme for the bright one

Hello, Mike!

You can comment out this part of the code in the design/themes/[active_theme]/templates/views/products/components/product_options.tpl file:

 {elseif $product.options_type == "ProductOptionsApplyOrder::SIMULTANEOUS"|enum}
                                {if !$po.value}
                                    
                                        {if $po.disabled || $disabled}
                                            {__("select_option_above")}
                                        {else}
                                            {__("please_select_one")}
                                        {/if}
                                    
                                {/if}

Clean up the templates cache after this.

Hello,
Thank you again for your help. I tried commenting out this code however it still shows the "Please, select product". I'll include the code below. Did I coment it out correctly? Also I did clear the template cache. CS-Cart Version is 4.9.3.SP1

/*{elseif $product.options_type == "ProductOptionsApplyOrder::SIMULTANEOUS"|enum}
{if !$po.value}
{if $po.disabled || $disabled}
{__("select_option_above")}
{else}
{__("please_select_one")}
{/if}
{/if}*/

forgot to share screenshot

https://drive.google.com/file/d/1IvcpA9CqdEHKTmexQZFJZQgMeh4Oy3pe/view?usp=sharing

To comment out code in smarty replace

{elseif $product.options_type == "ProductOptionsApplyOrder::SIMULTANEOUS"|enum}
                                {if !$po.value}
                                    
                                        {if $po.disabled || $disabled}
                                            {__("select_option_above")}
                                        {else}
                                            {__("please_select_one")}
                                        {/if}
                                    
                                {/if}
with
{*elseif $product.options_type == "ProductOptionsApplyOrder::SIMULTANEOUS"|enum}
                                {if !$po.value}
                                    
                                        {if $po.disabled || $disabled}
                                            {__("select_option_above")}
                                        {else}
                                            {__("please_select_one")}
                                        {/if}
                                    *}
                                {/if}

Do not touch last if element

(!) Do not forget to clear cache