Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

FREE GIFTS WHEN TOTAL OVER ?XXX


Oxfordeye

Recommended Posts

OK I've found this here: http://www.oscommerce.com/forums/index.php?showtopic=67978&st=0&

 

define('FREE_PRODUCT_ID', '28');
$this->add_cart(FREE_PRODUCT_ID, 1);

 

to includes/classes/shopping_cart.php, after (around lines 69-71):

 

 if (tep_session_is_registered('customer_id') && ($reset_database == true)) {
      tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
      tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");

and before the closing }

 

Can anybody tell me how to set a min value of the cart before it adds the free product? Please :D

Link to comment
Share on other sites

OK I tried the first bit of the code and it works great just paste it in like this

 

}

   function reset($reset_database = false) {
     global $customer_id;

     $this->contents = array();
     $this->total = 0;
     $this->weight = 0;
  define('FREE_PRODUCT_ID', '345');
     $this->add_cart(FREE_PRODUCT_ID, 1);
     $this->content_type = false;

     if (tep_session_is_registered('customer_id') && ($reset_database == true)) {
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'");
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'");
     }

All I need now is to only have it put in the cart if the total exceeds a set amount i.e. ?10. Anybody tell me how to do this??

 

Patrick

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...