Zen Cart Logo
Forums / General Questions / 2 submit buttons on products page is it possible?

2 submit buttons on products page is it possible?

Views: 467

Results 1 to 3 of 3
27 Apr 2011, 12:11 PM
#1
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

2 submit buttons on products page is it possible?

Hello,

I want to add a button to the productspage that will add a different parameter (name = "wishlist" value = "yes") and then submit the form like it would while hitting the add to cart button.

The extra cart action will then catch the additional parameter and do some additional actions like removing it from the cart and adding it to the wishlist instead. (taking in attributes and stuff like the cart would do...)

This was working nicely in my tests (on XP ie8 and ff3) but i just found out it doesn't work on win7 ie8 and also ff4 on all platforms wont process it correctly either. (behaviour is then the products get added to the cart as if the add to cart button was pressed)

Can anyone please suggest a proper way to do this?

I have tried:

  • make a href link just below the add to cart but this won't process the attributes in the form (ie doesn't submit the form)
  • like described add a second button in the form of ```html
    <input type="image" src="includes/templates/mytemplate/buttons/dutch/wishlist_add.gif" alt="Op Verlanglijstje" title=" Op Verlanglijstje " name="wishlist" value="yes" />
I am running out of ideas now, all i can think of is just making a href with the products_id and deal with attributes later, but that sort of dismisses the "easyness" of things when trying to add something with attributes to a wishlist.

any input warmly welcomed,
thanks,
Jeroen
28 Apr 2011, 8:26 AM
#2
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

Re: 2 submit buttons on products page is it possible?

thanks for reading, the problem went away by adding || ($_POST['wishlist_x']) to the catch altough i still don't understand why that changed the behaviour...

29 Apr 2011, 12:36 PM
#3
creation avatar

creation

New Zenner

Join Date:
May 2010
Location:
South Coast of NSW Australia
Posts:
57
Plugin Contributions:
0

Re: 2 submit buttons on products page is it possible?

Interesting as I want to add a second button to some product categories which allows the CONSIGNMENT of a product to a reseller but I want to leave the ability to purchase -- if they select Buy Now then it follows thru a checkout. If they press Consign Now then the info should be sent via a form or as part of the advisory email after checkout. Any ideas?