Iluvatar13 Posted February 24, 2010 Share Posted February 24, 2010 Hey all, I'm new to php and was asked to edit a shopping cart link. I do have extensive html/css experience and an intermediate working knowledge of ASP.NET so I'm not completely lost, but could use some help. I have a form with an 'add to cart' button and need to disable it so it makes an html popup when clicked instead of using the cart function. Something saying "Call this number to order" nothing fancy. Basically I was wondering if I can just remove the input and replace it with an html popup or if I have to be more thorough about editing the php or form itself? Any help would be appreciated, the code for the current form is listed below. <form name="cart_quantity[]" method="post" action="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product', 'NONSSL'); ?>"> <tr> <td class="storeTitle" valign="bottom" nowrap> <input type="hidden" name="products_id" value="<? echo $products_array[ $idx[0] ]['products_id']; ?>"><?php if( STORE_ENABLED ) echo tep_image_submit('button_add_to_cart.gif', IMAGE_BUTTON_ADD_TO_CART, 'vspace="3"'); ?> <a href="#" style="" class="" title=""><img src="button_add_to_cart.gif" width="72px" height="17px" /></a></td> </tr> </form> Quote Link to comment https://forums.phpfreaks.com/topic/193280-editing-a-link-new-to-php/ Share on other sites More sharing options...
Fergal Andrews Posted February 24, 2010 Share Posted February 24, 2010 Hi Iluvatar13, If you just want to disable the form and stop the user's journey through the shopping cart, then nothing you do will HTML or Javascript will affect the PHP. If you don't need anything from the form, then why show it to the user in the first place? Would it not be better to bring them to a different page and show them the required message instead? You could do this with javascript or PHP. Fergal Quote Link to comment https://forums.phpfreaks.com/topic/193280-editing-a-link-new-to-php/#findComment-1017745 Share on other sites More sharing options...
Iluvatar13 Posted February 24, 2010 Author Share Posted February 24, 2010 Well as is the 'add to cart' button doesn't take you anywhere, just adds the item to the shopping cart for later checkout. The client wants the add function disabled and instead for a popup to display saying 'Call this number to order', not for a whole new page to load. Quote Link to comment https://forums.phpfreaks.com/topic/193280-editing-a-link-new-to-php/#findComment-1017753 Share on other sites More sharing options...
Fergal Andrews Posted February 24, 2010 Share Posted February 24, 2010 Ok, I see what you mean, but the form code you have supplied has no way of submitting the form so the data is not going to be saved. If this is going to be done by javascript in the popup code then that's ok, if unreliable. Quote Link to comment https://forums.phpfreaks.com/topic/193280-editing-a-link-new-to-php/#findComment-1017756 Share on other sites More sharing options...
Iluvatar13 Posted February 24, 2010 Author Share Posted February 24, 2010 The form doesn't need to save anything that's the point lol. I want to disable the form so it does nothing but display a popup, no data needs to be saved, it's going to be a simple html popup window no Javascript. I just want to know if deleting the input to replace it with a popup will work, or I have to edit/delete the form altogether. Quote Link to comment https://forums.phpfreaks.com/topic/193280-editing-a-link-new-to-php/#findComment-1017769 Share on other sites More sharing options...
Cine Posted February 24, 2010 Share Posted February 24, 2010 Replace: <a href="#" style="" class="" title=""><img src="button_add_to_cart.gif" width="72px" height="17px" /></a> With: <a href="#" style="" class="" title="" OnClick="alert('Call this number to order');"><img src="button_add_to_cart.gif" width="72px" height="17px" /></a> Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/193280-editing-a-link-new-to-php/#findComment-1017779 Share on other sites More sharing options...
Iluvatar13 Posted February 25, 2010 Author Share Posted February 25, 2010 Yes thank you that's what I wanted to do, forgot I had already switched a placeholder into the code I posted lol. So leaving the form as is and having that html link where the input was before won't mess with anything in the php? I just want to make sure I'm not going to break something else on the site. Quote Link to comment https://forums.phpfreaks.com/topic/193280-editing-a-link-new-to-php/#findComment-1017788 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.