Guest Posted March 31, 2006 Share Posted March 31, 2006 (edited) after some trial & error i just disabled the buy now function and manually entered: $freebie[$p]['link'] = '<a href="http://www.mysite.com & # 0 4 7; product_info.php?action=buy_now&products_id=' . $gift['products_id'] . '">add free item to cart</a>'; this will likely clear any cart contents for those with cookies disabled though, but i guess that's a fix for later. nevertheless, the item doesn't add. if i enter a different product id in place of $gift['products_id'] - the product doesn't add itself to the cart, but instead i am bounced to the product's actual page now if i manually type: http://www.mysite.com/product_info.php?act...roducts_id=1640 into my address bar - it just shows me the shopping cart with this item not in there. anyone know what edit i may have missed? Edited March 31, 2006 by eww Quote Link to comment Share on other sites More sharing options...
Guest Posted April 1, 2006 Share Posted April 1, 2006 my problems fixed, thanks to boxtel: http://www.oscommerce.com/forums/index.php?showtopic=198978 she also offered a very useful (and simple) hack to get the freebie item load to your customer's cart automatically. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 1, 2006 Share Posted April 1, 2006 does anyone know how to hide the carrots from all_products.php (contribution) query: $products_query = tep_db_query("SELECT p.products_id, pd.products_name, pc.categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc WHERE p.products_id = pd.products_id AND p.products_id = pc.products_id AND p.products_status = 1 AND pd.language_id = FLOOR($languages_id) ORDER BY pd.products_name"); i've tried just about every combination i can think of and they all produced an error along the lines of: 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 ' p.products_id = pd.products_id AND p.products_carrot = 0, p.pr SELECT p.products_carrot, p.products_id, pd.products_name, pc.categories_id FROM products p, products_description pd, products_to_categories pc WHERE p.products_carrot = 0, p.products_id = pd.products_id AND p.products_carrot = 0, p.products_id = pc.products_id AND p.products_status = 1 AND pd.language_id = FLOOR(1) ORDER BY pd.products_name [TEP STOP] Quote Link to comment Share on other sites More sharing options...
ras Posted April 2, 2006 Share Posted April 2, 2006 ras,in catalog/shopping_cart.php look for: <td class="smallText" bgcolor="#FFFFFF"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='.$freebie[$i]['id'] replace with: <td class="smallText"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='.$freebie[$i]['id'] i also have a question: is it possible to have the gift product added automatically to the customer's cart once they've reached the threshold? due to my current search engine friendly url's, the buy now button doesn't seem to work. yes you can. you set the threshold and than in the cart user will see the gifts you set to be gifts or discounted. it does not allow more than one gift per order. i also use the sefurls and it works fine. Quote Link to comment Share on other sites More sharing options...
Glimjaur Posted April 13, 2006 Share Posted April 13, 2006 I am having a small problem with this contribution, i've installed it and i believe everything should be working fine, but when i try to go to the add_gift.php page i get this error; 1054 - Unknown column 'fg.products_id' in 'on clause' SELECT fg.*, p.products_id, pd.products_name FROM free_gifts fg, products p LEFT JOIN products_description pd ON (pd.products_id=fg.products_id) WHERE pd.language_id = '1' AND p.products_id = fg.products_id ORDER BY fg.threshold ASC [TEP STOP] It seems like its a problem with my database or so, but i dont know what.. does anyone have an idea? Quote Link to comment Share on other sites More sharing options...
oneill Posted April 14, 2006 Share Posted April 14, 2006 I am having a small problem with this contribution, i've installed it and i believe everything should be working fine, but when i try to go to the add_gift.php page i get this error; 1054 - Unknown column 'fg.products_id' in 'on clause' SELECT fg.*, p.products_id, pd.products_name FROM free_gifts fg, products p LEFT JOIN products_description pd ON (pd.products_id=fg.products_id) WHERE pd.language_id = '1' AND p.products_id = fg.products_id ORDER BY fg.threshold ASC [TEP STOP] It seems like its a problem with my database or so, but i dont know what.. does anyone have an idea? Upgrade MySql 4 to 5 maybe ? Quote Link to comment Share on other sites More sharing options...
Glimjaur Posted April 14, 2006 Share Posted April 14, 2006 Upgrade MySql 4 to 5 maybe ? Database: MySQL 5.0.18-standard Sorry, its not that.. Quote Link to comment Share on other sites More sharing options...
beginner3241 Posted April 15, 2006 Share Posted April 15, 2006 (edited) I have the same problem and the same error message! My problem is, that the sql file is not yet proper installed... Maybe someone can help me with that and maybe you have a similar problem ... If i add the text of the free_gifts.sql to the textbox "execute SQL-Command in Database free_gifts" in PhPmyAdmin i get the error message SQL-Befehl: INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function ) VALUES ( '880', 'Gifts Image Width', 'GIFTS_IMAGE_WIDTH', '100', 'The pixel width of heading images', '4', '25', now( ) , now( ) , NULL , NULL ) MySQL meldet: Dokumentation #1146 - Table 'free_gifts.configuration' doesn't exist greets Edited April 15, 2006 by beginner3241 Quote Link to comment Share on other sites More sharing options...
Glimjaur Posted April 16, 2006 Share Posted April 16, 2006 I have the same problem and the same error message! My problem is, that the sql file is not yet proper installed... Maybe someone can help me with that and maybe you have a similar problem ... If i add the text of the free_gifts.sql to the textbox "execute SQL-Command in Database free_gifts" in PhPmyAdmin i get the error message [/color] greets You should not try to execute it in the databse free_gifts, but in the main oscommerce database catalog! Quote Link to comment Share on other sites More sharing options...
ras Posted April 17, 2006 Share Posted April 17, 2006 I am having a small problem with this contribution, i've installed it and i believe everything should be working fine, but when i try to go to the add_gift.php page i get this error; 1054 - Unknown column 'fg.products_id' in 'on clause' SELECT fg.*, p.products_id, pd.products_name FROM free_gifts fg, products p LEFT JOIN products_description pd ON (pd.products_id=fg.products_id) WHERE pd.language_id = '1' AND p.products_id = fg.products_id ORDER BY fg.threshold ASC have same problem and yes moved to mysql 5. how do i fix this? Thanks Quote Link to comment Share on other sites More sharing options...
ras Posted April 17, 2006 Share Posted April 17, 2006 have same problem and yes moved to mysql 5. how do i fix this? Thanks for those who moved to mysql 5 edit your admin/gift_add.php line 86 find this $gift_query = tep_db_query("SELECT fg.*, p.products_id, pd.products_name FROM " . TABLE_CARROT . " fg, products p LEFT JOIN products_description pd ON (pd.products_id=fg.products_id) WHERE pd.language_id = '".$languages_id."' AND p.products_id = fg.products_id ORDER BY fg.threshold ASC"); and replace with this $gift_query = tep_db_query("SELECT fg.*, p.products_id, pd.products_name FROM (" . TABLE_CARROT . " fg, products p) LEFT JOIN products_description pd ON (pd.products_id=fg.products_id) WHERE pd.language_id = '".$languages_id."' AND p.products_id = fg.products_id ORDER BY fg.threshold ASC"); Quote Link to comment Share on other sites More sharing options...
ras Posted April 17, 2006 Share Posted April 17, 2006 one more question. the current contribution (2.70) does not allow to buy a carrot product if the cliet find it in the search or just click on the carrot from the infobox. i dont give the carrot for free but with discounted price if the client reached the threshold, but the carrot is a product that the client may want to buy without reaching the threshold. i want him to be able to do this, just not with the carrot price but with the normal price how can this be done? Thanks Quote Link to comment Share on other sites More sharing options...
chris3g Posted April 20, 2006 Share Posted April 20, 2006 would it be possible to modify this contribution to set the threshold levels based on total cart weight rather than price? what i want to do is utilize the new auto-add code in v. 2.6, to automatically add a "box charge" item based on the weight of the items in the cart. For example, 5lbs, auto-adds item (1 Bottle Box $2.99) 10lbs, auto-adds item (2 bottle box $3.99) etc... is this doable? Quote Link to comment Share on other sites More sharing options...
Guest Posted April 27, 2006 Share Posted April 27, 2006 Hi, just installed the contribution, had a few bugs but got all that worked out. My problem now though is that the "free" gift doesn't show up free at all. Comes up with the price in it, so I went back and set the price to 0.00 in the catalog/product part of admin, STILL coming up with the price. I have no idea what to do, scanned the thread and looks like this problem has happened in the past but was later on fixed with updates to the other scripts. I have the latest version installed. I don't even know where to begin looking now, looked at all the coding and it seems correct. I do have a very heavy modified site too. I'm hoping it's not conflicting with another contribution because at this point, I wouldn't even know which one, it's been a long time since I've added anything! Thank you. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 27, 2006 Share Posted April 27, 2006 ::blushing:: I found the problem, in case anyone has ever installed the "specials by category contribution", have to change it in there too! Sorry, looked for this a long time, figures I'd snap as soon as I posted about it lol. Hi, just installed the contribution, had a few bugs but got all that worked out. My problem now though is that the "free" gift doesn't show up free at all. Comes up with the price in it, so I went back and set the price to 0.00 in the catalog/product part of admin, STILL coming up with the price. I have no idea what to do, scanned the thread and looks like this problem has happened in the past but was later on fixed with updates to the other scripts. I have the latest version installed. I don't even know where to begin looking now, looked at all the coding and it seems correct. I do have a very heavy modified site too. I'm hoping it's not conflicting with another contribution because at this point, I wouldn't even know which one, it's been a long time since I've added anything! Thank you. Quote Link to comment Share on other sites More sharing options...
simplyclesha Posted May 6, 2006 Share Posted May 6, 2006 (edited) Hi, I just did a fresh install of v. 2.6 and everything is working except 1 glitch. How do I get the item to go into the cart and not redirected to the product page? For now I'm using the script change that will add the product automatically to the cart, but in the future I want to offer more than one gift choice. Is there a work around for this? Has anyone figured this one out? I know it's in this string of code, but I can't figure it out. $freebie[$p]['message'] .= sprintf(TEXT_QUALIFIED_FOR_GIFT, $currencies->display_price($gift['threshold'],tep_get_tax_rate($gift['products_tax_class_id']))); $freebie[$p]['link'] = '<a href="http://www.mysite.com/product_info.php?action=buy_now&products_id=' . $gift['products_id'] . '">Add the FREE Item to My Cart</a>'; $freebie[$p]['name'] = $gift['products_name']; $freebie[$p]['id'] = $gift['products_id']; $freebie[$p]['image'] = $gift['products_image']; $p++; Edited May 6, 2006 by simplyclesha Quote Thanks! Clesha Link to comment Share on other sites More sharing options...
safoo Posted May 8, 2006 Share Posted May 8, 2006 (edited) Hi, I just did a fresh install of v. 2.6 and everything is working except 1 glitch. How do I get the item to go into the cart and not redirected to the product page? For now I'm using the script change that will add the product automatically to the cart, but in the future I want to offer more than one gift choice. Is there a work around for this? Has anyone figured this one out? I know it's in this string of code, but I can't figure it out. $freebie[$p]['message'] .= sprintf(TEXT_QUALIFIED_FOR_GIFT, $currencies->display_price($gift['threshold'],tep_get_tax_rate($gift['products_tax_class_id']))); $freebie[$p]['link'] = '<a href="http://www.mysite.com/product_info.php?action=buy_now&products_id=' . $gift['products_id'] . '">Add the FREE Item to My Cart</a>'; $freebie[$p]['name'] = $gift['products_name']; $freebie[$p]['id'] = $gift['products_id']; $freebie[$p]['image'] = $gift['products_image']; $p++; $freebie[$p]['link'] = '<a href="http://www.mysite.com/product_info.php?action=buy_now&products_id=' . $gift['products_id'] . '">Add the FREE Item to My Cart</a>'; should be: $freebie[$p]['link'] = '<a href="http://www.mysite.com/shopping_cart.php?action=buy_now&products_id=' . $gift['products_id'] . '">Add the FREE Item to My Cart</a>'; Edited May 8, 2006 by safoo Quote Link to comment Share on other sites More sharing options...
simplyclesha Posted May 8, 2006 Share Posted May 8, 2006 $freebie[$p]['link'] = '<a href="http://www.mysite.com/product_info.php?action=buy_now&products_id=' . $gift['products_id'] . '">Add the FREE Item to My Cart</a>'; should be: $freebie[$p]['link'] = '<a href="http://www.mysite.com/shopping_cart.php?action=buy_now&products_id=' . $gift['products_id'] . '">Add the FREE Item to My Cart</a>'; Thanks safoo. I made the changes and now the add to cart button is gone and replaced with a link and it's still going to the product info page. The button is not on the info page so there is not way for them to add the item to their cart. Quote Thanks! Clesha Link to comment Share on other sites More sharing options...
Trout69 Posted May 23, 2006 Share Posted May 23, 2006 Hi All, I've installed this, however, i am getting an error regarding a table missing in my database TABLE_CARROT I cannot post the exact code at the moment as i had to swiftly rollback the contribution being as it was my live site. I checked the sql file and this product is not created, can anyone shed any light? Best Regards Donna Quote Link to comment Share on other sites More sharing options...
Trout69 Posted May 23, 2006 Share Posted May 23, 2006 Hi All, I've installed this, however, i am getting an error regarding a table missing in my database TABLE_CARROT I cannot post the exact code at the moment as i had to swiftly rollback the contribution being as it was my live site. I checked the sql file and this product is not created, can anyone shed any light? Best Regards Donna I managed to sort it, i seemed to have gotten hold of an incomplete install document. Best Regards Donna Quote Link to comment Share on other sites More sharing options...
andytc Posted May 26, 2006 Share Posted May 26, 2006 I'd like to use this mod , but i want to offer exisiting products as free gifts once the threshold price is reached. Is it possible to use existing products as free gifts ? will I have to re-name and create a new catagorie for this ? any help appreciated before i begin install... thanks Quote Link to comment Share on other sites More sharing options...
andytc Posted May 27, 2006 Share Posted May 27, 2006 Ok , all installed and working.... Problem ? I have set 2 thresholds of spending , ?70 and ?100 , if the cart reaches the ?100 , 2 gifts show up ? , one for the ?70 carrot and also the ?100 gift as well ? How can i only allow 1 gift per cart ? cheers Quote Link to comment Share on other sites More sharing options...
johanna Posted May 31, 2006 Share Posted May 31, 2006 Hi, I have installed dangling_carrot v2.6 and now I get the following error each time I modify or add a product to my admin page: Warning: Cannot modify header information - headers already sent by (output started at /data01/anderson/public_html/catalog/admin/includes/languages/english/categories.php:222) in /data01/anderson/public_html/catalog/admin/includes/functions/general.php on line 18 Please can anybody help? I'm not too sure what to do to resolve it :( Many thanks! Johanna Quote Link to comment Share on other sites More sharing options...
simplyclesha Posted June 6, 2006 Share Posted June 6, 2006 I hope someone can help me with this old problem. I reinstalled this mod and it works except for the same problem I had before. When you click the gift add to cart button it takes you to the product page instead of adding the item directly to the cart. Is there a fix for this? I've tried playing with this string, but it's not working: $freebie[$p]['message'] .= sprintf(TEXT_QUALIFIED_FOR_GIFT, $currencies->display_price($gift['threshold'],tep_get_tax_rate($gift['products_tax_class_id']))); $freebie[$p]['link'] = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $gift['products_id']) . '">' . tep_image_button('button_add_now.gif', 'Select ' . $gift['products_id'] ) . '</a>'; $freebie[$p]['name'] = $gift['products_name']; $freebie[$p]['id'] = $gift['products_id']; $freebie[$p]['image'] = $gift['products_image']; $p++; Has anyone else had this problem and figured out a fix? Quote Thanks! Clesha Link to comment Share on other sites More sharing options...
Guest Posted June 27, 2006 Share Posted June 27, 2006 is this mod supposed to handle multiple gifts? i have several tiers set up. such as: -spend over $10 get a small widget for free -spend over $20 get a bigger widget for free and so on once the user has spent over $20, the $10 gift remains; so the user gets TWO gifts Quote 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.