Jump to content

Payments Mod - Stock Not Reducing


Guest benlogan

Recommended Posts

Guest benlogan

Hi,

I have a mod, that have been added to the download section. Its the Aussie Payment mod. Now, when a customer uses any three of these, the stock level isnt reduced of the products they purchased. I have looked through the code and cannot find an thing that could be the problem.

can anyone help?

This is the code for the 'cheque' method.

<?php

/*

Title: Cheque Order Form - Ben Logan (Original Credits Go To Brooky)

Email:[email protected]

MSN: [email protected]

CubeCart Forums: benlogan

*/



	session_start();

	

	// INCLUDE CORE VARIABLES & FUNCTIONS

	include_once("../../../includes/global.inc.php");

	

	// initiate db class

	include_once("../../../classes/db.inc.php");

	$db = new db();

	

	include_once("../../../includes/functions.inc.php");

	

	$config = fetchDbConfig("config");



	$module = fetchDbConfig("Cheque");

	

	// get session data

	include_once("../../../includes/session.inc.php");

	

	// initiate basket

	include_once("../../../classes/cart.php");

	$cart = new cart();

	$basket = $cart->cartContents($ccUserData[0]['basket']);

	

	// get exchange rates etc override users curency if need be

	if($module['multiCurrency']==0){

  $ccUserData[0]['currency'] = $config['defaultCurrency'];

	}

	include_once("../../../includes/currencyVars.inc.php");

	

	// require template class

	include_once("../../../classes/xtpl.php");

	

	$print_order_form = new XTemplate("orderForm.tpl");

	

	$result = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_order_sum INNER JOIN ".$glob['dbprefix']."CubeCart_customer ON ".$glob['dbprefix']."CubeCart_order_sum.customer_id = ".$glob['dbprefix']."CubeCart_customer.customer_id WHERE ".$glob['dbprefix']."CubeCart_order_sum.cart_order_id = ".$db->mySQLSafe($basket['cart_order_id']));

	

	if($result == FALSE){

	header("Location: ".$glob['rootRel']."cart.php?cart.php&act=step2");

	}

	include_once("../../../language/".$config['defaultLang']."/config.inc.php");

	$print_order_form->assign("VAL_ISO",$charsetIso);

	

	$print_order_form->assign("VAL_STORE_NAME",$config['storeName']);

	$print_order_form->assign("VAL_STORE_URL",$glob['storeURL']);

	$print_order_form->assign("LANG_INVOICE_TO","Invoice to");

	$print_order_form->assign("VAL_INVOICE_NAME",$result[0]['name']);

	$print_order_form->assign("VAL_INVOICE_ADD1",$result[0]['add_1']);

	$print_order_form->assign("VAL_INVOICE_ADD2",$result[0]['add_2']);

	$print_order_form->assign("VAL_INVOICE_TOWN",$result[0]['town']);

	$print_order_form->assign("VAL_INVOICE_STATE",$result[0]['county']);

	$print_order_form->assign("VAL_INVOICE_POSTCODE",$result[0]['postcode']);

	$print_order_form->assign("VAL_INVOICE_COUNTRY",countryName($result[0]['country']));

	

	$print_order_form->assign("LANG_DELIVER_TO","Deliver to");

	$print_order_form->assign("VAL_DELIVER_NAME",$result[0]['name_d']);

	$print_order_form->assign("VAL_DELIVER_ADD1",$result[0]['add_1_d']);

	$print_order_form->assign("VAL_DELIVER_ADD2",$result[0]['add_2_d']);

	$print_order_form->assign("VAL_DELIVER_TOWN",$result[0]['town_d']);

	$print_order_form->assign("VAL_DELIVER_STATE",$result[0]['county_d']);

	$print_order_form->assign("VAL_DELIVER_POSTCODE",$result[0]['postcode_d']);

	$print_order_form->assign("VAL_DELIVER_COUNTRY",$result[0]['country_d']);

	

	$print_order_form->assign("LANG_INVOICE_RECIEPT_FOR","Postal Order for");

	$print_order_form->assign("LANG_ORDER_OF_TIME","Order of");

	$print_order_form->assign("VAL_TIME_DATE",formatTime($result[0]['time']));

	$print_order_form->assign("LANG_CART_ORDER_ID","Order ID:");

	$print_order_form->assign("VAL_CART_ORDER_ID",$basket['cart_order_id']);

	

	$print_order_form->assign("LANG_PRODUCT","Product");

	$print_order_form->assign("LANG_PRODUCT_CODE","Code");

	$print_order_form->assign("LANG_QUANTITY","Qty");

	$print_order_form->assign("LANG_PRICE","Price");

	

	// repeat products 

	$results = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_order_inv WHERE cart_order_id = ".$db->mySQLSafe($basket['cart_order_id']));

	

	for($i=0;$i<count($results);$i++){

  $print_order_form->assign("VAL_PRODUCT_NAME",$results[$i]['name']);

  $print_order_form->assign("VAL_PRODUCT_OPTS",$results[$i]['product_options']);

  $print_order_form->assign("VAL_PRODUCT_CODE",$results[$i]['productCode']);

  $print_order_form->assign("VAL_PRODUCT_QUANTITY",$results[$i]['quantity']);

  $print_order_form->assign("VAL_PRODUCT_PRICE",priceFormat($results[$i]['price']));

  $print_order_form->parse("order_form.repeat_order_inv");

	}

	

	



	$print_order_form->assign("LANG_SHIPPING_METHOD","Shipping Method:");

	$print_order_form->assign("VAL_SHIPPING_METHOD",$result[0]['shipMethod']); 

    

	$print_order_form->assign("LANG_SUBTOTAL","Subtotal:");

	$print_order_form->assign("VAL_SUBTOTAL",priceFormat($result[0]['subtotal']));

	$print_order_form->assign("LANG_TOTAL_TAX","Total Tax:");

	$print_order_form->assign("VAL_TOTAL_TAX",priceFormat($result[0]['total_tax']));

	$print_order_form->assign("LANG_SHIPPING","Total Shipping:");

	$print_order_form->assign("VAL_SHIPPING",priceFormat($result[0]['total_ship']));

	$print_order_form->assign("LANG_GRAND_TOTAL","Grand Total:");

	$print_order_form->assign("VAL_GRAND_TOTAL",priceFormat($result[0]['prod_total']));

	

	

  $print_order_form->assign("LANG_PAY_BY_CHEQUE","Pay by Cheque");

  $print_order_form->assign("VAL_MAKE_CHEQUES_PAYABLE_TO","Please make Cheques payable to ".$module['payableTo'].".");

  $print_order_form->parse("order_form.check_true");



	

	if(!empty($module['notes'])){

	$print_order_form->assign("VAL_CUST_NOTES",$module['notes']);

	$print_order_form->parse("order_form.cust_notes");

	}

	

	$print_order_form->assign("LANG_THANK_YOU","Thank you for shopping with us!");

	$print_order_form->assign("LANG_SEND_TO","Postal address:");

	$print_order_form->assign("VAL_STORE_ADDRESS",$config['storeAddress']);

	

	// empty basket

	$basket = $cart->emptyCart();

	

$print_order_form->parse("order_form");

	

$print_order_form->out("order_form");

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...