0

I have a problem with Magento. In practice, I'm working on the page view.phtml of product display. In the form of the page that shows this action:

<form action="<?php echo $this->getSubmitUrl($_product);?>"

I entered the inputs, where the value is generated dynamically with a calculation made in Javascript .

input type="text" name="PassStampa" id="PassStampa" style="width:70px;"

Now my question is, how do I make sure that in the next page, and the page default.phtml, where it is reported the truck with price and quantity, can display these values input? I tried using the method $ _POST but nothing to do, I tried with the session_start (), with $ _SESSION, $ _REQUEST but no nothing.

Where should I take action to get this values from the input? If in the action as I do?

2
  • calculation mean price?
    – Amit Bera
    Feb 18, 2015 at 12:08
  • What? But how should I do for get my input dynamic values and rewrite in the page default.phtml?
    – user22555
    Feb 18, 2015 at 12:15

2 Answers 2

1

Magento adds products to the cart via \Mage_Checkout_CartController::addAction and then makes a redirect, this means the page you see is not the page which processes the $_REQUEST where your PassStampa is in.

Small hint: If you calculate anything in JS, make sure to check this in PHP. If you don't do this, your customer can submit anything.

0

Please check the form tag in view.phtml.

The action attribute is the one is to decide the next page, It could be the controller. In that controller, Magento will take the posted values programatically.

Once you submitted the form, The whole data has been encoded and been posted to the next page. To encode the values, We are using the attribute "encode-type=form/multipartdata"

2
  • Thanks for your answers, but i don't understand very well a point of this. If i want get my input value and repor in the other page, how can I do? Have i to use $ _POST in functions that call the form of view.phtml?
    – user22555
    Feb 18, 2015 at 13:20
  • You have to come out of Core PHP. and See the vast MVC Pattern. You will understand sooon... Bunch of tutorials over in internet. Have a good programming.
    – Sundar
    Feb 18, 2015 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.