Jump to content

Editing a link - new to php


Iluvatar13

Recommended Posts

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.