Jack_mcs Posted May 30, 2005 Share Posted May 30, 2005 Same problem here. <{POST_SNAPBACK}> To try to isolate this problem, find this section of code in admin/gifts.php (starts at line 47)$freeGifts = array(); $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."' AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC"); while ($gift_list = tep_db_fetch_array($gift_list_query)) $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']); and replace it with this code $freeGifts = array(); $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."' AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC"); echo 'There are '. tep_db_num_rows($gift_list_query) . ' gift products<br><br>'; while ($gift_list = tep_db_fetch_array($gift_list_query)) { echo 'Adding ' . $gift_list['products_name'].'<br>'; $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']); } Save the file and go to admin->catalog->gifts. What do you see displayed at the top of the page? Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Guest Posted May 30, 2005 Share Posted May 30, 2005 How is the best way to insert gifts, because the only possibity now is to plase "gift" in front off the product name and that's not so nice. And I can't put it out off stock, when I do that I don't see the gift anymore, anyone with an idea? Quote Link to comment Share on other sites More sharing options...
knokenet Posted May 30, 2005 Share Posted May 30, 2005 To try to isolate this problem, find this section of code in admin/gifts.php (starts at line 47)$freeGifts = array(); ?$gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."' ? AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC"); ?while ($gift_list = tep_db_fetch_array($gift_list_query)) ? $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']); and replace it with this code ?$freeGifts = array(); ?$gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."' ? AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC"); ?echo 'There are '. tep_db_num_rows($gift_list_query) . ' gift products<br><br>'; ?while ($gift_list = tep_db_fetch_array($gift_list_query)) ?{ ?echo 'Adding ' . $gift_list['products_name'].'<br>'; ? $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']); ? } Save the file and go to admin->catalog->gifts. What do you see displayed at the top of the page? Jack <{POST_SNAPBACK}> Thank you for the updates! Still, cannot update, delete, edit... Quote Link to comment Share on other sites More sharing options...
knokenet Posted May 30, 2005 Share Posted May 30, 2005 To try to isolate this problem, find this section of code in admin/gifts.php (starts at line 47)$freeGifts = array(); ?$gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."' ? AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC"); ?while ($gift_list = tep_db_fetch_array($gift_list_query)) ? $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']); and replace it with this code ?$freeGifts = array(); ?$gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."' ? AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC"); ?echo 'There are '. tep_db_num_rows($gift_list_query) . ' gift products<br><br>'; ?while ($gift_list = tep_db_fetch_array($gift_list_query)) ?{ ?echo 'Adding ' . $gift_list['products_name'].'<br>'; ? $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']); ? } Save the file and go to admin->catalog->gifts. What do you see displayed at the top of the page? Jack <{POST_SNAPBACK}> Thanks for the v1.8 updates. Still cannot edit, delete or update products... Quote Link to comment Share on other sites More sharing options...
irishmystic Posted May 30, 2005 Share Posted May 30, 2005 Save the file and go to admin->catalog->gifts. What do you see displayed at the top of the page? Jack <{POST_SNAPBACK}> Hi Jack and everyone, I have also had this problem (can't update, edit, or delete gifts from the admin) since I first added the contribution version 1.7. When I changed the code in gift_add.php in the admin section, here is what shows (whether I hit the update, edit, or delete button): There are 2 gift products Adding Gift - FREE Rose Quartz Adding Gift -1 oz. Jasmine However, there is only one gift showing on the list, the other is only a possible addition (if that makes a difference). Thanks for any help! Peace, Erin Quote Link to comment Share on other sites More sharing options...
irishmystic Posted May 30, 2005 Share Posted May 30, 2005 Hi Jack and everyone,I have also had this problem (can't update, edit, or delete gifts from the admin) since I first added the contribution version 1.7. <{POST_SNAPBACK}> One More Thing.... I just tried something new. In admin/gift_add.php I replaced this line <td class="smallText">'.tep_image_submit('button_update.gif', IMAGE_SEARCH).' <a href="gift_add.php?ID='.$gift['products_id'].'&action=delete">'.tep_image_submit('button_delete.gif', 'Delete').'</a> <a href="categories.php?pID='.$gift['products_id'].'&action=new_product">'.tep_image_submit('button_edit.gif', 'Edit').'</a> </td> with this line from previous version 1.3 <td class="smallText"><input type="submit" name="submit" value="update"> [ <a href="gift_add.php?ID='.$gift['products_id'].'&action=delete">DELETE</a> ] [ <a href="categories.php?pID='.$gift['products_id'].'&action=new_product">EDIT ITEM</a> ]</td> Now, the item can be deleted from the admin AND I can hit "edit" and it takes me to the product description page. "Update" does not seem to do anything that I can tell, outside of refreshing the page. So it appears that the problem is in the one line of code, somewhere. I am just not very good at this yet... :-" At least mine seems to work for now, not as pretty, but functional. Hope this helps! Peace, Erin :D Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 30, 2005 Share Posted May 30, 2005 I just uploaded a new version. It eliminates the need to name the product starting with Gift by placing a check box in the admin->catalog products page. To upgrade, run the following sql statement ALTER TABLE `products` ADD `products_carrot` tinyint(1) default '0' AFTER `products_status`; Then install the changes for the admin/categories.php and admin/includes/languages/english/categories.php files. Also replace the admin/gift_add.php and the includes/boxes/gifts.php files. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
knokenet Posted May 30, 2005 Share Posted May 30, 2005 I just uploaded a new version. It eliminates the need to name the product starting with Gift by placing a check box in the admin->catalog products page. To upgrade, run the following sql statement ALTER TABLE `products` ADD `products_carrot` tinyint(1) default '0' AFTER `products_status`; Then install the changes for the admin/categories.php and admin/includes/languages/english/categories.php files. Also replace the admin/gift_add.php and the includes/boxes/gifts.php files. Jack <{POST_SNAPBACK}> Excellent update! But... still cannot edit, delete and update carrots... Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 30, 2005 Share Posted May 30, 2005 Hmm. I'm not sure what to say to that then. The code is standard code so it should work. When you place the mouse over the edit button on the admin/gift_add.php page, the url to the product page should be displayed at the bottom of the browser. Do you see that? What does it say if you do? Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
knokenet Posted May 30, 2005 Share Posted May 30, 2005 Hmm. I'm not sure what to say to that then. The code is standard code so it should work. When you place the mouse over the edit button on the admin/gift_add.php page, the url to the product page should be displayed at the bottom of the browser. Do you see that? What does it say if you do? Jack <{POST_SNAPBACK}> Edit: Delete: Update: Quote Link to comment Share on other sites More sharing options...
Guest Posted May 30, 2005 Share Posted May 30, 2005 Same problem here, but also when I take the product out of stock I can't see the gift anymore. Quote Link to comment Share on other sites More sharing options...
knokenet Posted May 30, 2005 Share Posted May 30, 2005 Hmm. I'm not sure what to say to that then. The code is standard code so it should work. When you place the mouse over the edit button on the admin/gift_add.php page, the url to the product page should be displayed at the bottom of the browser. Do you see that? What does it say if you do? Jack <{POST_SNAPBACK}> When clicking 'update' link goes to: admin/gift_add.php?threshold=30&x=26&y=7 When clicking 'delete' link goes to: admin/gift_add.php?threshold=30&x=30&y=6 when clicking 'edit' link goes to: admin/gift_add.php?threshold=30&x=36&y=9 What do the x's and y's reffer to? Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 31, 2005 Share Posted May 31, 2005 Same problem here, but also when I take the product out of stock I can't see the gift anymore. <{POST_SNAPBACK}> This is the way it works. If the item is out of stock, you shouldn't offer it as something to add to the cart since it won't be available. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 31, 2005 Share Posted May 31, 2005 When clicking 'update' link goes to: admin/gift_add.php?threshold=30&x=26&y=7 When clicking 'delete' link goes to: admin/gift_add.php?threshold=30&x=30&y=6 when clicking 'edit' link goes to: admin/gift_add.php?threshold=30&x=36&y=9 What do the x's and y's reffer to? <{POST_SNAPBACK}> I'm confused. The images you posted show a different link than the one you list here. In the image, the link to the product appears correct when you hover over the edit button. Are you saying that if you click on the edit button, the displayed link is not the one that it goes to? The above x and y appear to be variables posted by the code. I can't imagine why they are shoing up in the link. If you type in the link that appears when you hover over the edit button into the browsers url string, does the link work then? Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 (edited) Edited cos I worked it out. :blush: Edited May 31, 2005 by Reesy Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 Sorry for the above, can anyone help out with this step of the install.... catalog/shopping_cart.php FIND (around line 228): $info_box_products_name = '<table border="0" cellspacing="2" cellpadding 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); This doesnt actually exist in catalog/shopping_cart.php at all Ive tried searching for "$info_box_products_name" and thats not in the file anywhere at all. I redownloaded a fresh MS2.2 and its not in the shopping_cart.php file there either. The rest of the install is fine, its just this code above. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 Aha... getting somewhere... maybe. I just searched for 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); Which is the last line of the code above, and its only on one line in shopping_cart.php and reads... $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); Is this what gets replaced in the step above please? Thank you. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 31, 2005 Share Posted May 31, 2005 The problem you found is a mistake. If fact, it highlighted another problem I missed. I have uploaded a new version. The last one was still using "Gift" to check for the gift items. I replaced that code so it now checks for the value from the database. In order to do that, the shopping_cart class had to be edited. All of the changes are in the readme. I apologize for any inconvenience this has caused anyone. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 The problem you found is a mistake. If fact, it highlighted another problem I missed. I have uploaded a new version. The last one was still using "Gift" to check for the gift items. I replaced that code so it now checks for the value from the database. In order to do that, the shopping_cart class had to be edited. All of the changes are in the readme. I apologize for any inconvenience this has caused anyone. Jack <{POST_SNAPBACK}> No need to apologise Jack, infact quite the opposite is true!! Thank you very much for checking this thread, ill give the new upload a shot and see how I get on. :thumbsup: B) Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 Thanks Jack and others for all the work put into this contrib! Just a quick note on those with the multiple pricing contribution installed since I've seen a few questions about it. In step 6 (from instructions for v2.0 of Dangling Carrot) when it comes to the query modification, you'll have to modify your catalog/includes/classes/PriceFormatter.php file instead. Find the loadProduct function: function loadProduct($product_id, $language_id=1) { $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," . " p.manufacturers_id, p.products_price, p.products_weight, p.products_carrot," . Note the p.products_carrot addition to that line above... That's about it. Everything else seems to work at this point as far as the 2.0 update. Again, thanks to Jack and other Carrot contributors :) Awesome job. --Wlad Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 I tried the new version Jack and got... Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /pathtomysite/includes/classes/shopping_cart.php on line 297 Lines 295-299 read... $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_carrot, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'); if ($products = tep_db_fetch_array($products_query)) { $prid = $products['products_id']; $products_price = $products['products_price']; $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'"); Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 hmmmmmmmm not sure what I did wrong there but I tried the install instructions again on shopping_cart.php and it worked fine. Seems I have the same problem of not being able to Edit or Delete, am going to try the suggested fix above to see if that works. Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 I'm confused. The images you posted show a different link than the one you list here. In the image, the link to the product appears correct when you hover over the edit button. Are you saying that if you click on the edit button, the displayed link is not the one that it goes to? The above x and y appear to be variables posted by the code. I can't imagine why they are shoing up in the link. If you type in the link that appears when you hover over the edit button into the browsers url string, does the link work then? Jack <{POST_SNAPBACK}> FYI Jack, the answer to your last question here is yes it does. ;) Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 Not wanting to spam the board with my BS, but I just wanted to report in: Some of the contribs installed: Gv/Coupons Multiple Pricing + discount/customer an inhouse contrib for rewards based on total sales for set period Paypal shopping cart Hide/Show categories and some others that can not affect Dangling carrot or other checkout/payment functions. Using 2.0 of Dangling carrot went without any problems and all aspects have been tested with 23 orders over the last hour after installation. Not sure if I missed something but I have to set the gift product to in stock, but because I have that show/hide contrib installed it works out fine that way (it does not show up for customers even if they search for it) So no code or parse errors with 2.0; Job well done Jack!! Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2005 Share Posted May 31, 2005 Not wanting to spam the board with my BS, but I just wanted to report in: Some of the contribs installed: Gv/Coupons Multiple Pricing + discount/customer an inhouse contrib for rewards based on total sales for set period Paypal shopping cart Hide/Show categories and some others that can not affect Dangling carrot or other checkout/payment functions. Using 2.0 of Dangling carrot went without any problems and all aspects have been tested with 23 orders over the last hour after installation. Not sure if I missed something but I have to set the gift product to in stock, but because I have that show/hide contrib installed it works out fine that way (it does not show up for customers even if they search for it) So no code or parse errors with 2.0; Job well done Jack!! <{POST_SNAPBACK}> Oops, spoke to soon: The update button in admin is missing the actual update function/case in the code. The delete or edit links/functions work fine. I'll post the case "update" code here in a few... 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.