Jump to content

ttstitches

Members
  • Content count

    136
  • Joined

  • Last visited

1 Follower

Profile Information

  1. ttstitches

    [CONTRIB] Options as Images for MS2

    If anyone is wondering....or cares....I did fix this problem, however I did have to pull More_Pics...I just couldn't get it to work with this module. I tried a few other mods and the only ones I could get to work with this module were "Additional Images" and "Ultra Pics"...I went with Ultra Pics and it all works great...Just thought this might prevent someone from going through as many image contributions as I did to find one compatible. Best of luck Teresa
  2. I'll buy that!! I'm certainly no expert! In Admin configuration under Cache, I do in fact have it set to false, as I my provider/host has recommended. Why???!!! I don't know, but I have it set to false because I was told to. I don't remember seeing anything in the installation of Header Tags that said it should be set differently, but as I said before I'm no expert and maybe missed it. I don't see any other place to set any cache settings anywhere so I am supposing, in your opinion, this is what I have set wrong? Thanks again, Jack, for getting back to me...your expertise is very helpful in my pursuit of understanding how the store works. Best wishes and kindest regards Teresa
  3. Hi I was just wondering if anyone else had this problem...anyone who logs in gets a pre-populated shopping cart. Now I know you are going to say that this has NOTHING to do with Header Tags Controller - however you are mistaken. I have reloaded ALL contributions 3 times on my site from scratch and have narrowed the contribution down to Header Tags. I have Paypal IPN loaded on my site, and if I add Header tags Controller, once a person logs in to their account on the site, the previous customers shopping basket populate their shopping cart. I haven't narrowed it down to what page on the catalog side, but if I were to take a guess I would say its the index page somehow. I also think if I were to narrow it down even further at guessing that it has to do with the area in the <head> of the page. Has anyone else experienced this? If so, any fixes? If not, Any suggestions...I do like the contribution, but its a little freaky to customers when $100 or more of merchandise just shows up in their cart...Doesn't make them feel safe and secure with that fuzzy feeling...Can't say I blame them. Thanks for any input! Teresa
  4. ttstitches

    [CONTRIB] Options as Images for MS2

    I was hoping someone could give me a clue as to why this isn't working for me...All is installed, Admin works beautifully. I configured it, added pictures, added an options folder in catalog/images with 777 permissions...blah blah blah, but on the catalog side i just get a pull down menu. First picture is Admin This picture below is the catalog side Another thing I noticed is that if in configuration I put "Click to Enlarge" to True, it disables the click to enlarge mechanism on my more_pics_6_v1.2c that are used for product pictures. Any thoughts on that? Any help that you could give
  5. ttstitches

    [Contribution] Additional Images Module

    I must be the biggest dummy or I just way too tired, but I have been through contribution download page and have downloaded every single one of the files....updates, fixes, new versions....and I never did find sql file to add "thumb_images" to Table "additional_images", "products_image_description to "products", or additional images to the configuration table, so I manually entered these into the databases and now everything is configured through the //catalog/admin/additional_images_configure.php but now it is telling me that it doesn't have configuration keys missing in configuration_group additional images. Am I supposed to add all these keys or does it want just these columns added....Does someone have the sql file? Thanks for any help you can give... Signed the big dummy!
  6. I would like to set up a system where I can added "HELPFUL SUGGESTIONS" for specific products. I make dollhouse linens and getting a tiny quilt to lay right on a tiny bed due to its lack of weight, can sometimes be rather difficult for customers. When a quilt is bought I send a card with ideas/suggestions on how to get a quilt to lay right but I thought it would be very cool to have a "TIP" button in the product info page of a particular item where this suggestion would pop up. There is a contribution for TIPs but it is not product specific and just rests in a given page, and I don't think that is really what I am looking for. I'm think something more like a throbbing button called IDEAS? or TIPS....that a person could click on and a pop up list of HOW TOs that could be selected, would come up. I thought too that the OSC review system, which I don't use and have disabled, might be a start, but I don't really intend on having customers give these tips (at least without me reviewing first), but NO I don't think a customer would ever be adding to this, I am not really sure if that is the answer either. Has anyone every done something like this? Care to share your thoughts or ideas???? Thanks Teresa :D
  7. ttstitches

    [Contribution] Admin Specials by Category

    Hi bruyndoncx Me again...Done a bunch of work today on the contribution...I've actually got it trying to put things into the database, which is better than before, somehow though I've messed up your $today as it does not want to added it anymore (looking to this) Here's an update on t he code Again, Hope you don't mind and hope you will point me in the right directions. Teresa <?php /* $Id: specialsbycategory.php,v 2.0 2006/11/07 18:18:00 stephenwald Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2005 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title><?php echo HEADING_TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table> </td> <!-- body_text //--> ?> <script language="javascript"> var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE); </script> <script language="javascript"> <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"> <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script> <script language="javascript"> var dfrom = new ctlSpiffyCalendarBox("dfrom", "specials", "valid_from_date", "btnDate1","<?php echo $dfrom; ?>",scBTNMODE_CUSTOMBLUE); var dto = new ctlSpiffyCalendarBox("dto", "specials", "expires_date", "btnDate2","<?php echo $dto; ?>",scBTNMODE_CUSTOMBLUE); </script> <td valign="top"> <!----------------------- Actual code for Specials Admin starts here -------------------------> <?php //Fetch all variables $categories = (isset($_GET['categories']) ? (int)$_GET['categories'] : '0'); $manufacturer = (isset($_GET['manufacturer']) ? (int)$_GET['manufacturer'] : '0'); if ($manufacturer) { $man_filter = " and manufacturers_id = '$manufacturer' "; } else { $man_filter = ' '; } if (array_key_exists('discount',$_GET)) { if (is_numeric($_GET['discount'])) { $discount = (float)$_GET['discount']; } else { $discount = -1; } } else { $discount = -1; } if($_POST['submit']) { foreach($_POST['master'] as $m) { $fullprice = (isset($m['fullprice']) ? $m['fullprice'] : ''); $productid = (isset($m['productid']) ? (int)$m['productid'] : '0'); $inputspecialprice = (isset($m['inputspecialprice']) ? $m['inputspecialprice'] : 'none'); if ($fullprice == 'yes') { tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id=$productid;"); continue; } if($inputspecialprice != "none"){ if (substr($inputspecialprice, -1) == '%') { $productprice = (isset($m['productprice']) ? (float)$m['productprice'] : ''); $specialprice = ($productprice - (($inputspecialprice / 100) * $productprice)); } else if (substr($inputspecialprice, -1) == 'i') { $taxrate = (isset($m['taxrate']) ? (float)$m['taxrate'] : '1'); $productprice = (isset($m['productprice']) ? (float)$m['productprice'] : ''); $specialprice = ($inputspecialprice /(($taxrate/100)+1)); } else { $specialprice = $inputspecialprice; } $alreadyspecial = tep_db_query ("SELECT * FROM " . TABLE_SPECIALS . " WHERE products_id=$productid"); $specialproduct= tep_db_fetch_array($alreadyspecial); if ($specialproduct["specials_id"]){ // print ("Database updated. Status:".$specialproduct["status"]); tep_db_query ("UPDATE " . TABLE_SPECIALS . " SET specials_new_products_price='$specialprice' where products_id=$productid "); } else{ // print("New product added to specials table"); $today = date("Y-m-d H:i:s"); //*******************************MY ADDTIONS TO ADD START AND END DATE BOF**************** $valid_from_date = ('valid_from_date'); $valid_from_date = (date('dd-MM-YYYY') < $valid_from_date) ? $valid_from_date : 'null'; $expires_date = ('expires_date'); $expires_date = (date('dd-MM-YYYY') < $expires_date) ? $expires_date : 'null'; // $specials_date_added = ('specials_date_added'); // $today = 'specials_date_added'; // $specials_last_modified = ('specials_last_modified'); // $specials_last_modified = '$today'; // $date_status_change = ('date_status_change'); // $date_status_change = '$today'; // maybe the special product must be deactivated or actived (depending on wether the valid from/expires dates had been changed) if ($result == 1) { $new_specials_id = tep_db_insert_id(); tep_db_query("update " . TABLE_SPECIALS . " set status = '0' where (now() < valid_from_date or (now() >= expires_date and expires_date > 0)) and specials_id = '" . (int)$new_specials_id . "'"); tep_db_query("update " . TABLE_SPECIALS . " set status = '1' where (now() >= valid_from_date and now() < expires_date) and specials_id = '" . (int)$new_specials_id . "'"); } //***********************************MY ADDTIONS TO ADD START AND END DATE EOF***************** // Fix v1.3 - spell out columns so this also works when columns have been added to the specials table. // Fix v1.4 - set default expiration date to '0' and last modified to $today. // ORIGINAL tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " VALUES ('','$productid','$specialprice','$today','','','','1')"); //*******ADDED BELOW IN ATTEMPT TO GET ADD BEGIN AND END TO SPECIAL CATEGORIES CONTRIBUTION*******FROM SPECIALS*******// tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " VALUES ('', '$products_id', '$specialprice', '$today', '$today', '$expires_date', '$today', '1', '$valid_from_date')"); } } } } ?> <form action="<?php echo $current_page; ?>" method="get"> <table><tr class="dataTableHeadingRow"><td class="dataTableHeadingContent" colspan="6"> <?php echo TEXT_SELECT_CAT .' ' . tep_draw_pull_down_menu('categories', tep_get_category_tree(), $categories); //BoF Added v1.4 allow selection by manufacturer $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } echo TEXT_SELECT_MAN . ' ' . tep_draw_pull_down_menu('manufacturer',$manufacturers_array, $manufacturer) .' '; //EoF Added v1.4 echo TEXT_ENTER_DISCOUNT . ': '; ?> <input type="text" size="4" name="discount" value=" <?php if ($discount > 0) { echo $discount; } echo '">' . TEXT_PCT_AND . ' '; ?> <?php echo TEXT_SPECIALS_VALIDFROM_DATE; ?><br><small>(DD-MM-YYYY)</small> <?php echo tep_draw_input_field('dfrom', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 0, 10) : ''), 'size="4" maxlength="10" class="cal-TextBox"'); ?><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="btnDate1"'); ?><script language="javascript">valid_from_date.writeControl(); valid_from_date.dateFormat="dd/MM/yyyy";</script> <?php echo TEXT_SPECIALS_EXPIRES_DATE; ?><br><small>(DD-MM-YYYY)</small> <?php echo tep_draw_input_field('dto', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 10) : ''), 'size="4" maxlength="10" class="cal-TextBox"'); ?><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="btnDate2"'); ?></a><script language="javascript">expires_date.writeControl(); expires_date.dateFormat="dd/MM/yyyy";</script> <input type="submit" value="<?php echo TEXT_BUTTON_SUBMIT; ?>"> </form></td></tr> <tr class="dataTableContent"><td class="dataTableContent" colspan="6"> <ul><li><?php echo TEXT_INSTRUCT_1; ?></li> <li><?php echo TEXT_INSTRUCT_2; ?></li> </ul> </td></tr> <?php if ($discount == -1) { //echo 'do nothing'; } else if ($discount == 0) { //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories" . $man_filter); } else { $result2 = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p where 1=1" . $man_filter); } //EoF Changed v1.4 while ( $row = tep_db_fetch_array($result2) ){ $allrows[] = $row["products_id"]; } tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id in ('".implode("','",$allrows)."')"); } else if ($discount > 0) { $specialprice = $discount / 100; //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories" . $man_filter); } else { $result2 = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p where 1=1 " . $man_filter); } //EoF Changed v1.4 while ( $row = tep_db_fetch_array($result2) ){ $hello2 = $row["products_price"]; $hello3 = $hello2 * $specialprice; $hello4 = $hello2 - $hello3; $number = $row["products_id"]; $result3 = tep_db_query("select * from " . TABLE_SPECIALS . " where products_id = $number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0){ //echo "Insert into specials (products_id, specials_new_products_price) values ($number, '$hello4')"; //Fix v1.4 set default expiration date to '0' and status active. //tep_db_query("Insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price) values ($number, '$hello4')"); //ORIGINAL tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status ) VALUES ('$number','$hello4','$today','$today','0','','1')"); //*******MY ATTEMPT AT GETTING START AND END IN SPECIALS CATEGORIES*****FROM SPECIALS********** tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status, valid_from_date ) VALUES ('$number', $hello4', '$today', '$today', '$expires_date', '$today', '1', '$valid_from_date')"); } else { //echo "Update specials set specials_new_products_price='$hello4' where products_id=$number"; tep_db_query ("Update " . TABLE_SPECIALS . " set specials_new_products_price='$hello4' where products_id=$number"); } } } print (" <tr class=\"dataTableHeadingRow\"> <td class=\"dataTableHeadingContent\">". TABLE_HEADING_PRODUCTS ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PRODUCTS_PRICE ."</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_START_DATE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_END_DATE ."</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">Products Cost</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_PRICE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PCT_OFF ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_FULL_PRICE . "</td> </tr>"); //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p where pd.products_id=ptc.products_id and p.products_id=ptc.products_id and ptc.categories_id = $categories and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } else if ($manufacturer) { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p where pd.products_id=p.products_id and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } else { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p where pd.products_id=ptc.products_id and p.products_id=ptc.products_id and ptc.categories_id = $categories and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } //EoF Changed v1.4 print("<form action=\"$current_page?categories=$categories&manufacturer=$manufacturer\" method=\"post\">"); $base=-1; while ( $row = tep_db_fetch_array($result2) ) { $base++; $number = $row["products_id"]; $result3 = tep_db_query("SELECT * FROM " . TABLE_SPECIALS . " where products_id=$number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0) { $specialprice = "none"; $implieddiscount = ''; } else { while ( $row2 = tep_db_fetch_array($result3) ) { $specialprice = $row2["specials_new_products_price"]; if ($row["products_price"] > 0) { $implieddiscount = '-'.(int)(100-(($specialprice / $row["products_price"])*100)).'%'; } else { $implieddiscount = ''; } } } $tax_rate = tep_get_tax_rate($row['products_tax_class_id']); print(" <tr class=\"dataTableRow\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\" > <td class=\"dataTableContent\">" . $row["products_name"] . "</td> <td class=\"dataTableContent\">" . $row["products_price"] . "</td> <!--//**************MY ADDITION TO SHOW START AND END DATE*********************//--> <td class=\"dataTableContent\">" . $row["valid_from_date"] . "</td> <td class=\"dataTableContent\">" . $row["expires_date"] . "</td> <!--//**************MY ADDTION TO SHOW START AND END DATE**********************// --> <td class=\"smallText\" style=\"color:#777777\">" . $row["products_cost"] . "</td> <td class=\"dataTableContent\"><input name=\"master[".$base."][inputspecialprice]\" type=\"text\" value=\"$specialprice\"></td> <td class=\"dataTableContent\">$implieddiscount </td> <td class=\"dataTableContent\"><input type=\"checkbox\" name=\"master[".$base."][fullprice]\" value=\"yes\"></td> <td class=\"dataTableContent\"><input type=\"hidden\" name=\"master[".$base."][categories]\" value=\"" . $categories ."\"> <input type=\"hidden\" name=\"master[".$base."][productprice]\" value=\"" . $row["products_price"] . "\"> <input type=\"hidden\" name=\"master[".$base."][taxrate]\" value=\"" . $tax_rate . "\"> <input type=\"hidden\" name=\"master[".$base."][productid]\" value=\"" . $number . "\"> "); } print ("</table>"); if($base>=0) print ("<input type=\"submit\" name=\"submit\" value=\"" . TEXT_BUTTON_UPDATE . "\"></form>"); ?> <!------------------------ Code for Specials Admin ends here ---------------------------> </td> </tr> </table> <!-- body_text_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html>
  8. ttstitches

    [Contribution] Admin Specials by Category

    Hi bruyndoncx I have working all weekend trying to insert a start date and and end date into your contribution. It is something I could really use and I think others might too. Was wondering if you would be willing to help a little as you are the author and no the ends and outs better than anyone. I was tring to put in a js calendar like in specials.php and/or categories.php...I thought I was about 90% there but now I think I am more like 80% there. I think all the whistles are mostly there, they just aren't blowing and I don't think I know php as well as I would like and definitely don't know java. I am willing to do all the work and testing if you would give me a push in the right direction. Below is an image of what I have so far (not happy with the layout of the Start Date and End date) in the gray box, but that is the least of my worries right now. Code wise like I said , I think I have all the componets in there, just not worded right or in the right place. Heres what I have: <?php /* $Id: specialsbycategory.php,v 2.0 2006/11/07 18:18:00 stephenwald Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2005 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title><?php echo HEADING_TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table> </td> <!-- body_text //--> ?> <script language="javascript"> var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE); </script> <script language="javascript"> <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"> <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script> <script language="javascript"> var dfrom = new ctlSpiffyCalendarBox("dfrom", "specials", "valid_from_date", "btnDate1","<?php echo $dfrom; ?>",scBTNMODE_CUSTOMBLUE); var dto = new ctlSpiffyCalendarBox("dto", "specials", "expires_date", "btnDate2","<?php echo $dto; ?>",scBTNMODE_CUSTOMBLUE); </script> <td valign="top"> <!----------------------- Actual code for Specials Admin starts here -------------------------> <?php //Fetch all variables $categories = (isset($_GET['categories']) ? (int)$_GET['categories'] : '0'); $manufacturer = (isset($_GET['manufacturer']) ? (int)$_GET['manufacturer'] : '0'); if ($manufacturer) { $man_filter = " and manufacturers_id = '$manufacturer' "; } else { $man_filter = ' '; } if (array_key_exists('discount',$_GET)) { if (is_numeric($_GET['discount'])) { $discount = (float)$_GET['discount']; } else { $discount = -1; } } else { $discount = -1; } if($_POST['submit']) { foreach($_POST['master'] as $m) { $fullprice = (isset($m['fullprice']) ? $m['fullprice'] : ''); $productid = (isset($m['productid']) ? (int)$m['productid'] : '0'); $inputspecialprice = (isset($m['inputspecialprice']) ? $m['inputspecialprice'] : 'none'); if ($fullprice == 'yes') { tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id=$productid;"); continue; } if($inputspecialprice != "none"){ if (substr($inputspecialprice, -1) == '%') { $productprice = (isset($m['productprice']) ? (float)$m['productprice'] : ''); $specialprice = ($productprice - (($inputspecialprice / 100) * $productprice)); } else if (substr($inputspecialprice, -1) == 'i') { $taxrate = (isset($m['taxrate']) ? (float)$m['taxrate'] : '1'); $productprice = (isset($m['productprice']) ? (float)$m['productprice'] : ''); $specialprice = ($inputspecialprice /(($taxrate/100)+1)); } else { $specialprice = $inputspecialprice; } $alreadyspecial = tep_db_query ("SELECT * FROM " . TABLE_SPECIALS . " WHERE products_id=$productid"); $specialproduct= tep_db_fetch_array($alreadyspecial); if ($specialproduct["specials_id"]){ // print ("Database updated. Status:".$specialproduct["status"]); tep_db_query ("UPDATE " . TABLE_SPECIALS . " SET specials_new_products_price='$specialprice' where products_id=$productid "); } else{ // print("New product added to specials table"); $today = date("Y-m-d H:i:s"); // Fix v1.3 - spell out columns so this also works when columns have been added to the specials table. // Fix v1.4 - set default expiration date to '0' and last modified to $today. // ORIGINAL tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " VALUES ('','$productid','$specialprice','$today','','','','1')"); //*******ADDED BELOW IN ATTEMPT TO GET ADD BEGIN AND END TO SPECIAL CATEGORIES CONTRIBUTION*******FROM SPECIALS*******// tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (specials_id, products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status, valid_from_date) VALUES ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), now(), '" . tep_db_input($expires_date) . "', now(), '1', '". tep_db_input($valid_from_date) ."')"); } } } } ?> <form action="<?php echo $current_page; ?>" method="get"> <table><tr class="dataTableHeadingRow"><td class="dataTableHeadingContent" colspan="6"> <?php echo TEXT_SELECT_CAT .' ' . tep_draw_pull_down_menu('categories', tep_get_category_tree(), $categories); //BoF Added v1.4 allow selection by manufacturer $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } echo TEXT_SELECT_MAN . ' ' . tep_draw_pull_down_menu('manufacturer',$manufacturers_array, $manufacturer) .' '; //EoF Added v1.4 echo TEXT_ENTER_DISCOUNT . ': '; ?> <input type="text" size="4" name="discount" value=" <?php if ($discount > 0) { echo $discount; } echo '">' . TEXT_PCT_AND . ' '; ?> <?php echo TEXT_SPECIALS_VALIDFROM_DATE; ?><br><small>(DD-MM-YYYY)</small> <?php echo tep_draw_input_field('dfrom', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 0, 10) : ''), 'size="4" maxlength="10" class="cal-TextBox"'); ?><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="btnDate1"'); ?><script language="javascript">valid_from_date.writeControl(); valid_from_date.dateFormat="dd/MM/yyyy";</script> <?php echo TEXT_SPECIALS_EXPIRES_DATE; ?><br><small>(DD-MM-YYYY)</small> <?php echo tep_draw_input_field('dto', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 10) : ''), 'size="4" maxlength="10" class="cal-TextBox"'); ?><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="btnDate2"'); ?></a><script language="javascript">expires_date.writeControl(); expires_date.dateFormat="dd/MM/yyyy";</script> <input type="submit" value="<?php echo TEXT_BUTTON_SUBMIT; ?>"> </form></td></tr> <tr class="dataTableContent"><td class="dataTableContent" colspan="6"> <ul><li><?php echo TEXT_INSTRUCT_1; ?></li> <li><?php echo TEXT_INSTRUCT_2; ?></li> </ul> </td></tr> <?php if ($discount == -1) { //echo 'do nothing'; } else if ($discount == 0) { //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories" . $man_filter); } else { $result2 = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p where 1=1" . $man_filter); } //EoF Changed v1.4 while ( $row = tep_db_fetch_array($result2) ){ $allrows[] = $row["products_id"]; } tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id in ('".implode("','",$allrows)."')"); } else if ($discount > 0) { $specialprice = $discount / 100; //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories" . $man_filter); } else { $result2 = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p where 1=1 " . $man_filter); } //EoF Changed v1.4 while ( $row = tep_db_fetch_array($result2) ){ $hello2 = $row["products_price"]; $hello3 = $hello2 * $specialprice; $hello4 = $hello2 - $hello3; $number = $row["products_id"]; $result3 = tep_db_query("select * from " . TABLE_SPECIALS . " where products_id = $number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0){ //echo "Insert into specials (products_id, specials_new_products_price) values ($number, '$hello4')"; //Fix v1.4 set default expiration date to '0' and status active. //tep_db_query("Insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price) values ($number, '$hello4')"); //ORIGINAL tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status ) VALUES ('$number','$hello4','$today','$today','0','','1')"); //*******MY ATTEMPT AT GETTING START AND END IN SPECIALS CATEGORIES*****FROM SPECIALS********** tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status, valid_from_date ) VALUES ('". (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), now(), '" . tep_db_input($expires_date) . "', now(), '1', '". tep_db_input($valid_from_date) ."')"); } else { //echo "Update specials set specials_new_products_price='$hello4' where products_id=$number"; tep_db_query ("Update " . TABLE_SPECIALS . " set specials_new_products_price='$hello4' where products_id=$number"); } } } print (" <tr class=\"dataTableHeadingRow\"> <td class=\"dataTableHeadingContent\">". TABLE_HEADING_PRODUCTS ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PRODUCTS_PRICE ."</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_START_DATE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_END_DATE ."</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">Products Cost</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_PRICE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PCT_OFF ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_FULL_PRICE . "</td> </tr>"); //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p where pd.products_id=ptc.products_id and p.products_id=ptc.products_id and ptc.categories_id = $categories and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } else if ($manufacturer) { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p where pd.products_id=p.products_id and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } else { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p where pd.products_id=ptc.products_id and p.products_id=ptc.products_id and ptc.categories_id = $categories and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } //EoF Changed v1.4 print("<form action=\"$current_page?categories=$categories&manufacturer=$manufacturer\" method=\"post\">"); $base=-1; while ( $row = tep_db_fetch_array($result2) ) { $base++; $number = $row["products_id"]; $result3 = tep_db_query("SELECT * FROM " . TABLE_SPECIALS . " where products_id=$number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0) { $specialprice = "none"; $implieddiscount = ''; } else { while ( $row2 = tep_db_fetch_array($result3) ) { $specialprice = $row2["specials_new_products_price"]; if ($row["products_price"] > 0) { $implieddiscount = '-'.(int)(100-(($specialprice / $row["products_price"])*100)).'%'; } else { $implieddiscount = ''; } } } $tax_rate = tep_get_tax_rate($row['products_tax_class_id']); print(" <tr class=\"dataTableRow\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\" > <td class=\"dataTableContent\">" . $row["products_name"] . "</td> <td class=\"dataTableContent\">" . $row["products_price"] . "</td> <!--//**************MY ADDITION TO SHOW START AND END DATE*********************//--> <td class=\"dataTableContent\">" . $row["valid_from_date"] . "</td> <td class=\"dataTableContent\">" . $row["expires_date"] . "</td> <!--//**************MY ADDTION TO SHOW START AND END DATE**********************// --> <td class=\"smallText\" style=\"color:#777777\">" . $row["products_cost"] . "</td> <td class=\"dataTableContent\"><input name=\"master[".$base."][inputspecialprice]\" type=\"text\" value=\"$specialprice\"></td> <td class=\"dataTableContent\">$implieddiscount </td> <td class=\"dataTableContent\"><input type=\"checkbox\" name=\"master[".$base."][fullprice]\" value=\"yes\"></td> <td class=\"dataTableContent\"><input type=\"hidden\" name=\"master[".$base."][categories]\" value=\"" . $categories ."\"> <input type=\"hidden\" name=\"master[".$base."][productprice]\" value=\"" . $row["products_price"] . "\"> <input type=\"hidden\" name=\"master[".$base."][taxrate]\" value=\"" . $tax_rate . "\"> <input type=\"hidden\" name=\"master[".$base."][productid]\" value=\"" . $number . "\"> "); } print ("</table>"); if($base>=0) print ("<input type=\"submit\" name=\"submit\" value=\"" . TEXT_BUTTON_UPDATE . "\"></form>"); ?> <!------------------------ Code for Specials Admin ends here ---------------------------> </td> </tr> </table> <!-- body_text_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> I think its not working because I don't quite understand the works of all the manufacturing stuff you have in there. I've left all of that alone, and think that is why its not working. And I know I do not have the javascript stuff right, I think it is a defining issue, something I am googling/researching/going out of my mind trying to understand, but I do think I am very close to getting it working Too I am not sure what your intention was for products cost, it doesn't seem to do anything or collect any information, however I left it in there as I didn't want to mess with anything more than I already had. I hope you don't find it offensive that I have attempted make changes to your contribution, I certainly don't mean to insult you, but it was in your notes as something to add some day and I thought, I want to learn php as much as I can, what better way then playing with it. Hope you can help, you've helped me in the past on something else not to long ago, hope we can help each other. Best Wishes Teresa
  9. ttstitches

    ANY JAVA GURUS OUT THERE WILLING TO HELP

    NO ONE IS HELPING..... Okay I have it the calendar is not 3 inputs (date month year) as in the first picture...Its not laid out nicely, still trying to figure out the format but at least it is just one input not 3 BUT still not working Darn it! heres the code <?php echo TEXT_SPECIALS_VALIDFROM_DATE; ?><br><small>(YYYY-MM-DD)</small> <?php echo tep_draw_input_field('dfrom', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 0, 10) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('btnDate1', 'img_Date_OVER',true);" onmouseout="calSwapImg('btnDate1', 'img_Date_UP',true);" onclick="calSwapImg('btnDate1', 'img_Date_DOWN');showCalendar("dfrom", "specialsbycategory", "valid_from_date", "btnDate1");return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="btnDate1"'); ?></a><script language="javascript">drom.writeControl(); dfrom.dateFormat="yyyy-MM-dd";</script> <?php echo TEXT_SPECIALS_EXPIRES_DATE; ?><br><small>(YYYY-MM-DD)</small> <?php echo tep_draw_input_field('dto', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 10) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('btnDate2', 'img_Date_OVER',true);" onmouseout="calSwapImg('btnDate2', 'img_Date_UP',true);" onclick="calSwapImg('btnDate2', 'img_Date_DOWN');showCalendar("dfrom", "specialsbycategory", "expires_date", "btnDate2");return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="btnDate1"'); ?></a><script language="javascript">dto.writeControl(); dto.dateFormat="yyyy-MM-dd";</script> <!--******MY ADDITIONS FROM SPECIALS*********************** --> and here is another picture I do have a MAJOR question... in the java script var valid_from_date = new ctlSpiffyCalendarBox("dfrom", "specialsbycategory", "valid_from_date", "btnDate1","<?php echo $dfrom; ?>",scBTNMODE_CUSTOMBLUE); valid_from_date is the name of the field in specials table dfrom is the make up name to shorten it like a global I think specialsbycategory is the filename that I am working in again valid_from_date is the field in that I am using the calendar to input into the specials table btnDate1 a shortened global like reference to the date in javascript...I probably have these wrong since I don't ANY java, so any help would be great. Teresa
  10. ttstitches

    ANY JAVA GURUS OUT THERE WILLING TO HELP

    Okay, well still plugging along.... any input would be great!!! I've cleaned up some more require('includes/application_top.php'); ?> <!--****MY ADDTIONS IN AN ATTEMPT TO GET POP UP CALENDAR************************************//--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title><?php echo HEADING_TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <div id="spiffycalendar" class="text"></div> <!--*****MY ADDITIONS IN AN ATTEMPT TO GET POP UP CALENDAR***********************************//--> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> now I put the below code just before the form action, thinking that would be a good place for it, but then I noticed above the form action was an "insert" too....I think it is kind of like a "case" but not as formally set up, so maybe this should go higher above that line....I'll play with that, but in the interim, here is the chunk of code: <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"> <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script> <script language="javascript"> var valid_from_date = new ctlSpiffyCalendarBox("valid_from_date", "specialsbycategory", "dfrom", "btnDate1","<?php echo $dfrom; ?>",scBTNMODE_CUSTOMBLUE); var expires_date = new ctlSpiffyCalendarBox("expires_date", "specialsbycategory", "dto", "btnDate2","<?php echo $dto; ?>",scBTNMODE_CUSTOMBLUE); </script> Okay now we are in the gray table shown in the picture in the first post and I've addedthe start date and end date where the calendars are supposed to pop up - this is an area I need to work on as I pulled this from Specials.php and I don't want it to break out into date Month year, one entry with all combined - so I will be messing with this today echo TEXT_ENTER_DISCOUNT . ': '; ?> <input type="text" size="4" name="discount" value="<?php if ($discount > 0) { echo $discount; } echo '">' . TEXT_PCT_AND . ' '; ?> <!--*********MY ADDTITIONS FROM SPECIALS********************//--> <?php echo TEXT_SPECIALS_VALIDFROM_DATE; ?> <?php echo tep_draw_input_field('vday', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('vmonth', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('vyear', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('BTN_valid_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_valid_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_valid_date', 'img_Date_DOWN');showCalendar('new_special','vday', 'vmonth', 'vyear','dte_valid_When','BTN_valid_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_valid_date"'); ?></a> <?php echo TEXT_SPECIALS_EXPIRES_DATE; ?> <?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special', 'day', 'month','year', 'dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a> <!--******MY ADDITIONS FROM SPECIALS*********************** --> <input type="submit" value="<?php echo TEXT_BUTTON_SUBMIT; ?>"> </form></td></tr> <tr class="dataTableContent"><td class="dataTableContent" colspan="6"> <ul><li><?php echo TEXT_INSTRUCT_1; ?></li> <li><?php echo TEXT_INSTRUCT_2; ?></li> </ul> </td></tr> okay now this is the area in the picture below the grey box where the list of individual specials that were pulled from the categories you chose will print out and be visible so this code will set up the table headers //ORIGINAL tep_db_query("Insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price) values ($number, '$hello4')"); //*******MY ATTEMPT AT GETTING START AND END IN SPECIALS CATEGORIES*****FROM SPECIALS********** tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status, valid_from_date ) VALUES '" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), now(), '" . tep_db_input($expires_date) . "', now(), '1', '". tep_db_input($validfrom_date) ."')"); } else { //echo "Update specials set specials_new_products_price='$hello4' where products_id=$number"; tep_db_query ("Update " . TABLE_SPECIALS . " set specials_new_products_price='$hello4' where products_id=$number"); } } } print (" <tr class=\"dataTableHeadingRow\"> <td class=\"dataTableHeadingContent\">". TABLE_HEADING_PRODUCTS ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PRODUCTS_PRICE ."</td> <td class=\"dataTableHeadingContent\">Products Cost</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_START_DATE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_END_DATE ."</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_PRICE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PCT_OFF ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_FULL_PRICE . "</td> </tr>"); Now we are cruising along almost done but WHOA big speed bump for me. This the are where once all the specials are listed (as I mentioned before) a couple of the columns will allow you to edit the specials shown. Say you made a mistake or out of the whole category there was one item you didn't want on sale, here you could click and say "Full Price" on this item...Now sure it would be nice to be able to fix the end date are start date here, but if I get the above working I would be happy with that, what I am thinkins is just to print the start and end dates here, but I have never seen code set up quite like this (lots and lots of slashes) and I don't know what to do here, so I have been saving it for last---any suggestions /////BELOW IS THE EDITING AREA - NEED TO FIGURE OUT HOW TO ADD START AND END TO THIS ///// print(" <tr class=\"dataTableRow\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\" > <td class=\"dataTableContent\">" . $row["products_name"] . "</td> <td class=\"dataTableContent\">" . $row["products_price"] . "</td> <td class=\"smallText\" style=\"color:#777777\">" . $row["products_cost"] . "</td> <td class=\"dataTableContent\"><input name=\"master[".$base."][inputspecialprice]\" type=\"text\" value=\"$specialprice\"></td> <td class=\"dataTableContent\">$implieddiscount </td> <td class=\"dataTableContent\"><input type=\"checkbox\" name=\"master[".$base."][fullprice]\" value=\"yes\"></td> <td class=\"dataTableContent\"><input type=\"hidden\" name=\"master[".$base."][categories]\" value=\"" . $categories ."\"> <input type=\"hidden\" name=\"master[".$base."][productprice]\" value=\"" . $row["products_price"] . "\"> <input type=\"hidden\" name=\"master[".$base."][taxrate]\" value=\"" . $tax_rate . "\"> <input type=\"hidden\" name=\"master[".$base."][productid]\" value=\"" . $number . "\"> "); } print ("</table>"); if($base>=0) print ("<input type=\"submit\" name=\"submit\" value=\"" . TEXT_BUTTON_UPDATE . "\"></form>"); ?> <!------------------------ Code for Specials Admin ends here ---------------------------> So anyways that's what I have so far any help would be great Teresa
  11. ttstitches

    Official PayPal IPN Support Thread

    I figured I misunderstood, because you sound much smarter than me in these matters. If it makes you feel any better, I don't get any emails accept the EXTRA, my customers don't get one and my shopping cart likes to populate itself. I will take my foot out of my mouth and let the more informed Gurus help you. Sorry I interrupted the discussion. Teresa
  12. ttstitches

    Official PayPal IPN Support Thread

    If I understand you right and you are testing on Sandbox...you will not get a confirmation email from PayPal. That is why they have the email section to show you that you WOULD have received one. If you go to the email section in the when you sign on you can see what emails WOULD have been sent. I read on the site they do this so that you don't accidentally confuse them for a real order. Now if you still aren't getting one from PayPal when things are live and you are not in SandBox, then Terra is your girl. Best Wishes Teresa
  13. I am making some improvements on Specials by Category. I've added most of the what is needed (I think) but obviously not everything. Specials by Category presently does not have an end time or a start time, I would like to fix that. So I have used other contributions to kind of MoshPosh something together. I have a picture of it below I've got it mostly working, I just can't get the calendars to pop up like they are supposed to, you click on the arrow to bring them up and nothing happens. I know NOTHING about javascript , but I pulled everything that seemed to reference it from specials.php which uses the calendar for the start date. If any one can give me a push as to what I have done wrong, I would love to get this working for myself and other that might want to use it. I've very clearly commented areas that I messed with/added or changed. Thanks bunches for any help! Teresa <?php /* $Id: specialsbycategory.php,v 2.0 2006/11/07 18:18:00 stephenwald Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2005 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); ?> <!--****MY ADDTIONS IN AN ATTEMPT TO GET POP UP CALENDAR************************************//--> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> <?php if ( ($action == 'new') || ($action == 'edit') ) { ?> <link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css"> <script language="JavaScript" src="includes/javascript/calendarcode.js"></script> <?php } ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <div id="popupcalendar" class="text"></div> <!--*****MY ADDITIONS IN AN ATTEMPT TO GET POP UP CALENDAR***********************************//--> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table> </td> <!-- body_text //--> <td valign="top"> <!----------------------- Actual code for Specials Admin starts here -------------------------> <?php //Fetch all variables $categories = (isset($_GET['categories']) ? (int)$_GET['categories'] : '0'); $manufacturer = (isset($_GET['manufacturer']) ? (int)$_GET['manufacturer'] : '0'); if ($manufacturer) { $man_filter = " and manufacturers_id = '$manufacturer' "; } else { $man_filter = ' '; } if (array_key_exists('discount',$_GET)) { if (is_numeric($_GET['discount'])) { $discount = (float)$_GET['discount']; } else { $discount = -1; } } else { $discount = -1; } if($_POST['submit']) { foreach($_POST['master'] as $m) { $fullprice = (isset($m['fullprice']) ? $m['fullprice'] : ''); $productid = (isset($m['productid']) ? (int)$m['productid'] : '0'); $inputspecialprice = (isset($m['inputspecialprice']) ? $m['inputspecialprice'] : 'none'); if ($fullprice == 'yes') { tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id=$productid;"); continue; } if($inputspecialprice != "none"){ if (substr($inputspecialprice, -1) == '%') { $productprice = (isset($m['productprice']) ? (float)$m['productprice'] : ''); $specialprice = ($productprice - (($inputspecialprice / 100) * $productprice)); } else if (substr($inputspecialprice, -1) == 'i') { $taxrate = (isset($m['taxrate']) ? (float)$m['taxrate'] : '1'); $productprice = (isset($m['productprice']) ? (float)$m['productprice'] : ''); $specialprice = ($inputspecialprice /(($taxrate/100)+1)); } else { $specialprice = $inputspecialprice; } $alreadyspecial = tep_db_query ("SELECT * FROM " . TABLE_SPECIALS . " WHERE products_id=$productid"); $specialproduct= tep_db_fetch_array($alreadyspecial); if ($specialproduct["specials_id"]){ // print ("Database updated. Status:".$specialproduct["status"]); tep_db_query ("UPDATE " . TABLE_SPECIALS . " SET specials_new_products_price='$specialprice' where products_id=$productid "); } else{ // print("New product added to specials table"); } //******ADDED IN ATTEMPT TO GET A POP UP CALENDAR FOR INPUT********FORM SPECIALS.PHP******// $day = tep_db_prepare_input($HTTP_POST_VARS['day']); $month = tep_db_prepare_input($HTTP_POST_VARS['month']); $year = tep_db_prepare_input($HTTP_POST_VARS['year']); $vday = tep_db_prepare_input($HTTP_POST_VARS['vday']); $vmonth = tep_db_prepare_input($HTTP_POST_VARS['vmonth']); $vyear = tep_db_prepare_input($HTTP_POST_VARS['vyear']); // check if valid from date is later than expires date if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year) && tep_not_null($vday) && tep_not_null($vmonth) && tep_not_null($vyear)) { if (($vyear > $year) || ($vmonth > $month && $vyear == $year) || ($vday > $day && $vmonth == $month && $vyear == $year)) { // if so, swap the dates $tempdate = $vyear; $vyear = $year; $year = $tempdate; $tempdate = $month; $vmonth = $month; $month = $tempdate; $tempdate = $vday; $vday = $day; $day = $tempdate; } $today = date("Y-m-d H:i:s"); $expires_date = ''; if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) { $expires_date = $year; $expires_date .= (strlen($month) == 1) ? '0' . $month : $month; $expires_date .= (strlen($day) == 1) ? '0' . $day : $day; } $validfrom_date = ''; if (tep_not_null($vday) && tep_not_null($vmonth) && tep_not_null($vyear)) { $validfrom_date = $vyear; $validfrom_date .= (strlen($vmonth) == 1) ? '0' . $vmonth : $vmonth; $validfrom_date .= (strlen($vday) == 1) ? '0' . $vday : $vday; //*******ADDED IN ATTEMPT TO GET A POP UP CALENDAR FOR INPUT *********FROM SPECIALS.PHP*******// } // Fix v1.3 - spell out columns so this also works when columns have been added to the specials table. // Fix v1.4 - set default expiration date to '0' and last modified to $today. // ORIGINAL tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " VALUES ('','$productid','$specialprice','$today','','','','1')"); //*******ADDED BELOW IN ATTEMPT TO GET ADD BEGIN AND END TO SPECIAL CATEGORIES CONTRIBUTION*******FROM SPECIALS*******// tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (specials_id, products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status, valid_from_date) VALUES ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), now(), '" . tep_db_input($expires_date) . "', now(), '1', '". tep_db_input($validfrom_date) ."')"); } } } } ?> <form action="<?php echo $current_page; ?>" method="get"> <table><tr class="dataTableHeadingRow"><td class="dataTableHeadingContent" colspan="6"> <?php echo TEXT_SELECT_CAT .' ' . tep_draw_pull_down_menu('categories', tep_get_category_tree(), $categories); //BoF Added v1.4 allow selection by manufacturer $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } echo TEXT_SELECT_MAN . ' ' . tep_draw_pull_down_menu('manufacturer',$manufacturers_array, $manufacturer) .' '; //EoF Added v1.4 echo TEXT_ENTER_DISCOUNT . ': '; ?> <input type="text" size="4" name="discount" value="<?php if ($discount > 0) { echo $discount; } echo '">' . TEXT_PCT_AND . ' '; ?> <!--*********MY ADDTITIONS FROM SPECIALS********************//--> <?php echo TEXT_SPECIALS_VALIDFROM_DATE; ?> <?php echo tep_draw_input_field('vday', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('vmonth', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('vyear', (isset($sInfo->valid_from_date) ? substr($sInfo->valid_from_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('BTN_valid_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_valid_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_valid_date', 'img_Date_DOWN');showCalendar('new_special','vday', 'vmonth', 'vyear','dte_valid_When','BTN_valid_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_valid_date"'); ?></a> <?php echo TEXT_SPECIALS_EXPIRES_DATE; ?> <?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special', 'day', 'month','year', 'dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a> <!--******MY ADDITIONS FROM SPECIALS*********************** --> <input type="submit" value="<?php echo TEXT_BUTTON_SUBMIT; ?>"> </form></td></tr> <tr class="dataTableContent"><td class="dataTableContent" colspan="6"> <ul><li><?php echo TEXT_INSTRUCT_1; ?></li> <li><?php echo TEXT_INSTRUCT_2; ?></li> </ul> </td></tr> <? if ($discount == -1) { //echo 'do nothing'; } else if ($discount == 0) { //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories" . $man_filter); } else { $result2 = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p where 1=1" . $man_filter); } //EoF Changed v1.4 while ( $row = tep_db_fetch_array($result2) ){ $allrows[] = $row["products_id"]; } tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id in ('".implode("','",$allrows)."')"); } else if ($discount > 0) { $specialprice = $discount / 100; //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories" . $man_filter); } else { $result2 = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p where 1=1 " . $man_filter); } //EoF Changed v1.4 while ( $row = tep_db_fetch_array($result2) ){ $hello2 = $row["products_price"]; $hello3 = $hello2 * $specialprice; $hello4 = $hello2 - $hello3; $number = $row["products_id"]; $result3 = tep_db_query("select * from " . TABLE_SPECIALS . " where products_id = $number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0){ //echo "Insert into specials (products_id, specials_new_products_price) values ($number, '$hello4')"; //Fix v1.4 set default expiration date to '0' and status active. //ORIGINAL tep_db_query("Insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price) values ($number, '$hello4')"); //*******MY ATTEMPT AT GETTING START AND END IN SPECIALS CATEGORIES*****FROM SPECIALS********** tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status, valid_from_date ) VALUES '" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), now(), '" . tep_db_input($expires_date) . "', now(), '1', '". tep_db_input($validfrom_date) ."')"); } else { //echo "Update specials set specials_new_products_price='$hello4' where products_id=$number"; tep_db_query ("Update " . TABLE_SPECIALS . " set specials_new_products_price='$hello4' where products_id=$number"); } } } print (" <tr class=\"dataTableHeadingRow\"> <td class=\"dataTableHeadingContent\">". TABLE_HEADING_PRODUCTS ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PRODUCTS_PRICE ."</td> <td class=\"dataTableHeadingContent\">Products Cost</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_START_DATE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_END_DATE ."</td> <!--***********MY ADDITIONS FROM ADD TABLE HEADINGS************************//--> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_PRICE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PCT_OFF ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_FULL_PRICE . "</td> </tr>"); //BoF Changed v1.4 if ($categories) { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p where pd.products_id=ptc.products_id and p.products_id=ptc.products_id and ptc.categories_id = $categories and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } else if ($manufacturer) { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p where pd.products_id=p.products_id and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } else { $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p where pd.products_id=ptc.products_id and p.products_id=ptc.products_id and ptc.categories_id = $categories and pd.language_id = " .(int)$languages_id . $man_filter . " order by pd.products_name asc "); } //EoF Changed v1.4 print("<form action=\"$current_page?categories=$categories&manufacturer=$manufacturer\" method=\"post\">"); $base=-1; while ( $row = tep_db_fetch_array($result2) ) { $base++; $number = $row["products_id"]; $result3 = tep_db_query("SELECT * FROM " . TABLE_SPECIALS . " where products_id=$number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0) { $specialprice = "none"; $implieddiscount = ''; } else { while ( $row2 = tep_db_fetch_array($result3) ) { $specialprice = $row2["specials_new_products_price"]; if ($row["products_price"] > 0) { $implieddiscount = '-'.(int)(100-(($specialprice / $row["products_price"])*100)).'%'; } else { $implieddiscount = ''; } } } $tax_rate = tep_get_tax_rate($row['products_tax_class_id']); /////BELOW IS THE EDITING AREA - NEED TO FIGURE OUT HOW TO ADD START AND END TO THIS ///// print(" <tr class=\"dataTableRow\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\" > <td class=\"dataTableContent\">" . $row["products_name"] . "</td> <td class=\"dataTableContent\">" . $row["products_price"] . "</td> <td class=\"smallText\" style=\"color:#777777\">" . $row["products_cost"] . "</td> <td class=\"dataTableContent\"><input name=\"master[".$base."][inputspecialprice]\" type=\"text\" value=\"$specialprice\"></td> <td class=\"dataTableContent\">$implieddiscount </td> <td class=\"dataTableContent\"><input type=\"checkbox\" name=\"master[".$base."][fullprice]\" value=\"yes\"></td> <td class=\"dataTableContent\"><input type=\"hidden\" name=\"master[".$base."][categories]\" value=\"" . $categories ."\"> <input type=\"hidden\" name=\"master[".$base."][productprice]\" value=\"" . $row["products_price"] . "\"> <input type=\"hidden\" name=\"master[".$base."][taxrate]\" value=\"" . $tax_rate . "\"> <input type=\"hidden\" name=\"master[".$base."][productid]\" value=\"" . $number . "\"> "); } print ("</table>"); if($base>=0) print ("<input type=\"submit\" name=\"submit\" value=\"" . TEXT_BUTTON_UPDATE . "\"></form>"); ?> <!------------------------ Code for Specials Admin ends here ---------------------------> </td> </tr> </table> <!-- body_text_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html>
  14. ttstitches

    Official PayPal IPN Support Thread

    Does anyone have any further thoughts as to why the shopping cart in 2.2 is populating with previous customer orders (above) #2162. I'm very concerned people will not want to check out if they see there is some kind of problem with things showing up in their shopping cart before they even do anything. Yes, they do delete and I have a "KNOWN PROBLEM" posted to customers so that they know I know about it and they need only delete the items before they start, but you know customers they are very shy about these kinds of problems. I don't really have any changes going on in "shopping_cart" or in the modules - "shopping_cart". I checked all the settings, I'm not a Newbie, here, but I am no expert either and could really use a push in the right direction, as I don't even know what direction to face. Teresa
×