Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

joannew

Archived
  • Posts

    3
  • Joined

  • Last visited

Profile Information

joannew's Achievements

  1. Yes Yes Yes... :oops: Sorry bout that - Yes we were using 2.2 (we are only new to this and downloaded a few versions within a short time), yes it is all working fine now. Thanks for that - what a great contribution - exactly what we needed. Great work. Now - back to working out how to upgrade that invoice system...
  2. Okay sorry I found the sql code for the coupon_active field. Yes I had searched the forum for it but found it after submitting my question. Ignore that part of my question. Cheers Joanne
  3. Hi everybody You'll have to excuse any mistakes I make as I am new to osCommerce. After adding the Coupon Class to a site we are building I found a few problems that I thought I should pass on. Now these may have been created because of something I missed (I copied the code across line by line as we are testing and developing with oscommerce 2.1 and I didn't want to overwrite anything) Problem 1 - Multiple Updates after preview page Everytime I edited or added a new coupon and viewed it and then clicked on a heading within the left column of links the page tried to update the database again - often returning a duplicate key of '' or updating my newly created coupon to have blank field entries. I fixed this by adding the following line of code just after the database updates have been completed. This clears the action code out of the url and stops the page from completing multiple submits when you try to navigate to other pages with the admin site. tep_redirect(tep_href_link(FILENAME_COUPON)); Problem 2 - Date Formatting I soon found an error with the inserting of dates into the database. Being a New Zealand company we have our dates set to display (DATE_FORMAT) as d/M/Y. Because there is a line within the coupin_admin page that uses DATE_FORMAT to format the coupon_finishdate and coupon_startdate variables before they are placed into a hidden field for passing to the tep_date_raw function we had some problems with dates not being inserted into the database when the day was greater than 12 - dates with days under 12 were inserted back to front. To fix this I am now passing my dates as: echo tep_draw_hidden_field('coupon_startdate_month', $HTTP_POST_VARS['coupon_startdate_month']); echo tep_draw_hidden_field('coupon_startdate_day', $HTTP_POST_VARS['coupon_startdate_day']); echo tep_draw_hidden_field('coupon_startdate_year', $HTTP_POST_VARS['coupon_startdate_year']); echo tep_draw_hidden_field('coupon_finishdate_month', $HTTP_POST_VARS['coupon_finishdate_month']); echo tep_draw_hidden_field('coupon_finishdate_day', $HTTP_POST_VARS['coupon_finishdate_day']); echo tep_draw_hidden_field('coupon_finishdate_year', $HTTP_POST_VARS['coupon_finishdate_year']); and inserting them into the database as: 'startdate' => $HTTP_POST_VARS['coupon_startdate_year'] . $HTTP_POST_VARS['coupon_startdate_month']. $HTTP_POST_VARS['coupon_startdate_day'], 'finishdate' => $HTTP_POST_VARS['coupon_finishdate_year'] . $HTTP_POST_VARS['coupon_finishdate_month']. $HTTP_POST_VARS['coupon_finishdate_day'], I also have updated the code so that the select list displays the current date for start date and finish date dropdowns by default on the insert page and still retains the dates pulled from the database on the edit page. This would be a nice feature for an update. My final question (sorry this takes so long) is about the coupon_active field and type field. I am getting an error on deletion of a coupon saying that coupon_active does not exist. I can't find reference to this field in the SQL update code. I am about to add the field in but wish to know if it is not in there for a reason and also what the type field is used for and what are the normal settings for it. Any help would be appreciated.
×
×
  • Create New...