Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Simple javascript


Dominos

Recommended Posts

Posted

Im trying to launch an alert javascript like that:

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 10) {

echo '<script language="javascript">alert ("Minimun products is 10");</script>';

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

in shopping_cart.php

 

Javascript works, but finally I always got error like that:

 

Warning: Cannot add header information - headers already sent by (output started at /var/www/oscommerce/includes/classes/shopping_cart.php...

 

 

So I'd like to show a javascript message and then, come back to shopping_cart

Posted
there is a minimum order contribution

 

Thx, but this was an example. I only want to know the way to launch a javascript like that or similar;

 

echo '<script language="javascript">alert ("This is a javascript message");</script>';

 

and only show a message, any message.

Archived

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

×
×
  • Create New...