News:

Support the VirtueMart project and become a member

Main Menu

how to get hidden variable in post method

Started by spk063, August 20, 2013, 15:38:42 PM

Previous topic - Next topic

spk063

I'm editing product details page's cart module . Most of the process are completed. Now I want to send variable from Hidden form

<input type="hidden" name="product_price" value="5" />
in product detail page, so i can use it on

administrator\components\com_virtuemart\helpers\calculationh.php the cart page uses calculationh.php

(or)

How to send post type data from product details page to administrator\components\com_virtuemart\helpers\calculationh.php..

i tried to get with $price = JRequest::getVar('product_price'); in calculationh.php.

if i remove

class="product js-recalculate" from this

<form method="post" class="product js-recalculate" action="/ecomm/index.php/component/virtuemart/">
fancy box doesn't appears and the page is redirected to cart page.

spk063

I'm editing product details page's cart module . Most of the process are completed. Now I want to send variable from Hidden form

<input type="hidden" name="product_price" value="5" />
in product detail page, so i can use it on

administrator\components\com_virtuemart\helpers\calculationh.php the cart page uses calculationh.php

(or)

How to send post type data from product details page to administrator\components\com_virtuemart\helpers\calculationh.php..

i tried to get with $price = JRequest::getVar('product_price'); in calculationh.php.

if i remove

class="product js-recalculate" from this

<form method="post" class="product js-recalculate" action="/ecomm/index.php/component/virtuemart/">
fancy box doesn't appears and the page is redirected to cart page.

spk063

code at product details's view
<form method="post" class="product js-recalculate" action="/ecomm/index.php/component/virtuemart/"">
<input type="hidden" name="virtuemart_product_price" value="600"/>
</form>


from the above code i want to use the virtuemart_product_price from administrator\components\com_virtuemart\helpers\calculationh.php

working in Virtuemart 2.0.22a and Joomla 2.5.9

Maxim Pishnyak

Quote from: spk063 on August 20, 2013, 15:39:03 PM
I'm editing product details page's cart module . Most of the process are completed. Now I want to send variable from Hidden form

<input type="hidden" name="product_price" value="5" />
in product detail page, so i can use it on
Interesting. For what purpose do you need this?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

spk063

 i want to use the hidden form value "virtuemart_product_price" a administrator\components\com_virtuemart\helpers\calculationh.php
this form is added in components\com_virtuemart\views\cart\tmpl\default.php  ..
<form method="post" class="product js-recalculate" action="/ecomm/index.php/component/virtuemart/">
      <div class="addtocart-bar">

            <!-- <label for="quantity229" class="quantity_box">Quantity: </label> -->
            <span class="quantity-box">
                <input type="hidden" class="quantity-input js-recalculate" name="quantity[]" value="1"/>
            </span>
           
                               
            <span class="addtocart-button">
                <input type="submit" name="addtocart" class="addtocart-button" value="Pick free" title="Pick free" />               </span>
                               
            <div class="clear"></div>
        </div>
        <input type="hidden" name="virtuemart_product_price" value="5" />
        <input type="hidden" class="pname" value="Custom Item"/>
        <input type="hidden" name="option" value="com_virtuemart"/>
        <input type="hidden" name="view" value="cart"/>
        <noscript><input type="hidden" name="task" value="add"/></noscript>
        <input type="hidden" name="virtuemart_product_id[]" value="<?php echo virtuemart_product_id;?>"/>
           </form>

i tried to get but i can't find a solution..

Maxim Pishnyak

Quote from: Milbo on June 28, 2013, 15:37:48 PM
Interesting. But why not just using the value of the customfield? load the sampeldata and look at the chain saw
Why are sure that Milbo's advice couldn't be helpful for you?

BTW don't spam your issue with 'New Topic' button.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart