Jump to content
Sign in to follow this  
montyrach

Two Submit Buttons on a page

Recommended Posts

Anyone had success adding two submit buttons on a page using the tep_draw_button function? For instance, how would I go about adding a Wishlist button to my Product_info page using the tep_draw_button function?

 

Example

 

<div class="buttonSet">
   <span class="buttonAction" style="float:left;"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>

<?php  // WISHLIST ?>
<?php echo tep_draw_button('Add to Wishlist', 'clipboard', null, 'primary'); ?>

<? echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); 
//WISHLIST ?>    
 </div> <!-- end button set -->

 

and here is the rendered HTML

 

<div class="buttonSet">

<span style="float:left;" class="buttonAction"><input type="hidden" value="1877" name="products_id"><span class=""><button type="submit" id="tdb1" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-primary" role="button" aria-disabled="false"><span class="ui-button-icon-primary ui-icon ui-icon-cart"></span><span class="ui-button-text">Add to Cart</span></button></span>
<script type="text/javascript">$("#tdb1").button({icons:{primary:"ui-icon-cart"}}).addClass("ui-priority-primary").parent().removeClass("tdbLink");</script></span>


<span class=""><button type="submit" id="tdb3" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-primary" role="button" aria-disabled="false"><span class="ui-button-icon-primary ui-icon ui-icon-clipboard"></span><span class="ui-button-text">Add to Wishlist</span></button></span>
<script type="text/javascript">$("#tdb3").button({icons:{primary:"ui-icon-clipboard"}}).addClass("ui-priority-primary").parent().removeClass("tdbLink");</script>

<input type="image" value="wishlist" name="wishlist" title=" Add to Wishlist " alt="Add to Wishlist" src="includes/languages/english/images/buttons/button_wishlist.gif">    

</div>

 

The tep_image_submit button will work and correctly add a product to the user's wishlist and take them to their wishlist page. BUT if you click the 'Add to Wishlist' button created by the tep_draw_button function, the item is added to the shopping cart. This tells me my application_top is correctly setup to discern between adding to the cart and adding to the wishlist, but I THINK the button isn't setup correctly. Do I need to alter my tep_draw_button function to add some parameters?

 

Any help would be MUCH appreciated as this would apply to loads of different add-ons, not just Wishlist.

 

Thank you!

Edited by montyrach

Rachel M.

Share this post


Link to post
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
Sign in to follow this  

×