Sorry my site is down at the moment and i am unable to link it, but basically. When purchasing a product, i added options , for example
Processor 0
Processor 1 +250
Processor 2 +300
When the customer selects the product, the drop-down box shows the following
---please select----
Processor 0
Processor 1 + 250
Processor 2 + 300
Where --please select-- is the default selection. I would like to set a default selection for the product if the customer makes no action.
This can be clearly seen on open cart's demo site.
http://demo.opencart.com/index.php?rout ... duct_id=42
The page loads with no default selections on any of the options. Can i set a default?
Thank you for the help!.
Processor 0
Processor 1 +250
Processor 2 +300
When the customer selects the product, the drop-down box shows the following
---please select----
Processor 0
Processor 1 + 250
Processor 2 + 300
Where --please select-- is the default selection. I would like to set a default selection for the product if the customer makes no action.
This can be clearly seen on open cart's demo site.
http://demo.opencart.com/index.php?rout ... duct_id=42
The page loads with no default selections on any of the options. Can i set a default?
Thank you for the help!.
Edit the file catalog/view/theme/yourtheme/template/product/product.tpl
and look into this piece of code
and look into this piece of code
The line that you see highlited (<option value=""><?php echo $text_select; ?></option>) delete that and then the default option will be the first one entered in admin.<?php if ($option['type'] == 'select') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<select name="option[<?php echo $option['product_option_id']; ?>]">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($option['option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</option>
<?php } ?>
</select>
</div>
<br />
<?php } ?>
My Extensions - SuperTheme - Opencart templates - Opencart modules
v 1.51.
Overview - Under the next option (radio) modify as outlined here. Put a flag and set to 1, check with if and echo cheked for first run through loop, then set flag to 2,
<?php if ($option['type'] == 'radio') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name'];
// Set the flag
$checkit = 1; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="radio" name="option[<?php echo $option['product_option_id']; ?>]"
// echo if it's the first radio
<?php if($checkit ==1) echo "checked=\"1\"" ?>
value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
<br />
<?php
// set flag to 2 so it doesn't check next radio
$checkit = 2; } ?>
</div>
<br />
<?php } ?>
Overview - Under the next option (radio) modify as outlined here. Put a flag and set to 1, check with if and echo cheked for first run through loop, then set flag to 2,
<?php if ($option['type'] == 'radio') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name'];
// Set the flag
$checkit = 1; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="radio" name="option[<?php echo $option['product_option_id']; ?>]"
// echo if it's the first radio
<?php if($checkit ==1) echo "checked=\"1\"" ?>
value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
<br />
<?php
// set flag to 2 so it doesn't check next radio
$checkit = 2; } ?>
</div>
<br />
<?php } ?>
Sorry to dig up such an old thread but it seemed relevant.
I want to change the select list from "Please Select" but instead of the first option I want the second option selected by default on a great many of my products. Is this possible?
I have all my options sorted by price and I would prefer to keep them that way however my cheapest option is a small sample of my product that isn't really a good example of the starting price of my products
Example list
Sample $2
Regular $10
Large $15
X Large $20
Most customers buy regular and there is no real value in defaulting to the Sample price
Of course to make it even more difficult there may be times when I don't want to do this and would prefer to default to the first option as some of my products don't have sample options
If anyone has any ideas I'd appreciate it
I want to change the select list from "Please Select" but instead of the first option I want the second option selected by default on a great many of my products. Is this possible?
I have all my options sorted by price and I would prefer to keep them that way however my cheapest option is a small sample of my product that isn't really a good example of the starting price of my products
Example list
Sample $2
Regular $10
Large $15
X Large $20
Most customers buy regular and there is no real value in defaulting to the Sample price
Of course to make it even more difficult there may be times when I don't want to do this and would prefer to default to the first option as some of my products don't have sample options
If anyone has any ideas I'd appreciate it
I would just adjust the sort order of your options (eg: set "Sample" sort to 9999)
--------------------------------------------------
My Blog ↔ My Extensions ↔ OpenCart Templates
Hi, please how to solve this problem? Deleting line 86 in product.tpl: does not work in 1.5.6.1 
Code: Select all
<option value=""><?php echo $text_select; ?></option>

How does it not work? Is there some error, something breaks? because since the please select option is not there anymore it cant still apear.
My Extensions - SuperTheme - Opencart templates - Opencart modules
Thanks for the reply, it turns out the options settings extension I'm using was putting it back in via vqmod. Now sorted.
Hey guys,
I know this is an old thread, but how would I modify the coding to work on OpenCart 2.0.3? I have been trying to implement this into the product.tpl document of my OpenCart 2.0.3 installation and I just don't have the know-how to achieve this successfully. I only want this to apply to the radio options.
Assistance will be greatly appreciated. Thanks.
I know this is an old thread, but how would I modify the coding to work on OpenCart 2.0.3? I have been trying to implement this into the product.tpl document of my OpenCart 2.0.3 installation and I just don't have the know-how to achieve this successfully. I only want this to apply to the radio options.
Assistance will be greatly appreciated. Thanks.
Hello,
Even though its an old thread i tried it in ver 2.3.0.2 and nothing happens.
I removed ( <option value=""><?php echo $text_select; ?></option> ) and the "Please select" option remains.
Any ideas on how to do it??
Thank you.
Even though its an old thread i tried it in ver 2.3.0.2 and nothing happens.
I removed ( <option value=""><?php echo $text_select; ?></option> ) and the "Please select" option remains.
Any ideas on how to do it??
Thank you.
Who is online
Users browsing this forum: No registered users and 41 guests