Jump to content

Local Wishlist without Login


Recommended Posts

Hello

 

My goal is it to make a local wishlist for not logged in Customers, since I'm running a B2B shop and we want only registerd users to log in, those already know what they want from us.

 

The wishlist is just a feature for the customers of our customers, to put together what the want and than they send there wishlist to there local shop so they buy from us.

I know I have to do this with javascript, but not knowing that language well(yet) I could use some help.

 

heres the shop:

https://cooolstore.com/

 

Link to comment
Share on other sites

I am sorry, so what do you expect as an answer?

What you want to achieve is really cool feature, however it is not possible to do in an hour or two.

Hire a freelancer or go to code academy and start learning javascript. If you want to do it right javascript might not be enough, you might also need HTML, CSS and PHP. 

Link to comment
Share on other sites

At the moment i try making

<script>
function add_to_my_wishlist(url,title,reference)
{
	
	var product_list = localStorage.getItem('product_list');
	 var obj = [];
     if(product_list){
         obj = JSON.parse(product_list);  
     }
	obj.push(
		{ 'image' : url, 'title' : title ,'reference' : reference}
	);
	
	localStorage.setItem('product_list',JSON.stringify(obj));
	console.log(product_list);
	location.reload();
	
}
</script>

 work, i use it in the normal product_list.tpl tho ...

I access the script with the button I have

{if ($PS_CATALOG_MODE)}
<a class="lnk_view btn btn-default" onclick='add_to_my_wishlist("{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}","{$product.name|escape:'html':'UTF-8'}","{$product.reference}");'><span ></span> {l s='add to wishlist'}</a>{/if}</a>

So i only shows  when logged out, since at the moment visitors are in catalogue mode.

 

After pressing the button nothing happens tho

Link to comment
Share on other sites

if  you want to understand scope of this, there is magento feature  like this.....you could basically look at the 'hoops' they had to jump through.  What seems simple under the hood is very complex.  I've had a couple of my dev's kick tires on it and they never got anywhere....I  wanted it to work like google shopping...I suppose I should come out of coding retirement and see if the old man can solve.  But at least two months before I could start so don't wait for me. lol

Link to comment
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
×
×
  • Create New...