WIshlist button doesn’t appear in elementor editor
-
Hi YITH team,
I have enabled the feature where I converted the YITH Wishlist PHP template to React for the front end, but it is not appearing in the Elementor editor.
Additionally, I need a custom button for styling purposes. The “Add to Wishlist” button should include my own loader, heart icon, and tooltip.
I created a custom button, but I am unable to add or remove products from the wishlist via AJAX. Could you please assist me with this?
ajax handler code
————————-if ( class_exists( 'YITH_WCWL_Wishlist_Factory' ) ) {
$product_id = intval( $_POST['product_id'] );
$wishlist = YITH_WCWL_Wishlist_Factory::get_wishlist();
if ( $wishlist->has_product( $product_id ) ) {
// Remove from Wishlist
$wishlist->remove_item( $product_id );
wp_send_json_success( array( 'action' => 'removed' ) );
} else {
// Add to Wishlist
$wishlist->add_item( $product_id );
wp_send_json_success( array( 'action' => 'added' ) );
}
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.