0
votes

In Magento 1 On product page https://prnt.sc/smp14a when someone enters the description I wanted to show the same description on cart page https://prnt.sc/smp8l7 and checkout page how can I do that

In post request on /app/code/core/Mage/Checkout/controllers/CartController.php In addAction I am getting the text box value and have passed to cart as parameters

$cart   = $this->_getCart();
        $params = $this->getRequest()->getParams();
        try {
            if (isset($params['qty'])) {
                $filter = new Zend_Filter_LocalizedToNormalized(
                    array('locale' => Mage::app()->getLocale()->getLocaleCode())
                );
                $params['qty'] = $filter->filter($params['qty']);
            }

            $product = $this->_initProduct();
            $related = $this->getRequest()->getParam('related_product');

            /**
             * Check product availability
             */
            if (!$product) {
                $this->_goBack();
                return;
            }

            $cart->addProduct($product, $params);

How can I access the textbox value on the cart page thanks in advance

1

1 Answers

0
votes

If the values of $params array is returned correctly to your cart page you can just echo the value into your input element -

<input type="text" id="myparamsvalue" value="<?PHP echo $params['thevalueneeded']; ?>" />

Not sure how you send the information to your cart page, no sample given so it might be a post method, then -

<input type="text" id="myparamsvalue" value="<?PHP echo $_POST($params['thevalueneeded']); ?>" />