claredotcom Posted December 3, 2013 Posted December 3, 2013 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!
burt Posted December 4, 2013 Posted December 4, 2013 You'd need to use some javascript to disable or remove the buy button until a checkbox is clicked. To give you an idea, this addon does something very similar: http://addons.oscommerce.com/info/8664
Recommended Posts
Archived
This topic is now archived and is closed to further replies.