Guest Posted July 6, 2011 Share Posted July 6, 2011 Well i'm stumped. I re checked everything and its all there. I did notice that the mods txt file has changes in product_info.php with g1f. db callouts. The sql file does not have these. Could this be the issue? Quote Link to comment Share on other sites More sharing options...
♥kymation Posted July 6, 2011 Author Share Posted July 6, 2011 The product_info.php does call TABLE_GET_1_FREE. That has to be properly defined, and the get_1_free table has to exist. Otherwise I don't know what you mean. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
saupe31 Posted August 5, 2011 Share Posted August 5, 2011 (edited) i have installed this mod but when i go to the admin panel catalog and clcik on get 1 free all i get is a white screen, dont worry i uploaded one of the files wrong Edited August 5, 2011 by saupe31 Quote Link to comment Share on other sites More sharing options...
saupe31 Posted August 5, 2011 Share Posted August 5, 2011 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '// added for Get 1 Free mod g1f.products_free_quantity, ' at line 2 select pd.products_name, pd.products_id, // added for Get 1 Free mod g1f.products_free_quantity, g1f.products_qualify_quantity from get_1_free g1f, products_description pd where g1f.products_id = '238' and pd.products_id = g1f. products_free_id and pd.language_id = '1' and status = '1' im getting this error on my product pages Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 5, 2011 Author Share Posted August 5, 2011 Remove this from the middle of the SQL string: // added for Get 1 Free mod Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
saupe31 Posted August 6, 2011 Share Posted August 6, 2011 create a new infobox in includes/boxes/get_1_free.php say now create a template for get_1_free.php you will also need to add this in the includes/modules/sts_inc/sts_column_left.php in your new box paste the following code <?php /* $Id: get_1_free.php 1739 2007-12-20 00:52:16Z hpdl $ Copyright (c) 2003 osCommerce, http://www.oscommerce.com Released under the GNU General Public License */ //random if more than one free product $get_1_free_query = tep_db_query("select products_id from " . TABLE_GET_1_FREE . " order by rand() limit 0,12"); if (tep_db_num_rows($get_1_free_query) > 0) { $free_product = tep_db_fetch_array($get_1_free_query); $product_info_query = tep_db_query("select p.products_id, pd.products_name, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$free_product['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_info_query); ?> <!-- get_1_free //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => 'Get 1 Free'); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($product['products_price'], tep_get_tax_rate($product['products_tax_class_id'])); new infoBox($info_box_contents); ?> </td> </tr> <!-- get_1_free_eof //--> <?php } ?> I havent been able to test it but it should work ok how would i go about making the box so it has a arrow like the reviews box where you click on it and it opens up a new page and it will show all get1 frees there Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 6, 2011 Author Share Posted August 6, 2011 Replace this line: new infoBoxHeading($info_box_contents, false, false); with this: new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_GET_1_FREE)); Replace FILENAME_GET_1_FREE with whatever you defined your new filename to be, or just define that. Then create that page (similar to reviews.php) and collect the product IDs from the get_1_free database table. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
saupe31 Posted August 6, 2011 Share Posted August 6, 2011 sorry to be a pain any chance you can give me some examples or more fuller instructions im still learning all this atm Quote Link to comment Share on other sites More sharing options...
ckpepper02 Posted August 9, 2011 Share Posted August 9, 2011 Instead of Get One Free, is there a way to buy one get one at $x price? Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 9, 2011 Author Share Posted August 9, 2011 Probably, but not with this code. You might be able to modify it to do that if you want the "free" products to sell at a single fixed price. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
ckpepper02 Posted August 9, 2011 Share Posted August 9, 2011 Ok thank you, I'll give it a try. My package seems to be missing catalog/admin/includes/functions/get_1_free.php, can you tell me where to download it again? Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 9, 2011 Author Share Posted August 9, 2011 There's no such file in Version 1.3, which is the latest one I support. You're on your own with any of the "later" versions. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
ckpepper02 Posted August 10, 2011 Share Posted August 10, 2011 (edited) There's no such file in Version 1.3, which is the latest one I support. You're on your own with any of the "later" versions. Regards Jim Ok, thanks. I just downloaded 1.3 and I'm attempting to modify catalog/admin/includes/boxes/catalog.php but it looks like the structure is different than specified in the installation instructions. The install.txt says to look for this: '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>'; But that is not found, I only have this: array( 'code' => FILENAME_PRODUCTS_EXPECTED, 'title' => BOX_CATALOG_PRODUCTS_EXPECTED, 'link' => tep_href_link(FILENAME_PRODUCTS_EXPECTED) ) Any suggestions? Could I simply skip this step? Edited August 10, 2011 by ckpepper02 Quote Link to comment Share on other sites More sharing options...
ckpepper02 Posted August 10, 2011 Share Posted August 10, 2011 I think I figured it out. array( 'code' => FILENAME_GET_1_FREE, 'title' => BOX_CATALOG_GET_1_FREE, 'link' => tep_href_link(FILENAME_GET_1_FREE) ) Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 10, 2011 Author Share Posted August 10, 2011 The instructions are for osC version 2.2x. You'll need to convert to 2.3.1. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
ckpepper02 Posted August 10, 2011 Share Posted August 10, 2011 Ah, thanks. Quote Link to comment Share on other sites More sharing options...
S-Bay Posted January 23, 2012 Share Posted January 23, 2012 (edited) Hi hello in the install.txt talk about one catalog/admin/includes/functions/get_1_free.php but that file dont come ! did i miss something? Edited January 23, 2012 by S-Bay Quote Link to comment Share on other sites More sharing options...
♥kymation Posted January 23, 2012 Author Share Posted January 23, 2012 I suggest using Version 1.4.2. The later versions seem to all be incomplete. Regards JIm Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
S-Bay Posted January 23, 2012 Share Posted January 23, 2012 ok Tks Jim :) Regards Quote Link to comment Share on other sites More sharing options...
S-Bay Posted January 23, 2012 Share Posted January 23, 2012 the 1.4.2 that say Just a merging of 2 confusing steps in the install document. COMPLETE PACKAGE have the 1.4.1 after you open the zip file and the file in question still missing Quote Link to comment Share on other sites More sharing options...
♥kymation Posted January 23, 2012 Author Share Posted January 23, 2012 It looks like that is a mistake in the instructions. I don't have that file in any version. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
mile500 Posted July 27, 2012 Share Posted July 27, 2012 Hi I try to install but i get this error 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-12, 12' at line 20 select p.products_id, pd.products_name, p.products_price, g1f.get_1_free_id, g1f.products_free_id, g1f.products_free_quantity, g1f.products_qualify_quantity, g1f.products_multiple, g1f.get_1_free_date_added, g1f.get_1_free_last_modified, g1f.get_1_free_expires_date, g1f.date_status_change, g1f.status from products p, get_1_free g1f, products_description pd where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = g1f.products_id order by pd.products_name limit -12, 12 Can you help? thanks Quote Link to comment Share on other sites More sharing options...
♥kymation Posted July 27, 2012 Author Share Posted July 27, 2012 That error is caused by running a very old copy of osCommerce on a newer version of PHP. Maybe if you post your osC version number and the page you're seeing this error on I can help. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
mile500 Posted July 27, 2012 Share Posted July 27, 2012 Hi Jim Thanks foryour answer. I get the error in the admin page /admin/get_1_free.php I´m Using the version 2.2 Thanks in advance Pauxico Quote Link to comment Share on other sites More sharing options...
♥kymation Posted July 27, 2012 Author Share Posted July 27, 2012 There is no osCommerce version 2.2. I don't have time to look them all up, but this was fixed in osCommerce 2.2RC2a and probably before. You need to update your code to fix this problem. I recommend doing the bugfixes as well as the security fixes. Note that it would probably be easier to just start over with a clean copy of 2.3.2 and make whatever changes you need. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.