tmcca Posted March 3, 2020 Author Share Posted March 3, 2020 After doing that see what happens. If it works than it is hook function issue with 1.0.5.2 Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted March 3, 2020 Share Posted March 3, 2020 Nope, still same issue Quote Link to comment Share on other sites More sharing options...
tmcca Posted March 3, 2020 Author Share Posted March 3, 2020 I will look into this further you getting any errors? Can you show me a screenshot as what's happening? Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted March 3, 2020 Share Posted March 3, 2020 I don't get any errors, it just adds it to the cart Quote Link to comment Share on other sites More sharing options...
tmcca Posted March 3, 2020 Author Share Posted March 3, 2020 I had that happening and had to do with that function I gave you. I will download 1.0.5.2 and see if I can figure it out LeeFoster 1 Quote Link to comment Share on other sites More sharing options...
tmcca Posted March 3, 2020 Author Share Posted March 3, 2020 (edited) Did you replace the files in the wishlist directory to your store? you can't do that since this is for version 1.0.5.0 those files have changed since example application_top.. I am curious if that's issue here Search for //BOF Wishlist and replace those in the files on 1.0.5.2 Edited March 3, 2020 by tmcca Quote Link to comment Share on other sites More sharing options...
tmcca Posted March 3, 2020 Author Share Posted March 3, 2020 (edited) I see one issue try changing this // BOF WISHLIST // wishlist data if (!tep_session_is_registered('wishList') || !is_object($wishList)) { tep_session_register('wishList'); $wishList = new wishlist; } //Wishlist actions (must be before shopping cart actions) if (isset($_POST['wishlist'])) { if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { $attributes = isset($_POST['id']) ? $_POST['id'] : ''; $wishList->add_wishlist($_POST['products_id'], $wishList->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+1, $attributes); } if (WISHLIST_REDIRECT == 'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id'])); tep_redirect(tep_href_link('wishlist.php')); } to this: // BOF WISHLIST // wishlist data if (!isset($_SESSION['wishList']) || !is_object($wishList)) { $_SESSION['wishList']; $wishList = new wishlist; } //Wishlist actions (must be before shopping cart actions) if (isset($_POST['wishlist'])) { if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { $attributes = isset($_POST['id']) ? $_POST['id'] : ''; $wishList->add_wishlist($_POST['products_id'], $wishList->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+1, $attributes); } if (WISHLIST_REDIRECT == 'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id'])); tep_redirect(tep_href_link('wishlist.php')); } tell me what happens. Some of this maybe not needed. it maybe enough to use only if (!isset($_SESSION['wishlist])) { I have to check that code. 1.0.5.2 uses $_SESSION variables most likely issue here. Edited March 3, 2020 by tmcca Quote Link to comment Share on other sites More sharing options...
tmcca Posted March 4, 2020 Author Share Posted March 4, 2020 Did you try that fix? Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted March 4, 2020 Share Posted March 4, 2020 1.0.5.2 does not change how the tep_session functions work. But if you want to write them out, the code would look like if (!isset($_SESSION['wishList']) || !($wishList instanceof wishlist)) { $_SESSION['wishList'] = new wishlist(); $wishList =& $_SESSION['wishlist']; } But I don't think that has anything to do with the issue. Note that the part that prevents the add to cart action is if (isset($_POST['wishlist'])) { If that condition is true, then it redirects the page. If it is not true, it keeps going until it reaches the add to cart action. So there's really only two things that can be going wrong. One, that condition is not being set. Two, the redirect is failing in some fashion without showing an error. The first is far more likely and suggests some kind of browser issue. For example, Lee may be using a different browser than you. Or have different browser settings. Or perhaps some other issue unrelated to the browser. For example, if Lee is using Internet Explorer, perhaps you are hitting https://stackoverflow.com/a/1903505 Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
LeeFoster Posted March 4, 2020 Share Posted March 4, 2020 8 hours ago, tmcca said: Did you try that fix? Will start from the beginning and try again later today. Might be worth adding instructions for adding the hooks to core as opposed to including overwritten files. Quote Link to comment Share on other sites More sharing options...
tmcca Posted March 4, 2020 Author Share Posted March 4, 2020 The files are included that are overwritten but for 1.0.5.0 I will write instructions though instead of actually giving the files I guess. Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted March 5, 2020 Share Posted March 5, 2020 19 hours ago, tmcca said: The files are included that are overwritten but for 1.0.5.0 I will write instructions though instead of actually giving the files I guess. Doing it this way would mean you are not restricted to a specific version. Quote Link to comment Share on other sites More sharing options...
discxpress Posted March 17, 2020 Share Posted March 17, 2020 (edited) @tmcca @LeeFoster the wishlist button on product_info adds the item to cart. Has this issue been solved? I'm using latest version of Phoenix and php 7.3 I'm curious. Is the code for Wishlist button correct? Edited March 17, 2020 by discxpress Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted March 17, 2020 Share Posted March 17, 2020 3 hours ago, discxpress said: @tmcca @LeeFoster the wishlist button on product_info adds the item to cart. Has this issue been solved? I'm using latest version of Phoenix and php 7.3 I'm curious. Is the code for Wishlist button correct? Not as far as I'm aware discxpress 1 Quote Link to comment Share on other sites More sharing options...
discxpress Posted March 17, 2020 Share Posted March 17, 2020 (edited) @LeeFoster looking through error logs, it's something about $wishList->count_contents() that Phoenix doesn't like. Here's what my error logs report [17-Mar-2020 08:26:56 UTC] PHP Warning: Use of undefined constant HEADER_ACCOUNT_WISHLIST - assumed 'HEADER_ACCOUNT_WISHLIST' (this will throw an Error in a future version of PHP) in /home/q4p7grzvy49t/public_html/includes/languages/english/modules/navbar/nb_wishlist.php on line 16 [17-Mar-2020 08:26:56 UTC] PHP Fatal error: Uncaught Error: Call to a member function count_contents() on null in /home/q4p7grzvy49t/public_html/includes/modules/navbar/templates/tpl_nb_wishlist.php:3 Stack trace: #0 /home/q4p7grzvy49t/public_html/includes/modules/block_template.php(14): include() #1 /home/q4p7grzvy49t/public_html/includes/modules/navbar/nb_wishlist.php(51): include('/home/q4p7grzvy...') #2 /home/q4p7grzvy49t/public_html/includes/modules/content/navigation/cm_navbar.php(60): nb_wishlist->getOutput() #3 /home/q4p7grzvy49t/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute() #4 /home/q4p7grzvy49t/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation') #5 /home/q4p7grzvy49t/public_html/product_info.php(24): require('/home/q4p7grzvy...') #6 {main} thrown in /home/q4p7grzvy49t/public_html/includes/modules/navbar/templates/tpl_nb_wishlist.php on line 3 Edited March 17, 2020 by discxpress Quote Link to comment Share on other sites More sharing options...
kgtee Posted March 18, 2020 Share Posted March 18, 2020 I have been using the wishlist addon on my heavily modified 1.0.1.3 without any issue. Today I tried to migrate it to 1.0.5.2 and there seems to be no problem. Anyone interested may try this version. Wishlist.zip Quote Link to comment Share on other sites More sharing options...
discxpress Posted March 18, 2020 Share Posted March 18, 2020 (edited) 5 hours ago, kgtee said: I have been using the wishlist addon on my heavily modified 1.0.1.3 without any issue. Today I tried to migrate it to 1.0.5.2 and there seems to be no problem. Anyone interested may try this version. Wishlist.zip I just installed your version. here's the errors: Stack trace: #0 /home/xxxxxxxxxx/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute() #1 /home/xxxxxxxxxx/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation') #2 /home/xxxxxxxxxx/public_html/index.php(35): require('/home/q4p7grzvy...') #3 {main} thrown in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php on line 58 [18-Mar-2020 06:02:02 UTC] PHP Fatal error: Uncaught Error: Class 'nb_wishlist' not found in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php:58 Stack trace: #0 /home/xxxxxxxxxx/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute() #1 /home/xxxxxxxxxx/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation') #2 /home/xxxxxxxxxx/public_html/index.php(35): require('/home/q4p7grzvy...') #3 {main} thrown in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php on line 58 Also note that when you click save to favorites, an item is added to shopping cart. Thanks Edited March 18, 2020 by discxpress Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted March 18, 2020 Share Posted March 18, 2020 49 minutes ago, discxpress said: Also note that when you click save to favorites, an item is added to shopping cart. Thanks I'm pretty sure that this only happens in some browsers. You may want to find out where @kgtee has this installed and check the behavior there. Or post what browser you're using so people trying to debug can use the same one. Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
discxpress Posted March 18, 2020 Share Posted March 18, 2020 1 minute ago, ecartz said: I'm pretty sure that this only happens in some browsers. You may want to find out where @kgtee has this installed and check the behavior there. Or post what browser you're using so people trying to debug can use the same one. I use latest version of Chrome. Quote Link to comment Share on other sites More sharing options...
discxpress Posted March 18, 2020 Share Posted March 18, 2020 28 minutes ago, ecartz said: I'm pretty sure that this only happens in some browsers. You may want to find out where @kgtee has this installed and check the behavior there. Or post what browser you're using so people trying to debug can use the same one. Same behavior in Firefox @ecartz Quote Link to comment Share on other sites More sharing options...
discxpress Posted March 18, 2020 Share Posted March 18, 2020 From my understanding, all the work is done from this block of code // BOF WISHLIST // wishlist data if (!tep_session_is_registered('wishList') || !is_object($wishList)) { tep_session_register('wishList'); $wishList = new wishlist; } //Wishlist actions (must be before shopping cart actions) if (isset($_POST['wishlist'])) { if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { $attributes = isset($_POST['id']) ? $_POST['id'] : ''; // php 5 // $qty = isset($_POST['qty']) ? (int)$_POST['qty'] : 1; // php 7 $qty = (int)($_POST['qty'] ?? 1); $wishList->add_wishlist($_POST['products_id'], $wishList->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+$qty, $attributes); } if (WISHLIST_REDIRECT == 'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id'])); tep_redirect(tep_href_link('wishlist.php')); } // EOF WISHLIST @kgtee @ecartz my php version is 7.3 Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted March 18, 2020 Share Posted March 18, 2020 6 hours ago, ecartz said: I'm pretty sure that this only happens in some browsers. You may want to find out where @kgtee has this installed and check the behavior there. Or post what browser you're using so people trying to debug can use the same one. I have this installed on Chrome and it's still adding it to the shopping cart. Quote Link to comment Share on other sites More sharing options...
kgtee Posted March 18, 2020 Share Posted March 18, 2020 8 hours ago, discxpress said: I just installed your version. here's the errors: Stack trace: #0 /home/xxxxxxxxxx/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute() #1 /home/xxxxxxxxxx/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation') #2 /home/xxxxxxxxxx/public_html/index.php(35): require('/home/q4p7grzvy...') #3 {main} thrown in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php on line 58 [18-Mar-2020 06:02:02 UTC] PHP Fatal error: Uncaught Error: Class 'nb_wishlist' not found in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php:58 Stack trace: #0 /home/xxxxxxxxxx/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute() #1 /home/xxxxxxxxxx/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation') #2 /home/xxxxxxxxxx/public_html/index.php(35): require('/home/q4p7grzvy...') #3 {main} thrown in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php on line 58 Also note that when you click save to favorites, an item is added to shopping cart. Thanks The correct class is nb_wish_list, and not nb_wishlist in my version. You may want to check and ensure consistency of the class name. discxpress 1 Quote Link to comment Share on other sites More sharing options...
kgtee Posted March 18, 2020 Share Posted March 18, 2020 4 hours ago, discxpress said: From my understanding, all the work is done from this block of code // BOF WISHLIST // wishlist data if (!tep_session_is_registered('wishList') || !is_object($wishList)) { tep_session_register('wishList'); $wishList = new wishlist; } //Wishlist actions (must be before shopping cart actions) if (isset($_POST['wishlist'])) { if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { $attributes = isset($_POST['id']) ? $_POST['id'] : ''; // php 5 // $qty = isset($_POST['qty']) ? (int)$_POST['qty'] : 1; // php 7 $qty = (int)($_POST['qty'] ?? 1); $wishList->add_wishlist($_POST['products_id'], $wishList->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+$qty, $attributes); } if (WISHLIST_REDIRECT == 'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id'])); tep_redirect(tep_href_link('wishlist.php')); } // EOF WISHLIST @kgtee @ecartz my php version is 7.3 The function of adding items to wishlist cart is done by the functions in includes/classes/wishlist.php. Just make sure you have this class file in the classes folder or any of the system/versioned folder so that it may be loaded by autoloader.php. Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted March 18, 2020 Share Posted March 18, 2020 (edited) @kgtee Where/when is the function add_wishlist called? Edited March 18, 2020 by LeeFoster 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.