Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Gazonice

Pioneers
  • Posts

    92
  • Joined

  • Last visited

About Gazonice

  • Birthday 06/15/1973

Profile Information

Gazonice's Achievements

  1. Another potential fix for blank emails when the script is run by a CRON Job is to change the line: $text_file = basename ($PHP_SELF, ".php") . '.tpl'; to: $text_file = 'review_mail.tpl'; Assuming the template file resides in the same folder as the script and the filename has not been changed. This fixed my problem completely. Garry.
  2. Hi, I hope someone can help me on this one: My hosting won't allow access to the lib folder or install any executable files on the shared server, php exec() is blocked by the firewall... changing hosting providers is not an option and I suspect any good hosting company will be tightening up their 'defences' in the coming months / years. So I looked for the alternative php version of the HSBC module but the links on this forum no longer work: http://www.downhomeconsulting.com/Downloads/downloads.php. What I did do was find an HSBC module from another shopping cart solution that does use a php class to generate the order hash from here: http://www.ecartservice.net/01012009/hsbc-cpi-payment-module/ I downloaded the file and took out orderHash.php and put it into the Oscommerce modules/classes folder. This orderHash.php script I found looks very similar to yet another one that I found here: http://www.davebarnes.co.uk/blog/2010/02/hsbc-php-cpi-integration-without-installing-software/ so I assume they both work fine. I am getting a hash generated but it isn't matching the HSBC hash, I know all the other fields are being sent to HSBC correctly because I phoned HSBC and asked them the status of the test orders - they said all the data was fine except for the matching hash codes. Obviously to get this far I had to modify modules/payment/hsbc.php to use the php class script (orderHash.php) instead of the OrderHash.e with libCcCpiTools.so and this is where my php strength fails: I made 2 changes to hsbc.php: Added: include(DIR_WS_CLASSES . 'orderHash.php'); and changed: //Function to generate a hash to perform the POST or to check received parameters function getHash($fields) { $cmd=""; reset($fields); while(list($k,$v)=each($fields)) { $cmd.=" \"$v\" "; } //Path where the TestHash.e executable is located $path='/home/sites/domain.co.uk/public_html/includes/modules/payment'; putenv("LD_LIBRARY_PATH=$path"); //Executes the TestHash to get the hash $cmd="$path/TestHash.e \"".MODULE_PAYMENT_HSBC_HASH."\" $cmd 2>&1"; $ret=exec($cmd, $output); $ret=split(':',$ret); //Returns the hash $hash=trim($ret[1]); return($hash); } to: //Function to generate a hash to perform the POST or to check received parameters function getHash($fields) { $cmd=""; reset($fields); while(list($k,$v)=each($fields)) { $cmd.=" \"$v\" "; } $cmd.=" 2>&1"; //Path where the TestHash.e executable is located //$path='/home/sites/domain.co.uk/public_html/includes/modules/payment'; //putenv("LD_LIBRARY_PATH=$path"); //Executes the TestHash to get the hash //$cmd="$path/TestHash.e \"".MODULE_PAYMENT_HSBC_HASH."\" $cmd 2>&1"; //$ret=exec($cmd, $output); $ret = generateHash($cmd, MODULE_PAYMENT_HSBC_HASH); //$ret=split(':',$ret); //Returns the hash $hash=$ret; return($hash); } I really am not sure if I have altered this correctly to get the correct hash from the php class so I would appreciate any help or assistance anyone could provide in getting this alteration correct. If this can be achieved it means we can create an HSBC module that works entirely in PHP which could be made available without the need to install executable files. Thanks in advance for your help, Garry.
  3. Hi, I would like to split the sort orders on the menu so that the Top Level Categories sort alphabetically, but the Sub Categories sort by sort_order. Does anyone know how I would achieve this? Many Thanks, Garry
  4. Oops. posted in wrong area by mistake ! sorry
  5. I gave up in the end and bought the solution by Graith Internet - which works like a charm ! Garry
  6. Hi, The path has to be wrong: (/home/sharpweb/public_html/shop/googlecheckout//includes/languages/english/modules/payment/googlecheckout.php Try replacing this code in googlecheckout.php (line 43 on...) require_once(DIR_FS_CATALOG .'/includes/languages/'. $language .'/modules/payment/googlecheckout.php'); require(DIR_FS_CATALOG .'/googlecheckout/shipping_methods.php'); require(DIR_FS_CATALOG .'/googlecheckout/shipping_methods_ccs.php'); with: require_once('/home/sites/[website address here]/public_html/includes/languages/english/modules/payment/googlecheckout.php'); require(DIR_FS_CATALOG .'/shipping_methods.php'); require(DIR_FS_CATALOG .'/shipping_methods_ccs.php'); This may fix the problem as it has for me. 'sites' might need to be 'sharpweb' in your specific case. Garry
  7. Hi Joe, Nice one ! I don't suppose you know how I might replace the hard coded email address with store_owners_email_address in complete.php ? take: $Message2 .= "Congratulations!\n\nA successful order has been added to your shopping cart.\n\nOrder Number = $cid\n\n$custname\n$custaddress\n$custcity\n$custpostcode\n\nOrder Processed: $custdate\n\nThis order will be in your cart admin panel under PENDING\n\nhttp://www.admin_domain.com\n"; mail ("sales@admin_domain.com","SUCCESFUL EPDQ Transaction", $Message2, "From: Shopping Cart \nReply-To: \nX-Script-Author: GB\nX-ip:$REMOTE_ADDR\nX-Mailer: PHP/" . phpversion()); and take out the hard coded email address and replace it somehow with this: ' . STORE_OWNER_EMAIL_ADDRESS . ' Thanks if you can help, Garry
  8. I don't think I like Barclays system much but my client was already a Barclays customer and felt compelled to use them. The epdq mod I have done works like this: The Customer selects their products goes to payment section, there the order is stored in the tables and status set to pending and stock deducted. If the customer continues shopping and comes back to the payment page the old order is marked as 'aborted' and a new order is stored in the tables. Customer goes to epdq makes their payment: If it succesful, complete.php changes status to 'pending' and sends 2 emails; 1 to client with their details (but not the full order) and 1 to the store owner. If it is declined complete.php sets the status to 'declined' and notifies the store owner. The customer never sees 'pending' or 'aborted' orders in their history, only 'pending', 'processing', 'despatched' or 'declined' orders - this is to keep things tidy from the customers end. 'Pending' and 'aborted' orders can be deleted through the admin panel re-stocking the products if neccessary. In all, a pretty good compromise from a crap system (epdq). I think that once complete.php was able to pull in order_id, from there you could generate a full order email but I couldnt be bothered. The cart might not be stocked if you visit but... http://www.incar-emporium.com/index.php Thanks for your guidance guys, it helped although I have been through a fast, steep upward learning curve. Garry
  9. Hi, Thanks for that... What happens to your system if the customer does not press the continue button whilst they are at Barclays EPDQ? Is the order still stored? Regards, Garry
  10. Hi, I couldn't work out how to send the actual order emails from complete.php but I did manage to get it to send a custom confirmation email which is adequate. It also sends a pass or fail email to the store owner. Thanks for your guidance. Regards, Garry
  11. OK, Iv'e managed to throw together some bits of code to clear the basket when cpi/complete.php gets the OK from Barclays: if($status == "Success") { $selstr4 = "SELECT * FROM orders WHERE orders_id='$oid'"; $check_query = tep_db_query($selstr4); $status = tep_db_fetch_array($check_query); $cust = $status['customers_id']; $selstr5 = "DELETE FROM customers_basket WHERE customers_id ='$cust'"; $check_query = tep_db_query($selstr5); $selstr6 = "DELETE FROM customers_basket_attributes WHERE customers_id ='$cust'"; $check_query = tep_db_query($selstr6); } My next question is am I going in the right direction for asking complete.php to send the order emails too? Many thanks, Garry
  12. OK, Thanks for that, could you tell me how I might get the 'customers_id' into complete.php? I have it in mind to do this: $selstr3 = "delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '$???'"; tep_db_query($selstr3); $selstr4 = "delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '$???'"; tep_db_query($selstr4); But I am not sure where the Customer_id is located or what it looks like? Kind Regards, Garry
  13. Hi, If I was clever enough I'd get complete.php to do it, but I just don't know enough about php - I'm pretty much bungling my way through this as it is! I have had checkout_confirmation.php empty the cart as soon as its loaded, and because the order is stored already there is no problem with this, except, if the customer decided they want to go back and add more items to their cart - they will find it's already been emptied. If I could keep the cart contents intact until at least they press the 'confirm' button the whole buying process would be better, unless they use 'back' from Barclays in which case it's tough luck and they would have to re add their contents. I guess I am asking if it's possible to add an 'onClick' type of event to the 'confirm' button that simply resets the cart before submitting the form? Many thanks, Garry
  14. Hi, Thanks for the help so far - very much appreciated. Because I am working on a cart with shared ssl, and there is every likely hood that customers won't use continue and it seems almost impossible to recover the session to complete the sale, I have modified the epdq cont: 1) When a customer makes an order and selects the payment method (epdq being the only one available at present), epdq.php now adds the order to the dBase, deducts the stock and sets the status as PENDING [EPDQ]. 2) If the customer adjusts their order or selects a different pay method, the temp_order is no longer deleted, but has it's status set to ABORTED [EPDQ] - this gives the store owner the chance to delete the order and re stock the product (re stock selected by default now). 3) If Barclays Decline the transaction, the order status is set to DECLINED (via cpi/complete.php) and again the store owner has the chance to delete the order and restock the product. Because I am working on the basis the customer will not be logged in when (and if) they return to the cart, I am redirecting them to index.php - if they want to check their order, they simply log back in. The help I need is on checkout_confirmation.php: I simply need to know how to get the form to empty the cart before sending the customer on to Barclays? <?php if (isset($$payment->form_action_url)) { $form_action_url = $$payment->form_action_url; } else { $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); } echo tep_draw_form('checkout_confirmation', $form_action_url, 'post'); if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n"; ?> is there a way to add in $cart->reset(true); when the button is hit? Kind Regards, Garry
×
×
  • Create New...