I have the form that generate value of the variable $sku. Depending on how the form is filled the variable can take several values: $sku = 'product1', $sku = 'product2', $sku = 'product3' etc. How can I pass this value to my phtml template which contains the following code?:
<?php
$sku = ?????
$model = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect(array('price','name','description', 'thumbnail'))
->addAttributeToFilter('sku', '$sku')
->getFirstItem();
$price = $model->getPrice();
$name = $model->getName();
$image = $model->getThumbnail();
$description = $model->getDescription();
?>
My javascript:
$j("#wizard-start").show();
if ($j("#choice1").click(function () {
$j("#wizard-start").hide();
$j("#step-2-basic").fadeIn(1e3);
$j("#dyn-wizard").submit(function(event) {
var sku = "product1";
});
return false
}));
if ($j("#choice2").click(function () {
$j("#wizard-start").hide();
$j("#step-2-standart").fadeIn(1e3);
$j("#dyn-wizard").submit(function(event) {
var sku = "product2";
});
return false
}));
if ($j("#choice3").click(function () {
$j("#wizard-start").hide();
$j("#step-2-advanced").fadeIn(1e3);
$j("#dyn-wizard").submit(function(event) {
var sku = "product3";
});
return false
}));