I am building a custom shirt builder for a website http://mytempsite.net/gotie/mixandmatch
What I have setup is step one, they will select a shirt color from 12 different shirts and then move on to the next step where they will be able to choose a tie. I need to be able to pass a variable to that next page telling it to only pull images with ties on it for example the red shirt.
My thought of doing this is by having that attribute at the image alt or title tag and then getting that attribute from the current image that is being displayed.
What i need to know is how?
i tried using this code as a start
<?php
$url=$this->helper('core/url')->getCurrentUrl();;
$html = file_get_contents($url);
$doc = new DOMDocument();
@$doc->loadHTML($html);
$divs = $doc->getElementByID('loadarea');
foreach ($divs as $div) {
echo "Found the loadarea div <br />";
}
?>
but it didn't work, and it also caused my page to load really slowly.
just in case here is code to thumbnails
<?php
$products = Mage::getModel('catalog/product')->getCollection();
foreach($products as $prod) {
$product = Mage::getModel('catalog/product')->load($prod->getId());
$pro_title = $product->getName();
$img = $product->getImageUrl();
echo "<a href='".$img."' title='".$pro_title."' rel='enlargeimage' rev='targetdiv:loadarea,enabletitle:no,trigger:click,preload:none,fx:fade'><img src='".$img."' width='100px'/></a>";
}?>
I hope that i worded this question correctly as to not be too localized. If so i will reword it.