Jump to content

Peter M

Members
  • Content count

    50
  • Joined

  • Last visited

Everything posted by Peter M

  1. Peter M

    SiteMonitor

    I would just like to say at this point that my host is also on 4.4.9 and I am able to run SiteMonitor without any problems. I did have an error 500 internal server error to start with, but I later discovered this was because the script was timing out, as once I had added the admin folder to the excludes list, the error stopped.
  2. Peter M

    Contribution: Auto Backup Database

    I would just like to say here that I have implimented this contribution with great success (once I got my head round how it works)so very well done to the author of this great contribution! One thing I did notice was that as auto_backup_db.php doesn't include the applicaiton_top.php. I found that the date and time being used to generate the file name wasnt the same as when the database manager was saying the back up was made. Having made a small modification to auto_backup_db.php solved that problem. The way I use it is as follows; I have a windows sbs 2003 server which has all the day to day office functions on it including exhcange, general file sharing and accounting systems data etc. On this server I am making use of the job scheduler, so I wanted to keep all my backups and other processes in one place (mostly for ease of admin) so I found a way of being able to call and run a remote php from the server, after much research I found the best way was to use a little command line ftp utility called Wget. What I then did was to set the 2 parameters in the auto backup admin to time interval of 30 minutes and archive interval of 1 1/2 hours. I then scheduled a job in the sheduler on the local server to run auto_backup_db.php every 2 hours, this process starts at 02:00 every morning and does the last one at 22:00. This generates 11 backups at 2 hour intervals over a 22 hour period. My main backup batch script runs at 23:45 every night, (only to keep the dates correct for the day) this calls auto_backup_db.php agian to make the 12th backup .sql file, then it generates new folders by date in the external data backups folder on the raid 5 array and using Wget again downloads the .sql files for the day to a database backup folder and then the entire content of the site to a system folder (excluding the .sql files). This process also backs up 2 other static websites in the same way, then providing the .sql files were downloaded successfully, deletes them from the remote server. Unfortunately Wget doesn't support delete remote files, so I had to resort to building a conventional command line ftp script from within the main backup batch script that does an mdelete of the .sql files by date for that days files only. Once this process is complete, it then does a backup to tape of all data on the raid array using good old NTBackup. The good thing is this is a totally automomous process, the only user intervention requird is to remember to put a tape in the drive! I think this is about as complete a backup process as one could hope for, it certainly gives me confidence in knowing I could if necessary recover from just about any situation including a full rebuild with a copy of the database which is no more than 2 hours old at most. Of course these timings could be changed to suit any purpose, but 2 hours is fine for my needs.
  3. Peter M

    SiteMonitor

    Jack, One more question if I may, how do the run site monitor and delete reference file and run site monitor keeping the existing reference file differ from running it manually or checking for hacked files? Those are the only 2 processes on my shop that give an error 500 problem, I havent found anything else that causes the error. Thanks.
  4. Peter M

    SiteMonitor

    Thanks for that Jack, I have spoken to the host (1 and 1) who say they couldnt see any reason in particular for it, I am well within my resource usage and there are no other apparent problems. They did do a webspace refresh to make sure there were no processes stuck running or anything like that. I have tried it since and still get the same issue. One thing I did notice that having done a phpinfo() I found that this server has php 4.4.9, I also found numerous things on the web that suggest the fix for 1 and 1 in particular is to add the following to the .htaccess file AddType x-mapp-php5 .php But this also made no difference, having said that, I have numerous versions of .htaccess and the only one I changed was in the route of the admin folder, should I change any of the others with the same thing? Thanks:)
  5. Peter M

    SiteMonitor

    I have a problem where if I run sitemonitor.php through a browser it gives me a report on the screen, but even though I have set it to always email me, which it used to do up until yesterday. Now it doesnt send any email and if I run it through the admin it comes up with an error 500 - Internal Server Error. If I run it manually from the Site Monitor Admin, it works. I have got auto_backup on this shop too and have already checked the clash in the microtime_float, but I must have a later version of the site monitor code as mine says SiteMonitor_microtime_float, even so I have commented it out but that makes no difference. Any help greatly appreciated.
  6. Thanks for that, much appeciated. I'll find and download Great Categories now and then see about the login box.
  7. Hi All, I am still developing my site, so am still on the lookout for layout features etc. The other day I happened to come across this site www.demonpowerproducts.co.uk and was wondering if anyone recognises the categories box and the extended sign in box contributions? Many thanks, Peter.
  8. Peter M

    [Contrib] Make An Offer

    Hi, I am in the middle of installing this contribution, which was going fine until I got to application_top.php I have Option Types V2 loaded also and have found that merging the two contributions awkward to say the least, in the following section of code where the instructions call for the following to be replaced; The instructions say find; // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; This code is replaced with; // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { // No offer is made or direct offers are disabled // so the default price is accepted $offeracceptable = true; // Addition for Make An Offer if (MAO_ACCEPT_OFFER_DIRECTLY == 'true') { if (!$HTTP_POST_VARS['newpriceoffer'] == '') { $offeracceptable = mao_check_offer($HTTP_POST_VARS['newpriceoffer'], $HTTP_POST_VARS['products_id']); if ($offeracceptable == true) { if (!tep_session_is_registered('mao_accepted_offer')) { $mao_accepted_offer = array(); $mao_accepted = array('productid' => $HTTP_POST_VARS['products_id'],'newprice' => $HTTP_POST_VARS['newpriceoffer'],'initialvaluta' => $currency); array_push($mao_accepted_offer, $mao_accepted); tep_session_register('mao_accepted_offer'); } else { $mao_accepted = array('productid' => $HTTP_POST_VARS['products_id'],'newprice' => $HTTP_POST_VARS['newpriceoffer'],'initialvaluta' => $currency); array_push($mao_accepted_offer, $mao_accepted); } } } } if ($offeracceptable == true) { tep_session_unregister('mao_low_offer'); $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } else { tep_session_register('mao_low_offer'); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; My problem is having Option Types V2 installed, by case=add product looks quite different, as follows; // customer adds a product from the products page case 'add_product' : //BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR); while ($file = readdir($purgeDir)) { if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) { unlink(TMP_DIR . $file); // Delete file from server... tep_db_query("delete from " . TABLE_FILES_UPLOADED . " where files_uploaded_name = '" . $file . "'"); // Remove File's database entry.... } } closedir($purgeDir); //EOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir //BOF - Zappo - Option Types v2 - ONE LINE - Set real_ids for processing $real_ids = $HTTP_POST_VARS['id']; //BOF - Zappo - Option Types v2 - File uploading: save uploaded files with unique file names, in the proper folder if ($HTTP_POST_VARS['number_of_uploads'] > 0) { require(DIR_WS_CLASSES . 'upload.php'); for ($i = 1; $i <= $HTTP_POST_VARS['number_of_uploads']; $i++) { $TEMP_FILE = $_FILES['id']['tmp_name'][TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]]; if (tep_not_null($TEMP_FILE) && $TEMP_FILE != 'none') { $products_options_file = new upload('id'); //BOF - Zappo - Option Types v2 - Set Upload directory (Registered customers in Uploads, other in Temporary folder) if (tep_session_is_registered('customer_id')) { // IF the customer is registered, use Upload Dir $products_options_file->set_destination(UPL_DIR); } else { // If the customer is not registered, use Temporary Dir $products_options_file->set_destination(TMP_DIR); } //EOF - Zappo - Option Types v2 - Set Upload directory (Registered customers in Uploads, other in Temporary folder) if ($products_options_file->parse(TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i])) { if (tep_session_is_registered('customer_id')) { tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name, date) values('" . tep_session_id() . "', '" . $customer_id . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')"); } else { tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name, date) values('" . tep_session_id() . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')"); } //BOF - Zappo - Option Types v2 - Set File Prefix if (OPTIONS_TYPE_FILEPREFIX == 'Database') { // Database ID as File prefix $insert_id = tep_db_insert_id() . '_'; } else { // Date, time or both as File prefix (Change date formatting here) if (OPTIONS_TYPE_FILEPREFIX == 'Date' || OPTIONS_TYPE_FILEPREFIX == 'DateTime') { $insert_id = 'D'.date("d-m-y_"); } $insert_id .= (OPTIONS_TYPE_FILEPREFIX == 'DateTime' || OPTIONS_TYPE_FILEPREFIX == 'Time') ? 'T'.date("H-i_") : ''; } //EOF - Zappo - Option Types v2 - Set File Prefix // Update filename in Database with correct prefix (For comparing database names with real files) tep_db_query("update " . TABLE_FILES_UPLOADED . " set files_uploaded_name = '" . tep_db_input($insert_id . $products_options_file->filename) . "' where sesskey = '" . tep_session_id() . "' and files_uploaded_name = '" . tep_db_input($products_options_file->filename) . "' and date = '" . date("d-m-y") . "'"); $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $insert_id . $products_options_file->filename; $products_options_file->set_filename($insert_id . $products_options_file->filename); if (!($products_options_file->save())) { break 2; } } else { break 2; } } else { // No file uploaded -- use previously uploaded file (From Dropdown) $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $HTTP_POST_VARS[TEXT_PREFIX . UPLOAD_PREFIX . $i]; } } } //EOF - Zappo - Option Types v2 - File uploading: save uploaded files with unique file names, in the proper folder //BOF - Zappo - Option Types v2 - ONE LINE - Replace the posted array with the processed one. $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids))+1, $real_ids); // Peter Milner } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; My question is, can anyone advise me on how best to merge these two contributions? Thanks! Peter.
  9. Peter M

    Any contribution for discontinued products?

    Hi, Has anyone got any further with this? as I too need something like this, so I am very interested in any progress. Thanks!
  10. Peter M

    [Contribution] Option Types v2

    Hi Fyod, I suspect you might find that you are missing your case statement, which is why you had one to many curly brackets; In the chunk of code that begins with; //BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR); while ($file = readdir($purgeDir)) { if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) { If the begining of that chunk looks like the above and not like this; case 'add_product' : //BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR); while ($file = readdir($purgeDir)) { if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) { Then you are definitely missing the case 'add_product' : beginning to the code. Once you put this back in, you will need to put that curly bracket back in at the bottom of that section of code too.
  11. Peter M

    [Contribution] Product Units

    Hi, I have just installed this great contribution and it works fine. One thing I have spotted though, is the unit is displayed everywhere apart from in product_info.php, is there any particular reason for this?
  12. Hi Chris, I assume this sql is from catalog/admin/categories.php, in which case this is my sql statement from the copy as == duplicate section of the code; tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_image_array, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_availability_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_image_array']) . "', '" . tep_db_input($product['products_price']) . "', now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')"); Aside from an extra field in the shape of products_availability_id, there doesn't seem to be that much difference in the two. I wonder therefore, if it might be something to do with the database update sql code that came with either this contribution or the Extra Product Fields one? Pete.
  13. Hi Chris, I am running this contribution quite happliy with several others, one of which is Extra Product Fields v1.2. A full list of the other contributions I have is as follows; Add Button Back v1.3 Bundled Products v1.6 Category and Products in Title Bar Customer Extra Fields Extended v1.3 - Currently has a Clash in Extra Fields Manager with Extra Product Fields, needs sorting! Extra Product Fields v1.2 Get 1 Free v1.4.1 OSCThumb Option Types v2.1.3 Phone Payment Module Product Availability v1.03 Simple Multiple Images Unlimited (With fancy Popups) - This contribution Simply Hide Products v1.1 Store Pickup v1.4 As you can see, the list of contributions I have is fairly substantial, I have found some contributions a little difficult to merge simply by following the instructions in each one. The main issue seems to be the various SQL statements which have had fields added and changed in the various contributions. If you would like a copy of any of my .php files to compare to your own, please do pm me an email address an I'll email them over to you. Best of luck! Pete.
  14. Hi AugustinParis, It looks to me like your error is not actually in the function reported, but in another php file that called the function, most likely with incorrect parameters. In order to fix the problem, we first need to know exactly what it was you were doing when you got the error. For example if you were selecting a category and expecting to see a list of products in that category, then the problem is in the products listing php which is called products_listing.php in the catalog/includes folder. Or perhaps in this case you were clicking on a product from a category, in which case the problem is in the product_info.php file in the catalog/ folder. As spooks said, it is well worthwhile taking the orignial files you saved just before installing this contribution and comparing them with some sort of compare tool to the ones that came in th folder with the downloaded contribution folder. I personally use WinMerge which is a free tool that can be downloaded from the interweb. A great place to start would be to make sure you ran the sql file that was included in the contribution download folder, the sql you should have run is as follows; ALTER TABLE `products` ADD `products_image_array` blob; INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Tiny Image Width', 'TINY_IMAGE_WIDTH', '30', 'Image width for additional image thumbnail', 4, 20, NULL, now(), '', ''); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Tiny Image Height', 'TINY_IMAGE_HEIGHT', '30', 'Image height for additional image thumbnail', 4, 21, NULL, now(), '', ''); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Additional images per row/column', 'TINY_IMAGE_GROUP_SIZE', '3', 'Number of additional images to show per row/column in the product display', 4, 22, NULL, now(), '', ''); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Additional Image Format', 'ADDITIONAL_IMAGE_FORMAT', 'horizontal', 'Show additional image in a vertical or horizontal format', 4, 23, NULL, now(), '', 'tep_cfg_select_option(array(\'horizontal\', \'vertical\'),'); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Dim background on popup', 'DIM_BACKGROUND', 'false', 'Dim the background when popup images are shown. (enabled, this option can make the zoom action less smooth).', 4, 24, NULL, now(), '', 'tep_cfg_select_option(array(\'true\', \'false\'),'); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Background luminosity', 'BKG_LUMA', '2', 'How much to dim background, if enabled. 1 = min, 9 = max.', 4, 25, NULL, now(), '', 'tep_cfg_select_option(array(\'1\', \'2\',\'3\',\'4\',\'5\',\'6\',\'7\',\'8\',\'9\'),'); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Popup images dragable', 'DRAG_POPUP', 'false', 'Enable dragging of popup images.', 4, 26, NULL, now(), '', 'tep_cfg_select_option(array(\'true\', \'false\'),'); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Popup \'swing\' effect', 'SWING_POPUP', 'true', 'Add a \'swing\' effect to the opening popup zoom.', 4, 27, NULL, now(), '', 'tep_cfg_select_option(array(\'true\', \'false\'),'); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Show popup navigation', 'SHOW_NAV', 'false', 'Always show popup navigation icons, or hide till mouse over.', 4, 28, NULL, now(), '', 'tep_cfg_select_option(array(\'true\', \'false\'),'); INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Popup navigation position', 'POS_NAV', 'middle', 'Position the popup navigation icons at the top, middle or bottom of images.', 4, 29, NULL, now(), '', 'tep_cfg_select_option(array(\'top\', \'middle\',\'bottom\'),'); Let us know how you get on.
  15. Peter M

    CCGV - PHP5.3 - mySQL 5

    I am also very interested in a decent Gift Voucher system! Any news on how it is progressing? Also, do I go ahead and install version 5.21 that I have just downloaded, or would it be better to wait for the new GV functionality and load the new version?
  16. Just to let everyone know, Ive done some more digging and have found the problem, it was a clash with the bundled products contribution. Having made some minor changes to the SQL selections from the products table it all works fine now!
  17. Hi, I have managed to merge the contributions now myself, although it looks like I havent got it quite right just yet. I have just been testing and have found that if I click on the image of a product in product_listing.php, it tries to open product_info.php I assume, but fails with the following message; Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /homepages/0/d177551101/htdocs/pmashop/includes/functions/database.php on line 151 If I look at the code being refered to in the message it is as follows; function tep_db_num_rows($db_query) { return mysql_num_rows($db_query); } I would appreciate any help anyone can offer.
  18. Hi, I am in the middle of installing this contribution and have run into a bit of difficulty. In the installation details where it says to find and replace the following code in catalog/admin/categories.php The code to find is this; 'products_price' => '', 'products_weight' => '', 'products_date_added' => '', 'products_last_modified' => '', 'products_date_available' => '', 'products_status' => '', 'products_tax_class_id' => '', 'manufacturers_id' => ''); $pInfo = new objectInfo($parameters); if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) { // Simple multi image addon $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); As I have several other contributions installed on my system, my code looks a little different, see bellow; 'products_price' => '', 'products_weight' => '', 'products_date_added' => '', 'products_last_modified' => '', 'products_date_available' => '', 'products_status' => '', 'products_tax_class_id' => '', 'manufacturers_id' => ''); // begin Extra Product Fields foreach ($xfields as $f) { $parameters = array_merge($parameters, array($f => '')); } // end Extra Product Fields $pInfo = new objectInfo($parameters); if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) { // begin Extra Product Fields // Peter Milner - Add p.products_bundle for Bundled Products Contribution $query = "select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_bundle"; foreach ($xfields as $f) { $query .= ', pd.' . $f; } $query .= " from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"; $product_query = tep_db_query($query); // end Extra Product Fields $product = tep_db_fetch_array($product_query); My question, is what is the best way to merge these contributions? Thanks in advance for your help
  19. Peter M

    Bundled products

    Hi Again, I have now modified the code to comply with the stock settings in the admin panel. It now checks to see whether both stock check and Allow Checkout are enabled or not. // BOF Bundled Products case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $StockChecker1 = tep_get_products_stock($listing['products_id']); // Peter Milner - Phoenix Model Aviation Ltd (www.phoenixmodelaviation.co.uk) // Check to see if stock_check is true or false, also check stock_allow_checkout is true or false if (STOCK_CHECK == 'true') { if ($StockChecker1 < 1) { if (STOCK_ALLOW_CHECKOUT == 'false') { $lc_text = tep_image_button('button_out_of_stock.gif', IMAGE_BUTTON_OUT_OF_STOCK) . ' '; } else { $lc_text = (($listing['products_price'] > 0) ? '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' : ' '); } } else { $lc_text = (($listing['products_price'] > 0) ? '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' : ' '); } } else { $lc_text = (($listing['products_price'] > 0) ? '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' : ' '); } break;
  20. Peter M

    Bundled products

    Hi, I have found the code that does this, its in catalog/includes/modules/product_listing.php Do a search for the following code; // BOF Bundled Products case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $StockChecker1 = tep_get_products_stock($listing['products_id']); if ( $StockChecker1 <> 0){ $lc_text = (($listing['products_price'] > 0) ? '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' : ' '); }else{ $lc_text = tep_image_button('button_out_of_stock.gif', IMAGE_BUTTON_OUT_OF_STOCK) . ' '; } break; // EOF Bundled Products As you can see, it's checking to see if the stock level is <> 0, if so, it displays the Buy It Now button, if not, i.e. the stock level is 0 it displays the Out of Stock image instead. I am currently looking at this code with the view to modifying it to include the check to see whether stock checking is turned on or off in the stock section of the configuration part of the Admin area. Once I have figured it out, I will post the modified code here too, so keep an eye out for it;)
  21. Peter M

    Extra Product Fields 1.0

    Hello, I am using this contribution along side another similar one, i.e. Customer Extra Fields Extended V1.3 The problem I am having is these two contributions wont play happily together as they both have a script which for each one is completely different, but shares the same name, extra_fields.php is the offending script. Has anyone else had anything like this and how easy is it to rename the script for one or both contributions? Thanks!
  22. For those of you that have been following the tutorials earlier in this thread, you may have noticed that although the create account etc. is now in UK format, when you go into an existing account or look at delivery information and so on, you will notice the address format is still in a US based one. To complete the mod, you need to run an SQL in MySql or something similar to change the format in the SQL table. The SQL you need to run is as follows; UPDATE `address_format` SET `address_format` = '$firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country' WHERE `address_format_id` =1 LIMIT 1 ; Result: First Last Street City State Postcode Country
  23. Peter M

    Bundled Products

    Hello, I have just spent a little time looking through the code for bundled products. It would seem that the only reason the number of products that can be added to a bundle is 6 is because that is what has been hard coded, I found this code in catalog/admin/categories.php I am still incidentially, having a problem where if I create or edit a product and set it up with other products as bundle products and exit, everything works fine. If I then go back in to the bundle product, the bundled products are no longer listed, which if I save and exit as it is, and then go into the product on the customer side, the product is no longer a bundle and has no bundled products. This means that each time I edit a bundled product I have to setup the bundle products again. Having looked at the code again in catalog/admin/categories.php I can see there is a call to perform an SQL delete or an insert, but no select. I would also like to suggest that the entry of the bundled products be more of a table form as the product attributes are at the bottom of the product_attributes.php this would enable people like me who need more than 6 products in various bundles to utilise this cntribution to the fullest. I have already tested that the rest of the logic works, which it does fine, by manually adding around 12 or so products to the products_bundles table via an SQL insert into statement in MySql.
  24. Peter M

    Customers extra fields

    Hello, I have just installed this contribution, the install was very smooth with no reported errors of any sort. However, as I also use Products Extra Fields V1.2, the Extra Fields Manager in my tools section of the admin panel refers to product fields and not the customer ones. How can I move the admin of customer extra fields to the customer section of the admin panel instead?
  25. Peter M

    [Contribution] Option Types v2

    Hi Zappo, Sorry about that, I'm still finding my way round this forum at the moment and wasnt sure how to show a code snippet. I have now worked it out, so in future I will use it whenever putting code on a post. I have fixed the problem with application_top.php, as you mentioned it was the fact that I didnt have the case statement on the first line as I simply copied and pasted the code in the instructions and replaced it with the replacement code. My software consists of Dreamweaver CS3 and the WinMerge comparison tool, so yes, I do use a comparison tool to check code changes in any contributions I install. I have been looking at the calendar tool as used in the date effective from field on the product record, the calendar box itself is actually a java script, the code for which in catalog/admin/categories.php is as follows; <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 dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE); //--></script> <script language="javascript"><!-- I assume the call to this function would be much the same in option_types.php, which as you previously suggested, I have been looking at the option_type_text code. This code obviously wouldnt need the progress bar, which would simplify things a little. I would also need to create the $tmp_html variable, how would I best integrate the java script into this? Thanks once again for your help :)
×