Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products attributes price individually


sinopia

Recommended Posts

Hi, I've been searching but didn't find anything like this. I was trying to output a specific attribute price in product_info page.

For example: 

SELECT products_id, options_id, options_values_id, options_values_price, price_prefix FROM products_attributes WHERE products_id = '2886'

 

Array
(
    [products_id] => 2886
    [options_id] => 23
    [options_values_id] => 194
    [options_values_price] => 12.4583
    [price_prefix] => +
)

I just wanted a easily code without doing new mysql query, something like $product_attribute_price['23']['194'] // 13€ and $product_attribute_price['23']['195'] // 20€.

The normal function of osCommerce show the select with options with price but I was looking with a specific options_id and options_values_id

Best regards.

Link to comment
Share on other sites

osCommerce outputs like this:

             <tr>
              <td style="border-bottom: 1px #CCC dashed;" colspan="2" class="inmain" style="padding-top: 0px; padding-bottom: 0px">
              <table cellpadding="0" cellspacing="0">
                <tr>
                  <td>s_conjunto:</td>
                  <td align="right"><select name="id[22]"><option value="189">s_conjunto_hoodie</option><option value="188">s_conjunto_sweatshirt</option><option value="187">s_conjunto_tshirt</option><option value="193">s_conjunto_tshirt_mulher</option></select></td>
                </tr>
              </table>
      </td>
      </tr>

<script type="text/javascript">
<!--
$(function() {
$('#s_conjunto2_hoodiexx').css('display', 'inline-block');
});
//-->
</script>

<script type="text/javascript">
<!--
$(function() {
$('#s_conjunto2_sweatshirtxx').css('display', 'inline-block');
});
//-->
</script>

Couldn't this be like: <option value="187" data-price="13"> ?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...