0
votes

I am using magento 1.7 .Let me explain step by step:- 1. Clicked on any product from product list. app\design\frontend\base\default\template\catalog\product\view.phtml

<form action="http://abc.local/prescriptionform" id="requestForm2" method="post">
<input type="hidden" name="id1" id="id1" value="<?php echo $_product->getId() ?>" />
<input type="submit" name="Order" id="order"/>               
</form> 

2. A popup window appears which contains product details.and a Submit button called "ORDER". After click on "ORDER" button it redirect to above form action.here I get the product id and it shows a form and a submit button.

\app\design\frontend\base\default\template\prescriptionform\index.phtml

$baseurl = Mage::getBaseUrl();
$product_id = $_REQUEST['id1'];
<form action="<?php echo $baseurl."checkout/cart/add?product=".$product_id; ?>" id="requestForm" method="post">

<h3 class="txt-blue"><?php echo Mage::helper('contacts')->__('Your Prescription ') ?></h3>
<ul class="form-list">
<li>
<label class="required type"><?php echo $this->__('Prescription Type') ?>&nbsp;<font color="red">*</font></label>
<div class="input-box p_form">
<select name="type" id="name-prefix" class="required-entry">
<option value="" selected>Please select...</option>
<option value="single" title="Single Vision">Single Vision</option>
<option value="bifocal" title="Bifocal">Bifocal</option>
<option value="progressive" title="Progressive">Progressive</option>
</select>
</div>
</li>
</ul>
<p><?php echo $this->__("<font color='red'>*</font> Required Fields") ?></p>

<input type="hidden" name="request_flag" id="request_flag" value="1"/>
<input type="hidden" name="productID" value="<?php echo $product_id; ?>"/>

<input type="submit" name="add" id="add"/>

  1. Now get these values at add to cart page using this:-

app\design\frontend\base\default\template\checkout\cart.phtml

    $params = $this->getRequest()->getParams();
    $_REQUEST['request_flag'];

But I am not able to get value of that form on add to cart page.please help.

1

1 Answers

0
votes

You are posting the form to checkout/cart/add then after adding the products to cart in add() method it will redirect to checkout/cart therefore $this->getRequest()->getParams() will not be available on the cart page.

Please provide more detail, so that we can better advise you on how accomplish this.