OpenCart attaches an html value=""
attribute to each <option>
for <select>
elements on Product pages. Currently it uses product_option_value_id
. I need to change that to use the option_value_id
from the oc_product_option_value
table.
I have created a vQmod to replace this line in my theme's product.tpl
file.
<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
I tried using $option_value['option_value_id'];
but that returns the product_option_id
? I can't figure out what variable to use to achieve this for select options.
Do I need to write a new query to grab this data, or is this data in a variable that is visible already in product.tpl
?
These are the contents of $this->data['options']
array:
Array
(
[0] => Array
[product_option_id] => 300
[option_id] => 5
[name] => Select
[type] => select
[option_value] => Array
[0] => Array
[product_option_value_id] => 110
[option_value_id] => 39
[name] => Red
[image] =>
[price] =>
[price_prefix] => +
[1] => Array
[product_option_value_id] => 109
[option_value_id] => 40
[name] => Blue
[image] =>
[price] =>
[price_prefix] => +
[required] => 1
[option_id]
and [option_value_id]
are constant for all products that have this option assigned. Is this what you are looking for?