Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6835141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:11:49+00:00 2026-05-26T23:11:49+00:00

I’m working through some touches on an e-commerce site for someone and have run

  • 0

I’m working through some touches on an e-commerce site for someone and have run into something I’m not sure about. The product page currently has radio buttons for choosing a product size. I had a drop down menu in before. The client wants styled square buttons similar to those on here.

Section of my code currently reads…

<td valign="top" width="910">
<div id="content"><?php echo $content_top; ?>
<h1><?php echo $heading_title; ?></h1>

<div class="right">


 <?php if ($price) { ?>
  <div class="price">
    <?php if (!$special) { ?>
    <?php echo $price; ?>
    <?php } else { ?>
    <span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
    <?php } ?>
    <br />

    <?php if ($tax) { ?>

    <?php } ?>
    <?php if ($points) { ?>
    <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span> <br />
    <?php } ?>
    <?php if ($discounts) { ?>
    <br />
    <div class="discount">
      <?php foreach ($discounts as $discount) { ?>
      <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
      <?php } ?>
    </div>
    <?php } ?>
  </div>





  <?php
$get_meta_desc = "SELECT meta_description
FROM product_description
WHERE product_id = '".$product_id."'";
$get_meta_res = mysql_query($get_meta_desc);
$meta_desc = mysql_fetch_array($get_meta_res, MYSQL_ASSOC);
if ($meta_desc['meta_description']) {
echo "<p id=\"cmmeta-desc\">".$meta_desc['meta_description']."</p>";
}
mysql_free_result($get_meta_res);
?>


  <?php } ?>
  <?php if ($options) { ?>
  <div class="options">



    <?php foreach ($options as $option) { ?>
    <?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 } ?>
    <?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']; ?>:</b><br />
      <?php foreach ($option['option_value'] as $option_value) { ?>
      <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" 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 } ?>
    </div>
    <br />
    <?php } ?>
    <?php if ($option['type'] == 'checkbox') { ?>
    <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 />
      <?php foreach ($option['option_value'] as $option_value) { ?>
      <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" 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 } ?>
    </div>
    <br />
    <?php } ?>
    <?php if ($option['type'] == 'text') { ?>
    <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 />
      <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
    </div>
    <br />
    <?php } ?>
    <?php if ($option['type'] == 'textarea') { ?>
    <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 />
      <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
    </div>
    <br />
    <?php } ?>
    <?php if ($option['type'] == 'file') { ?>
    <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 />
      <a id="button-option-<?php echo $option['product_option_id']; ?>" class="button"><span><?php echo $button_upload; ?></span></a>
      <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
    </div>
    <br />
    <?php } ?>
    <?php if ($option['type'] == 'date') { ?>
    <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 />
      <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
    </div>
    <br />
    <?php } ?>
    <?php if ($option['type'] == 'datetime') { ?>
    <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 />
      <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
    </div>
    <br />
    <?php } ?>
    <?php if ($option['type'] == 'time') { ?>
    <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 />
      <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
    </div>

    <?php } ?>
    <?php } ?>
  </div>
  <?php } ?>
  <div class="cart">
    <div><?php echo $text_qty; ?>
      <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
      <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
      &nbsp;<a id="button-cart" class="button2"><span>ADD TO BAG</span></a></div>



    <?php if ($minimum > 1) { ?>
    <div class="minimum"><?php echo $text_minimum; ?></div>
    <?php } ?>
  </div>

Never really done anything like these before…

Many Thanks
L

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:11:49+00:00Added an answer on May 26, 2026 at 11:11 pm

    This is a really good tutorial on styling radio buttons.

    http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

    From there you can get what your after pretty easily 🙂

    Hope this helps you out!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.