Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

beddo

Archived
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Real Name
    Colin

beddo's Achievements

  1. Just wanted to say thanks to the posts saying to change the code in hsbc.php if your timestamp is going wonky and being 1.xxxxxxxE+xx thus giving you invalid data messages. I have just moved all my clients from one server to another and all of a sudden the code that worked on my old server no longer worked. Must be something to do with FreeBSD as my old one (6.2) worked fine with the old code. The new server is FreeBSD 7.
  2. I came back to this as my customer requested the ability to exclude holidays. Thankfully I see the functionality has already been written in. I did however notice it was in a bit of a complicated way. So I changed it :) Previously in order to add a new date, you would have to create a variable for it, then create a stamp variable, then add it to the array creation. Now all you have to do is add it to one variable and your sorted. I've dropped off all the old dates too as they're in the past. catalog/includes/classes/shipsched.php ************************* Replace This ************************* $xmas06 = '2006-12-25'; $boxing06 = '2006-12-26'; $newyear = '2007-01-01'; $goodfriday = '2007-04-06'; $easter = '2007-04-09'; $mayday = '2007-05-07'; $pentecost = '2007-05-28'; $augustbh = '2007-08-28'; $xmas = '2007-12-25'; $boxingday = '2007-12-26'; //Ende eintragen //change date to timestamp $xmas06_stamp = strtotime ($xmas06); $boxing06_stamp = strtotime ($boxing06); $newyear_stamp = strtotime ($newyear); $goodfriday = strtotime ($goodfriday); $easter_stamp = strtotime ($easter); $mayday_stamp = strtotime ($mayday); $pentecost_stamp = strtotime ($pentecost); $augustbh_stamp = strtotime ($augustbh); $xmas_stamp = strtotime ($xmas); $boxingday = strtotime ($boxingday); //construct an array of timestamps $special_date = array ("$xmas06_stamp", "$boxing06_stamp", "$newyear_stamp", "$goodfriday", "$easter_stamp", "$mayday_stamp", "$pentecost_stamp", "$augustbh_stamp", "$xmas_stamp", "$boxingday"); ************************* With This ************************* //preset dates $newyear = '2008-01-01'; $xmas = '2007-12-25'; $boxingday = '2007-12-26'; //To add additional dates, simply include them as another option for the array, ie: // $special_date = array ("$newyear", "$xmas", "$boxingday", "2008-02-02") $special_dates = array ("$newyear", "$xmas", "$boxingday"); $special_date = array(); //construct an array of timestamps $i = 0; foreach ($special_dates as $value) { $special_date[$i] = strtotime($value); $i++; } unset($value); unset($i);
  3. For anyone else looking into this, this is a bad idea even though I've only just notice. The problem was actually one of the changes that someone somewhere recommended. The module should work like this: Customer does checkout Customer clicks button to go to HSBC Customer does HSBC stuff HSBC passed the customer back to checkout_success.php via hsbc_return.php HSBC server itself calls checkout_process.php I can't remember where I got it but somewhere along the lines the redirect to checkout_success.php got changed to a redirect to checkout_process.php. As a result both the HSBC server and the customer were calling checkout_process.php and with the checking commented out the request from the HSBC server was processed as a valid order regardless of the error code. The proper solution is to change to the customer redirect back to the original checkout_success.php and uncomment the line of code I commented out as above. Sorry I haven't got time to help out the other folks who are struggling with their own problems.
  4. I've commented out line 59 on checkout_process.php // load the before_process function from the payment modules // $payment_modules->before_process(); This makes everything work. Having a look through the code itself, before_process is practically an exact copy of the checking code done by hsbc_return.php. The reason it fails is because hsbc_return.php forwards to checkout_process.php via: tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true)); My only question is, is it safe to leave before_process commented out or is it better to have that line of code also pass the _POST variables to checkout_process.php for that to do the checking again. If I interpret it correctly, without the duplicate checking it could theoretically be possible for someone to craft a request to checkout_process.php to make it look like they've paid when they haven't? This is where I'm not sure what to do with the code. If the duplicate checking is needed, then I need to rewrite that redirect to do a post request to checkout_process.php but surely that's not necessary?
  5. Wakey wakey. No posts on this thread for a while. I've been going through getting this module working on a site and there's been some effort involved but I've been able to figure out all of it..except the last bit. Basically, most of it is working. You do an order, go through the checkout, hand off to hsbc and then hsbc hands back. When it hands back, it gets passed to checkout_process.php which kicks out "Hacking atempt!" Now I'm confused, surely all that checking is done before handing off to HSBC and there's no need to check it when it comes back? If I use the extra debugging message I get: Hacking atempt! - orderHash= hash=TestHash encryptedKey hashElement... The saga continues..
  6. Turned out to be simple, I just had to alter the form output section to have enctype="multipart/form-data"..but doing so has lost me the HTTP_POST_VARS..woohoo, not!
  7. Hi folks, I've been putting quite a lot of modifictions into my install of osCommerce..so bear with me if I miss anything out. There's a bit of explanation here, but the actual issue isn't as complicated as it may sound at first so if you know how to make the file upload option work anywhere in osCommerce chances are you can help me! The simple version is that I have the Option Types contrib running and am trying to define an extra type. That bit is easily done as I have added other types already. This type is simply a checkbox, however this checkbox sets a variable in $order->products instead of setting an attribute. When you come to the checkout later (checkout_shipping), an extra area is provided and a file upload input field is given for each product that has this variable set. The reason for this being in the checkout area is quite obvious - people having to log in and actually be going ahead with the order before they are allowed anywhere near the upload facility. To do this, I have had to copy the tep_draw_file_field() function from the admin functions to the normal functions file and also include the upload.php class from the admin side. My problem is simple. When I click the Continue button in checkout_shipping.php, HTTP_POST_VARS gets populated with all the information from the file fields, which is great. $_FILE however remains completely empty (as a result, the upload-parse() and upload-save() functions get nowhere) so I need some help from someone who knows how to make the osCommerce forms actually submit the data for $_FILE. From looking at some of the other code for uploading files, I can't see anything wrong. The html produced for the file field is within the form and as follows: <input type="file" name="variablename_uniquenumber"> As I understand it, on submitting the form *should* make all this work without anything extra...but I must be missing something...
  8. You can play around with the sort order in product_info.php If you look at the query in section 6 of the attributes sets plus install, you have to change the sql query to include all the necessary tables and link info for the order by part of the statement. If you have a contribution as I do which provides a case switch and then multiple different versions of the queries, you will have to manually copy the bits about pase.sort_order into all of the relevant queries otherwise you will only get the right sort order on some drop downs.
  9. Hi folks, I've been digging around for a couple of days with various contributions and working through my list of what I need the shop to do. One thing that I simply cannot find but keep thinking that surely it must have already been done is the ability to have the values of one option dependant on the selection from a previous option. All I can find is this which would need a lot of work to finish or the various PC builders which would need a lot of work to strip out all the unnecessary stuff and make it generic. My situation is that I am doing a store for a bakery. One example is that a cake has various size options (small, medium, large etc). There is then a second option, to have it a fruit cake rather than and sponge cake. So far I am using the Product Attributes: Option Type contribution and the Attribute Sets contribution so the fruit option is simply a checkbox. I need the value that this check box applies to vary depending upon what size is selected. There will be plenty of other dependencies as this isn't exactly a simple bakery! Whilst I'm asking, oscommerce works around a stock pricipal..seen as stuff is made to order, anyone know of a contribution to effectively turn off all the stock options? Ta.
×
×
  • Create New...