VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: spk063 on August 20, 2013, 15:38:42 PM

Title: how to get hidden variable in post method
Post by: spk063 on August 20, 2013, 15:38:42 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

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.
Title: Re: how to get hidden variable in post method
Post by: 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

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.
Title: Re: how to get hidden variable in post method
Post by: spk063 on August 20, 2013, 18:10:45 PM
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
Title: Re: how to get hidden variable in post method
Post by: Maxim Pishnyak on August 20, 2013, 19:11:39 PM
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?
Title: Re: how to get hidden variable in post method
Post by: spk063 on August 21, 2013, 11:29:58 AM
 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..
Title: Re: how to get hidden variable in post method
Post by: Maxim Pishnyak on August 21, 2013, 16:50:47 PM
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.