Jump to content

Replacing current 'style' selector math with an array?


robk

Recommended Posts

I have no php knowledge whatsoever. I can cut and paste and make minor changes if I read enough. That being said, I am seeking an answer to my current problem changing http://demo.rockettheme.com/dec08/ into a product selector. Currently the menu shown hanging in the sign at the top right just changes the css files based on this code.

 

 <select name="tstyle" id="variation_chooser" class="button" style="float: left;">
            <?php
            for ($x=1;$x<=6;$x++) {
                echo "<option value=\"style$x\"" . getSelected('style'. $x) .">Style $x</option>\n";
            }
            ?>
        </select>

 

 

I am trying to change it so that I can get the selector to go to a specific url based on the name of the product like this (except for the math part of the code)

 

getSelected('style'. $x) .">One Fish $x</option>\n";
getSelected('style'. $x) .">Two Fish $x</option>\n";
getSelected('style'. $x) .">Red Fish $x</option>\n";
getSelected('style'. $x) .">Blue Fish $x</option>\n";

 

I realize this is probably not enough information to answer my question or that I might not even be asking the question properly. There are a couple files that make up the process but I could not see where to attach them here in the posting interface.

 

Can anyone point me in the right direction to get assistance with this? It's very important to me.

Well, correct me if I'm off,  by the sounds of it you want them to select from the drop down and then submit the form which will then take them to the page/product they selected.

what you could do it create a page that processes their selection and then forwards them to that page.

<?php
$prod = intval($_GET['prod']);
if($prod <= 0){
die('Please Select A Product.');
} else{
header('location: products.php?pid='.$prod); die();
}
?>

that code is not ready to be thrown into your mix, its just an example.

Seeings that you don't know much php, this may require you learning some more or hiring some one as what you are talking about won't be minor little quarks but rather will require new code.

 

Hope this reply helps

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.