Jump to content

a href whit Tools::issubmit ?


arkanimus

Recommended Posts

Can i do use the issubmit function in a href object...?? for example.

 

in the controller:

 if(Tools::issubmit('insertHref'))
        {
            $cantidad = Tools::getValue('txtboxes');
        
$this->context->cart->updateBoxed($cantidad);      
        }
 
in the view:
 
<a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&back={$back}')}{else}{$link->getPageLink('order', true, NULL, 'step=1')}{/if}" class="exclusive standard-checkout" name ="insertHref" id="insertHref"
         onclick="document.getElementById('voucher').submit();"title="{l s='Next'}">{l s='Next'} »</a>
        </form>

how can i solve it?

Edited by arkanimus (see edit history)
Link to comment
Share on other sites

Tools:isSubmit looking for params in url such us "myParam=1" or input name like <input type="submit" name="myParam" in your example form#voucher should have for example <input type="hidden" name="myParam" value="1" /> then you can do:

if(Tools:isSubmit('myParam'))

thank you for reply 

 

but i need to modify the "Next Button" in shopping-cart.tpl

 

<a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&back={$back}')}{else}{$link->getPageLink('order', true, NULL, 'step=1')}{/if}" class="exclusive standard-checkout" title="{l s='Next'}">{l s='Next'} »</a>
Edited by arkanimus (see edit history)
Link to comment
Share on other sites

  • 1 year later...
  • 3 years later...

I know a bit late but I faced the issue another way.

I make an ajax login interface for my PrestaShop 1.7 shop.

For some reason even with debug true, issubmit is not working at all.

So I serialize the submitted data and then (on the php side) I made a function to convert the serialized string into an array.

I have a hidden field name='submit' value=1 and I check

if(!empty($data['submit'])
{
	//Custom code here
}

where $data is the result from the custom function above.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...