Jump to content

ttstitches

Members
  • Content count

    136
  • Joined

  • Last visited

Everything posted by ttstitches

  1. I have been testing my site in the checkout process and I keep running into duplicate tax lines and duplicate total lines on the checkout_confirmation.php However, when I go into orders on the admin side, it is correct. I would like to change this asap as I think it will scare off potential customers who think I'm double charging. Any fixes, thoughts or ideas?
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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!
  7. 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
  8. 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>
  9. 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
  10. 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>
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. ttstitches

    Official PayPal IPN Support Thread

    Vger...You are a peach for getting back to me. I checked all your items and the only thing below that was was wrong was the spiders were set to false. I changed this however the shopping cart still has items in it when you login. The good thing is that they do Delete, it just doesn't make a customer feel very confident about the site. The only thing that has changed in my configure files is XSell on the catalog side: //ADD XSELL BEGIN define('DIR_FS_CACHE_XSELL', '/BNWeb//cache/'); //ADD XSELL END and on the admin side is XSell, Constant Contact Dump and User Tracking define('DIR_FS_ADMIN', $DOCUMENT_ROOT . '/BNWeb//catalog/admin/'); //ADD CONSTANT CONTACT EMAIL DUMPS define('DIR_FS_MAIL_DUMPS', DIR_FS_ADMIN.'maildumps/'); //add user tracking bof define('DIR_WS_FLAGS', DIR_WS_IMAGES . 'flags/'); //add user tracking eof //ADD XSELL BEGIN define('DIR_FS_CACHE_XSELL', '/BNWeb//cache/'); //ADD XSELL END And the only thing I saw in Admin Configuration that my be wrong would be in "Logging" Store Database Queries is set to False, but I think that is correct as I believe logging isn't completely working yet, Didn't I read that somewhere.... So with the new information and some feedback on your thoughts....Any other ideas???
  17. ttstitches

    Official PayPal IPN Support Thread

    What I meant to say...Is how do I get the contribution to empty the shopping cart, maybe at each new session? or login...How can I fix this problem, Any thoughts?! Teresa
  18. ttstitches

    Official PayPal IPN Support Thread

    Hi Terra I guess I didn't test enough the other day....A customer bought some items yesterday, somehow paypal didn't go through, but that's not what I'm writing about.... Seems everything from her order is populating to the anyone...Example The items she bought last night are now in my shopping cart when I log in and the item I bought in testing was in her shopping cart last night. Also, the first thing I noticed was that she wrote a long comment when checking out, I find it everywhere now...no matter what customer I log into her comments are prepopulated in their comments. So first thing is first...How do I get this contribution to stop empty the shopping cart. I think what ever solves that is going to solve the comment problem. any thoughts? Teresa
  19. ttstitches

    Official PayPal IPN Support Thread

    WOOF!....I did it. Seems to be working too. Took me 2 hours to get past the following error.. and a few minor ccgv(trad) stragglers I missed in backing out, but after testing through sandbox 3 times now, I think its happy....Only thing I am still looking into is it still doesn't seem to be sending "the customers" checkout confirmation email, but like I said, it wasn't doing that before. I thought maybe it was the Package Tracking with Email Mods but as I was pulling out ccgv, I pulled out that too just to see if that was the culprit...apparently not. If you have any suggestions, I'd be happy to hear them...Thanks again for all that you do! Teresa
  20. ttstitches

    Official PayPal IPN Support Thread

    thanks Terra, You're the best...I am presently backing out ccgv(trad), just about done and then I will update and test... BTW how is work on the integration stuff going, any progress? I'd love to help in anyway I can, I have a pretty mininally visited site that I can test on without worrying to much, if you need someone to do that...Don't know a ton of php but I am getting more knowledgeable every day. Best Wishes Teresa
  21. ttstitches

    Official PayPal IPN Support Thread

    The new version 2.xx works that way, but I haven't upgraded yet as there is still no itegration for CCGV - I've been testing 2.xx, but roll back after testing to what has been more or less, working...(I still can't get emails sent to anyone on a consistent basis). So if I am on 1.3, not going back to the site IS an issue, isn't it? Today I am going to try and roll ccgv out temporarily as I don't use it a lot, and upgrade to the latest, hoping that will solve my email problems and the "not returning to site" isssue. Since I am upgrading form so far back is there anything that I should be changing in other files, say shopping_cart, checkout_process...When looking at the newer files (2.0, 2.1, 2.2) the only thing there is the ipn files no changes to other files. So if a person was putting this in for the first time, it looks like nothing should be changed anywhere else. If that is indeed true than should a person who has older versions go back and take out any older stuff ( I mean aside from filenames for defining and such. Teresa
  22. ttstitches

    Official PayPal IPN Support Thread

    Is anyone else having this problem. I am in test mode and sandbox does not have a link back to the my site...How does one work around that. What they have is after you have put in your credit card information and what looks to have been accepted...it has a screen asking me to put in information to make my next transaction faster by saving my information... then a spot for your email create account password confrim password then a continue button....however the continue button is very clearly stated enter your information, not go back to the site.... So I tried putting information to see if it would eventually bring me to a spot where I could go back to the site, and it does not, in fact after I put in some information, then it asks me to log in (to paypal - Sandbox) and then I get an error 3005 So first off, if a person does not want a paypal account and just wants to buy something off your site, it would feel to them that they are getting pushed into having an account, not to mention messing up my order process. So if the contribution needs the customer to come back to process, how are we going to get around it. Teresa
  23. Still No One has any suggestions, huh?! Well I have added this to specials.php from products_new.php to see if it is a start buy I have some kind of syntax problem and was hoping someone might tell me what it is. Considering I pulled it from another page it should work for the most part...I'm guessing it has to do with the MAX_DISPLAY stuff....Below is the error... AND Here is the code in specials.php that I put in and messed with. <?php //ADD SALEMAKER BOF if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $specials_products_query = tep_db_query("select (products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_DISPLAY_SPECIAL_PRODUCTS); } else { $specials_products_query = tep_db_query("select (p.products_id, p.products_image, p.products_tax_class_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_SPECIAL_PRODUCTS); } //ADD SALEMAKER EOF $specials_split = new splitPageResults($specials_products_query, MAX_DISPLAY_SPECIAL_PRODUCTS); if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td> <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <?php $row = 0; $specials_query = tep_db_query($specials_split->sql_query); while ($specials = tep_db_fetch_array($specials_query)) { //TRYING TO MAKE SPECIALS SHOW UP WITH SALEMAKER INSTEAD OF SPECIALS $special_price = tep_get_products_special_price($specials['products_id']); if ($special_price) { $products_price = '<s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($special_price, tep_get_tax_rate($specials['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($specials['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])); } $row++; // echo ' <td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></td>' . "\n"; //ABOVE REPLACED WITH BELOW //ADDED SALEMAKER BOF echo ' <td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price(tep_get_products_special_price($specials['products_id']), tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></td>' . "\n"; //ADDED SALEMAKER EOF if ((($row / 3) == floor($row / 3))) { ?> Please...Any help would be appreciated. Teresa
  24. As far as I can tell Specials in Category List is pretty straight forward here are the install instructions: Step 1: Using the Admin tool create a "Specials" category at the top level of the categories tree. Do NOT put any products in this category!!!! Make a note of the category id number. You can find this out by clicking on the Specials link and looking at the URL in your browser where it says "......index.php?cPath=xx&....." the xx is the category id. +++++++++++++++++++++++++++++++ Step 2: Open up \catalog\index.php in your editor At line 15 immediately after: require('includes/application_top.php'); add: // Flag for SPECIALS category - change this number to your specials category id number if ($cPath == 139) { change 30 to xx from your URL $AHspecials = 1; } +++++++++++++++++++++++++++++++ Step 3: at about line 186 find: } else { // show the products in a given categories immediately after } else { add: if ($AHspecials == 1) { // We show all specials $listing_sql = "select " . $select_column_list . " p.products_id, pd.short_desc, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where s.status = '1' and p.products_id = p2c.products_id and p.products_id = s.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "'"; } else { It pulls information form Specials table HOWEVER....Salemaker has its own database salemaker_sales with the following fields sale_id, sale_status, sale_name, sale_deduction_value, sale_deduction_type, sale_pricerange_from, sale_pricerange_to sale_specials_condition, sale_categories_selected, sale_categories_all, sale_date_start, sale_date_end, sale_date_added, sale_date_last_modified, sale_date_status_change Since it doesn't pull from the specials table you would think that this would make a nightmare, but it gets around that by (I think) this function in general.php it comments out this // Return a product's special price (returns nothing if there is no offer) // TABLES: products // function tep_get_products_special_price($product_id) { // $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status"); // $product = tep_db_fetch_array($product_query); // return $product['specials_new_products_price']; } and replaces it with function tep_get_products_special_price($product_id) { $product_query = tep_db_query("select products_price, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $product_id . "'"); if (tep_db_num_rows($product_query)) { $product = tep_db_fetch_array($product_query); $product_price = $product['products_price']; } else { return false; } $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $product_id . "' and status"); if (tep_db_num_rows($specials_query)) { $special = tep_db_fetch_array($specials_query); $special_price = $special['specials_new_products_price']; } else { $special_price = false; } if(substr($product['products_model'], 0, 4) == 'GIFT') { //Never apply a salededuction to Ian Wilson's Giftvouchers return $special_price; } $product_to_categories_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_id . "'"); $product_to_categories = tep_db_fetch_array($product_to_categories_query); $category = $product_to_categories['categories_id']; $sale_query = tep_db_query("select sale_specials_condition, sale_deduction_value, sale_deduction_type from " . TABLE_SALEMAKER_SALES . " where sale_categories_all like '%," . $category . ",%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0000-00-00') and (sale_date_end >= now() or sale_date_end = '0000-00-00') and (sale_pricerange_from <= '" . $product_price . "' or sale_pricerange_from = '0') and (sale_pricerange_to >= '" . $product_price . "' or sale_pricerange_to = '0')"); if (tep_db_num_rows($sale_query)) { $sale = tep_db_fetch_array($sale_query); } else { return $special_price; } No that not all of it, but it is enough to see what it is doing. This seems to allow the specials to pretend to be in the specials table, when they aren't really (at least that is what I have surmized since there is nothing in my specials table). The biggest difference between the old way and the Salemaker seems to be that there are not individual products on sale. SaleMaker since it can claim a whole category and its nested categories to the Sale, does not have individual product on sale. The way I perceive it is that it calculates the amount off during the query (more on the fly than the old way). Instead of having dozens of items on sale in your Specials table you have 1 sale based on categories. So what I want I'd like to know if I can do is have all the items that are on sale through Salemaker show up in my Specials Category - A quick reference for customers to see what all is on sale. I think it will just be a query in Specials to refer the sale items to the new category as it did when it flagged them in step 2 at the top of this page. If anyone has any ideas or suggestions, I'd love to hear from you. Thanks Teresa
×