s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Open to all! Ask other shopowners for help.
Post Reply
Denzel
Member
Posts: 87
Joined: Sat Oct 31, 2020 7:22 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 15 times

s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by Denzel »

Addon:
Adds a customer Favourites List, that could also be used as a Wishlist.

Download:
viewtopic.php?f=28&t=240


--




Looks as "Add to favourites"-button does not work with the Ajax-Buy_button together. If installed the Add-to_favs-Link adds product to cart instead of wishlist. Successfully added to cartmodal pops up an product wents to cart...

EDIT:
works, if in includes/modules/header_tags/ht_ajax_buttons.php line 89 changes selector from

Code: Select all

<script>$(document).ready(function() { $('form[name="cart_quantity"]').bind('submit',function(e) { . . .
to:

Code: Select all

<script>$(document).ready(function() { $('button.btn-buy').bind('click',function(e) { . . . 
Last edited by Denzel on Sun Jan 10, 2021 7:42 pm, edited 1 time in total.

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e01 - Wishlist / Faves

Post by burt »

1.0.7.11

Bear in mind that your 107.11 might have customised changes (ie core code changes), but for a brand new installation of 107.11 you need TWO minor changes;

In login.php, find (about L36):

Code: Select all

$_SESSION['customer_id'] = $login_customer_id;
Add After:

Code: Select all

$OSCOM_Hooks->call('login', 'postLogin');
In logoff.php, find (about L25):

Code: Select all

$_SESSION['cart']->reset();
Add After:

Code: Select all

$OSCOM_Hooks->call('logoff', 'resetStart');
Save both files and overwrite. Upload all, following instructions.

It -seemed- to work for me in a brand new installation of 107.11 as I intended it to work. Report back?
You might like to try on your test site before doing the same on live site!!!
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e01 - Wishlist / Faves

Post by burt »

For anyone else reading, the more "older" versions you go, the more you move away from 107.12 (which is what the wishlist was written on), so the changes may not be as easy as you see above!!!
I am not here to build for you.
I am here to build with you. Let's help each other.
Omar_one
Senior Contributor
Posts: 676
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: s07e01 - Wishlist / Faves

Post by Omar_one »

I just edit admin page from another add-on to this add-on.
but it will just show for who's registered as customer
wishlist.JPG
You do not have the required permissions to view the files attached to this post.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: s07e01 - Wishlist / Faves

Post by ecartz »

burt wrote: Sun Jan 10, 2021 7:20 pm
In login.php, find (about L36):

Code: Select all

$_SESSION['customer_id'] = $login_customer_id;
Add After:

Code: Select all

$OSCOM_Hooks->call('login', 'postLogin');
Surely you'd want to move it, not add it. Since it's already there (around line 31). Otherwise you're doing all the postLogin steps twice.
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: s07e01 - Wishlist / Faves

Post by 14Steve14 »

burt wrote: Sun Jan 10, 2021 7:20 pm 1.0.7.11

Bear in mind that your 107.11 might have customised changes (ie core code changes), but for a brand new installation of 107.11 you need TWO minor changes;

In login.php, find (about L36):

Code: Select all

$_SESSION['customer_id'] = $login_customer_id;
Add After:

Code: Select all

$OSCOM_Hooks->call('login', 'postLogin');
In logoff.php, find (about L25):

Code: Select all

$_SESSION['cart']->reset();
Add After:

Code: Select all

$OSCOM_Hooks->call('logoff', 'resetStart');
Save both files and overwrite. Upload all, following instructions.

It -seemed- to work for me in a brand new installation of 107.11 as I intended it to work. Report back?
You might like to try on your test site before doing the same on live site!!!
Cheers Gary. Will take a look later and try. Its only a temporary fix until the other addons/modules are ready.

I am a bit worried about ecartz answer further down the thread though, even if I dont understand it.
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e01 - Wishlist / Faves

Post by burt »

In this case, do as I posted.
We're not worried about having a double step and it means that anything relying on the earlier call will still use it and the one thing that relies on this call will use it.

Again, to be sure; do as I posted and it should work well.
When you eventually update to 107.12 or later, everything will still work as you have changed nothing in the addon.
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e01 - Wishlist / Faves

Post by burt »

Denzel wrote: Sun Jan 10, 2021 7:13 pm Looks as "Add to favourites"-button does not work with the Ajax-Buy_button together. If installed the Add-to_favs-Link adds product to cart instead of wishlist. Successfully added to cartmodal pops up an product wents to cart...

EDIT:
works, if in includes/modules/header_tags/ht_ajax_buttons.php line 89 changes selector from

Code: Select all

<script>$(document).ready(function() { $('form[name="cart_quantity"]').bind('submit',function(e) { . . .
to:

Code: Select all

<script>$(document).ready(function() { $('button.btn-buy').bind('click',function(e) { . . . 
TY, however this solution doesn't seem good... Reason: the ajax cart functionality needs to be on the submit of the form not on the click of the button. The system breaks if you put it on the click of the button, superficially it looks like it works, but I know it won't be working properly.

The wishlist functionality also needs to be on submit of the form; therefore until I get time to have a look/play I would say to use either the ajax buttons OR the wishlist, not both.
I am not here to build for you.
I am here to build with you. Let's help each other.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: s07e01 - Wishlist / Faves

Post by lecarlb »

Has anyone gotten this to work on version 1.0.7.18?

It seems as if the Navbar and PI modules are causing blank pages.

Here's the code from the template file on line 3 causing trouble:

Code: Select all

$heart_text = $_SESSION['wishlist']->display_text((int)$product_info['products_id']);
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e01 - Wishlist / Faves

Post by burt »

This was built at v1.0.7.12, therefore it would need updating if a later version breaks it.
I am in the process of updating all the Supporters Codes, but when that would be complete is unknown as there are so many.

I have howevr just installed this on v1.0.8.0 for a quick test, and everything appears to work fine...
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply