wishlist not working

Solved
Highlighted
Excursionist
15 11 0

HI, I'm shopify theme devloper . building a shop themes .After some time I try to add product in wishlist ,  but when I open wishlist there is empty.!?

in the wishlist.js   ajax not success

and didn't get customer.tags size
From which place I need to start check this problem?

Thanks in advance.

0 Likes
Shopify Expert
665 162 195

Hi, @fenil_patel ,

This is Evita from On The Map.

 

Did you catch Ajax request error in console log?

 

Best,
Evita

On The Map Marketing | Developing custom Shopify Sites & Apps is our thing

- Install our latest app Accessibly - Makes your store accessible for everyone, helps to avoid fines
- Inc 5000 | Shopify Parners | 20+ stores launched | 300+ active clients
- Need help with your Shopify store? Reach out to us!
1 Like

Success.

Excursionist
15 11 0

data didn't get on wishlist page

0 Likes
Shopify Expert
665 162 195

Yes, but why didn't it get there? Can you show me the code of ajax request?

On The Map Marketing | Developing custom Shopify Sites & Apps is our thing

- Install our latest app Accessibly - Makes your store accessible for everyone, helps to avoid fines
- Inc 5000 | Shopify Parners | 20+ stores launched | 300+ active clients
- Need help with your Shopify store? Reach out to us!
1 Like

Success.

Excursionist
15 11 0

function initWishlist() {
$('.add-to-wishlist').click(function(e) {
e.preventDefault();
var form = $(this).parent();
var productItem = $(this).parents('.product-container');
console.log( productItem );
$.ajax({
type: 'POST',
url: '/contact',
data: form.serialize(),
beforeSend: function() {


form.html('<div class="loader"><svg xml:space="preserve" style="enable-background:new 0 0 50 50;" viewBox="0 0 24 30" height="20px" width="21px" y="0px" x="0px" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" id="Layer_1" version="1.1"><rect opacity="0.2" fill="#333" height="8" width="3" y="10" x="0"><animate repeatCount="indefinite" dur="0.6s" begin="0s" values="0.2; 1; .2" attributeType="XML" attributeName="opacity"/><animate repeatCount="indefinite" dur="0.6s" begin="0s" values="10; 20; 10" attributeType="XML" attributeName="height"/><animate repeatCount="indefinite" dur="0.6s" begin="0s" values="10; 5; 10" attributeType="XML" attributeName="y"/></rect><rect opacity="0.2" fill="#333" height="8" width="3" y="10" x="8"> <animate repeatCount="indefinite" dur="0.6s" begin="0.15s" values="0.2; 1; .2" attributeType="XML" attributeName="opacity"/><animate repeatCount="indefinite" dur="0.6s" begin="0.15s" values="10; 20; 10" attributeType="XML" attributeName="height"/><animate repeatCount="indefinite" dur="0.6s" begin="0.15s" values="10; 5; 10" attributeType="XML" attributeName="y"/></rect><rect opacity="0.2" fill="#333" height="8" width="3" y="10" x="16"><animate repeatCount="indefinite" dur="0.6s" begin="0.3s" values="0.2; 1; .2" attributeType="XML" attributeName="opacity"/><animate repeatCount="indefinite" dur="0.6s" begin="0.3s" values="10; 20; 10" attributeType="XML" attributeName="height"/><animate repeatCount="indefinite" dur="0.6s" begin="0.3s" values="10; 5; 10" attributeType="XML" attributeName="y"/></rect></svg></div>');


},
success: function(data) {


form.html('<a class="btn wishlist btn-default added" href="/pages/wish-list" title="Go to wishlist" style="border: 1px solid #dadada !important; border-radius: 50%;"><i class="fa fa-check"></i></a>');


var title = $(productItem).find('.product-name').html();


var image = $(productItem).find('.product-featured-image').attr('src');


$('.product-popup').removeClass('cart-popup').addClass('wishlist-popup');


$('.product-popup .overlay').removeClass('no-background');


$('.product-popup').find('.product-name').html(title);


$('.product-popup').find('.product-image img').attr('src', image);


showPopup('.product-popup');


},


error: function(xhr, text) {

form.html('<a class="btn btn-default wishlist added" href="/pages/wish-list" title="Go to wishlist" style="border: 1px solid #dadada !important; border-radius: 50%;"><i class="fa fa-check"></i></a>');

$('.error-message').text($.parseJSON(xhr.responseText).description);


showPopup('.error-popup');


}
});
});

0 Likes

Success.

Excursionist
15 11 0

i didn't get success: function(data) 

0 Likes
Shopify Expert
665 162 195

Did this function work - error: function(xhr, text) {} ?

On The Map Marketing | Developing custom Shopify Sites & Apps is our thing

- Install our latest app Accessibly - Makes your store accessible for everyone, helps to avoid fines
- Inc 5000 | Shopify Parners | 20+ stores launched | 300+ active clients
- Need help with your Shopify store? Reach out to us!
1 Like

Success.

Excursionist
15 11 0

yes 

0 Likes
Shopify Expert
665 162 195

Whats the xhr.responseText response??

On The Map Marketing | Developing custom Shopify Sites & Apps is our thing

- Install our latest app Accessibly - Makes your store accessible for everyone, helps to avoid fines
- Inc 5000 | Shopify Parners | 20+ stores launched | 300+ active clients
- Need help with your Shopify store? Reach out to us!
0 Likes

Success.

Excursionist
15 11 0

form.html('<a class="btn btn-default wishlist added" href="/pages/wish-list" title="Go to wishlist" style="border: 1px solid #dadada !important; border-radius: 50%;"><i class="fa fa-check"></i></a>');

$('.error-message').text($.parseJSON(xhr.responseText).description);


showPopup('.error-popup');

0 Likes