Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

add to cart functionality


claredotcom

Recommended Posts

Posted

Hi,

 

I've inherited a webstore to look after. It was built on OSCommerce 2.x and has been customised a fair bit.

 

We have a supplier who has made a condition of online sale that a video is watched & acknowledged before a quantity can be entered and an 'add to cart' button becomes active (a safety issue).

 

I have been supplied some code by the vendor and have added in some conditional coding to ensure this scenario only occurs for 2 products and that works fine....

 

EXCEPT!

 

My issue is that our setup doesn't have an 'add to cart button' instead there is Buy Now text. In the products_info.php this is handled as follows:

 

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now-1.gif', IMAGE_BUTTON_BUY_NOW); ?>

 

So the code which allows adding to the cart from the vendor (below) just doesn't work... because we don't have a button (a script runs which enables the button)

 

<p><input type="checkbox" id="video-watched"> <label for="video-watched">I have watched the video and understand the instructions.</label></p>
	 <label class="product-option" for="qty">Qty:</label>
	 <input type="number" min="1" pattern="[0-9]*" name="qty" id="qty" maxlength="12" value="1" class="input-text qty" />
 		 <button type="button" id="productxButton" disabled class="button" onclick="productAddToCartForm.submit(this)">Add to Basket</button>

 

I've looked in application_top.php to see if there's anything that can help - but I'm stuck at this stage - I've spent a good few hours at this - am I missing something?

 

I'd really appreciate some guidance - I'm OK with code but as I say an inherited system with zero comments as to where changes have been made....

 

thanks so much!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...