Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tutorial needed


salva_arte

Recommended Posts

Posted

I'm new to oscommerce and would like to set up store to sell CD's of original music, download original music trax for a fee, download some free original music, and selling e-books to be downloaded from my web site. I'd like to set all this up with oscommerce. Do you know of any tutorials, manuals or any other form of help I can get to learn from? I'm new to this and need instruction to even choose which tools are best to use. I appreciate any help you can give me. :blink:

Posted
I'm new to oscommerce and would like to set up store to sell CD's of original music, download original music trax for a fee, download some free original music, and selling e-books to be downloaded from my web site. I'd like to set all this up with oscommerce. Do you know of any tutorials, manuals or any other form of help I can get to learn from? I'm new to this and need instruction to even choose which tools are best to use. I appreciate any help you can give me. :blink:

includes/modules/payment/ create a file called free.php this will allow free downloads add code below into it

<?php
/*
 $Id: free.php,v 1.28 2003/02/14 05:51:31 hpdl Exp $

 Copyright (c) 2003 osCommerce, http://www.oscommerce.com

 Released under the GNU General Public License
*/

 class free {
var $code, $title, $description, $enabled;

// class constructor
function free() {
  global $order;

  $this->code = 'free';
  $this->title = MODULE_PAYMENT_FREE_TEXT_TITLE;
  $this->description = MODULE_PAYMENT_FREE_TEXT_DESCRIPTION;
  $this->sort_order = MODULE_PAYMENT_FREE_SORT_ORDER;
  $this->enabled = ((MODULE_PAYMENT_FREE_STATUS == 'True') ? true : false);
  if ((int)MODULE_PAYMENT_FREE_ORDER_STATUS_ID > 0) {
	$this->order_status = MODULE_PAYMENT_FREE_ORDER_STATUS_ID;
  }

  if (is_object($order)) $this->update_status();
}

// class methods
function update_status() {
  global $order;
  if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_FREE_ZONE > 0) ) {
	$check_flag = false;
	$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_FREE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
	while ($check = tep_db_fetch_array($check_query)) {
	  if ($check['zone_id'] < 1) {
		$check_flag = true;
		break;
	  } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
		$check_flag = true;
		break;
	  }
	}

	if ($check_flag == false) {
	  $this->enabled = false;
	}
  }

// disable the module if the order only contains virtual products
	  //MJA - 3/28/06 - Following lines are modified to ALLOW COD for
	  //orders with $0.00 price.		 
  if ($this->enabled == true) {
	if ($order->content_type == 'virtual') {
	  if ($order->info['total'] > 0) {
		$this->enabled = false;
	  }  
	}
  }
}

function javascript_validation() {
  return false;
}

function selection() {
  return array('id' => $this->code,
			   'module' => $this->title);
}

function pre_confirmation_check() {
  return false;
}

function confirmation() {
  return false;
}

function process_button() {
  return false;
}

function before_process() {
  return false;
}

function after_process() {
  return false;
}

function get_error() {
  return false;
}

function check() {
  if (!isset($this->_check)) {
	$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_FREE_STATUS'");
	$this->_check = tep_db_num_rows($check_query);
  }
  return $this->_check;
}

function install() {
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Free Downloads Module', 'MODULE_PAYMENT_FREE_STATUS', 'True', 'Do you want to accept Free Downloads?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_FREE_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_FREE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_FREE_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
  }

function remove() {
  tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
  return array('MODULE_PAYMENT_FREE_STATUS', 'MODULE_PAYMENT_FREE_ZONE', 'MODULE_PAYMENT_FREE_ORDER_STATUS_ID', 'MODULE_PAYMENT_FREE_SORT_ORDER');
}
 }
?>

includes/languages/english/modules/payment create a file called free.php add code below into it

<?php
/*
 $Id: free_download.php 1739 2007-12-20 00:52:16Z hpdl $

 Digistore v4.0,  Open Source E-Commerce Solutions
 http://www.digistore.co.nz

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 define('MODULE_PAYMENT_FREE_TEXT_TITLE', 'Free Downloads');
 define('MODULE_PAYMENT_FREE_TEXT_DESCRIPTION', 'Enable downloads for free products');
?>

 

if you wish to disable other payment methods when price is zero for free downloads in your payment files in includes/modules/payment/xxxx.php find

// class methods
function update_status() {
  global $order;

 

add after it

// disable the module if  free downloads
  if ($this->enabled == true) {
	global $cart;
	if ($cart->show_total() == 0.00) {
	  $this->enabled = false;
	}
  }

 

tutorial

ownloads

 

Introduction

Download

Enable Download

Download by Redirect

Expiry Delay (Days)

Maximum Number of Downloads

 

 

Introduction

 

The "Download" link allows customer downloading of products after they are purchased.

 

Download

 

Admin>Setup>Download section.

 

NOTE: To change the details click the "wrench graphic tool" under the "Action" column next to the "Title" being edited.

The products to be downloaded after purchase are put in the catalog/download folder.

The catalog/download folder will be read from the "pub" folder.

Make sure the /catalog/pub folder is 777 and /catalog/download folder is 755 and these lines in catalog/includes/configure.php have the forward slash:

 

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

The configuration for the Download section is:

Enable download

Whether or not downloadable products are allowed.

 

Download by Redirect

Use browser redirection for download. Disable on non-Unix systems.

 

Expiry Delay (Days)

How many days the download will be available for before being deleted.

 

Maximum Number of Downloads

Maximum number of times the customer will be able to download the file before they are locked out.

 

After the product is added go to the "Product Attributes" section under the "Catalog" heading in admin.

Add say to option name on lefthand side Delivery, on right handside select option name delivery and add option value Download to it or use download version english only

 

 

Choose the product in the bottom "Product Attributes" box.

When you choose a product and have download enabled in the configuration section you will see a box below the "Product Attributes" section where you can add the name of the product to download. Again make sure the pub directory has permissions of 777.

Archived

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

×
×
  • Create New...