Jump to content
Sign in to follow this  
tmcca

Wishlist For Phoenix

Recommended Posts

Posted (edited)

Just added hook in catalog side. I will probably do hook side in admin soon as well.

Edited by tmcca

Share this post


Link to post
Share on other sites
10 hours ago, tmcca said:

Just added hook in catalog side. I will probably do hook side in admin soon as well.

What does this hook do?

Share this post


Link to post
Share on other sites

It's not working the hook as of yet. It will be easier to update in future with hook. Instead of changing the core with a bunch of code you only use one line. Make sense?

Share this post


Link to post
Share on other sites
1 hour ago, tmcca said:

It's not working the hook as of yet. It will be easier to update in future with hook. Instead of changing the core with a bunch of code you only use one line. Make sense?

Yeah, just looking at the change to core, I'm guessing that would be the hook?

Share this post


Link to post
Share on other sites
Posted (edited)

So the core code change just adds the button to the product in the listing page? I'd be inclined to leave that out.

Get this error after installing the box -

Fatal error: Uncaught Error: Call to a member function count_contents()

Clicking add to wish list adds the item to the shopping cart.

Also the zip package is missing the account and navbar modules.

So as it stands I can't add anything to the wish list and can't view it.

Edited by LeeFoster

Share this post


Link to post
Share on other sites

That error should be fixed now.. I will add account and navbar modules soon. Hopefully later tonight. Let me know how this works now. Thanks

Share this post


Link to post
Share on other sites

Done some more testing found the following - 

Account Wish list has no language file.

wishlist.php gives the error 

Fatal error: Uncaught Error: Call to a member function get_products() on null in C:\xampp\htdocs\360v3\wishlist.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\360v3\wishlist.php on line 16

Adding to wishlist still adds to cart

Installing Wishlist box now gives the error 

Fatal error: Uncaught Error: Call to a member function count_contents() on null in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php:34 Stack trace: #0 C:\xampp\htdocs\360v3\includes\system\versioned\1.0.4.0\osc_template.php(102): bm_wishlist->execute() #1 C:\xampp\htdocs\360v3\includes\template_top.php(13): oscTemplate->buildBlocks() #2 C:\xampp\htdocs\360v3\account.php(24): require('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php on line 34

Share this post


Link to post
Share on other sites
45 minutes ago, tmcca said:

try it now

These errors still occur - 

wishlist.php gives the error 

Fatal error: Uncaught Error: Call to a member function get_products() on null in C:\xampp\htdocs\360v3\wishlist.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\360v3\wishlist.php on line 16

Adding to wishlist still adds to cart

Installing Wishlist box now gives the error 

Fatal error: Uncaught Error: Call to a member function count_contents() on null in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php:34 Stack trace: #0 C:\xampp\htdocs\360v3\includes\system\versioned\1.0.4.0\osc_template.php(102): bm_wishlist->execute() #1 C:\xampp\htdocs\360v3\includes\template_top.php(13): oscTemplate->buildBlocks() #2 C:\xampp\htdocs\360v3\account.php(24): require('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php on line 34

Share this post


Link to post
Share on other sites
14 minutes ago, LeeFoster said:

wishlist.php gives the error 

Fatal error: Uncaught Error: Call to a member function get_products() on null in C:\xampp\htdocs\360v3\wishlist.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\360v3\wishlist.php on line 16

This error is down to me not adding the hook to application_top.php

 

14 minutes ago, LeeFoster said:

Adding to wishlist still adds to cart

Installing Wishlist box now gives the error 

Fatal error: Uncaught Error: Call to a member function count_contents() on null in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php:34 Stack trace: #0 C:\xampp\htdocs\360v3\includes\system\versioned\1.0.4.0\osc_template.php(102): bm_wishlist->execute() #1 C:\xampp\htdocs\360v3\includes\template_top.php(13): oscTemplate->buildBlocks() #2 C:\xampp\htdocs\360v3\account.php(24): require('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php on line 34

These 2 still persist.

Share this post


Link to post
Share on other sites

Changing hook in application top from 

// BOF WISHLIST
$OSCOM_Hooks->register('wishlist');
echo $OSCOM_Hooks->call('wishlist', 'WishListMod');
// EOF WISHLIST

to 

// BOF WISHLIST
$OSCOM_Hooks->register('wishlist');
$OSCOM_Hooks->call('wishlist', 'WishListMod');
// EOF WISHLIST

Has resolved 

29 minutes ago, LeeFoster said:

Fatal error: Uncaught Error: Call to a member function count_contents() on null in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php:34 Stack trace: #0 C:\xampp\htdocs\360v3\includes\system\versioned\1.0.4.0\osc_template.php(102): bm_wishlist->execute() #1 C:\xampp\htdocs\360v3\includes\template_top.php(13): oscTemplate->buildBlocks() #2 C:\xampp\htdocs\360v3\account.php(24): require('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\360v3\includes\modules\boxes\bm_wishlist.php on line 34

Still can't add to wishlist though.

Share this post


Link to post
Share on other sites
22 minutes ago, tmcca said:

Weird on my end it works. I will look more into it when I get time.

What version of Phoenix are you using?

Share this post


Link to post
Share on other sites

I think the hooks run differently in 1.0.5.2

try it without hooks and see what happens please

Share this post


Link to post
Share on other sites
2 minutes ago, tmcca said:

Yes 1.0.5.2 will have issues I think.

Where would you look for the issues? What function does adding to wish list use that is missing?

Share this post


Link to post
Share on other sites
Posted (edited)

in application_top remove the hook or comment it out and replace it with 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'));		
   }

 

Edited by tmcca

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
Sign in to follow this  

×