Jump to content

Recommended Posts

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?


If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

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


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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 by saupe31

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Remove this from the middle of the SQL string:

// added for Get 1 Free mod

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

sorry to be a pain any chance you can give me some examples or more fuller instructions im still learning all this atm

Share this post


Link to post
Share on other sites

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


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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 by ckpepper02

Share this post


Link to post
Share on other sites

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)
     )

Share this post


Link to post
Share on other sites

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 by S-Bay

Share this post


Link to post
Share on other sites

I suggest using Version 1.4.2. The later versions seem to all be incomplete.

 

Regards

JIm


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

It looks like that is a mistake in the instructions. I don't have that file in any version.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×