I managed to get the correct cart_id with this, I added the If there because it doesn't make sense to let the user convert empty carts.
It seems to be working so far but if anything is wrong or missing please correct it
You can change the thread title if you want (since it doesn't mention convert button), I think this might be useful for others too.
Thanks again.
if(!@include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')){ return false; }
$config = hikashop_config();
$cartHelper= hikashop_get('helper.cart');
$params ='';
$params = new HikaParameter($params);
global $Itemid;
$url_itemid = '&Itemid='.$Itemid;
$cartClass = hikashop_get('class.cart');
if($cartClass->get()){
$cart = $cartClass->loadCart();
$params->set('cart_type','wishlist');
echo $cartHelper->displayButton(JText::_('CART_TO_WISHLIST'),'wishlist',$params,hikashop_completeLink('cart&task=convert&cart_type=cart&cart_id='.$cart->cart_id.$url_itemid),'window.location.href = \''.hikashop_completeLink('cart&task=convert&cart_type=cart&cart_id='.$cart->cart_id.$url_itemid).'\';return false;');
}
else {echo "Please add products to your cart before trying to convert."}
edit: gonna leave here the rest of the code in case someone also wants to filter wishlists by name without users having to send urls to each others
note: this does not take into account the share options of the wishlist, tho that can be added, in this specific case I wanted users to chase the least amount of options possible
<?php
if(isset($_POST["cart_name"])) {
JRequest::checkToken() or die( JText::_( 'Invalid Token' ) );
$cart_name = JRequest::getCmd( 'cart_name', '', 'POST' );
if($cart_name != "") {
$db = JFactory::getDBO();
$query = 'SELECT cart_id FROM jos_hikashop_cart WHERE cart_name = '. $db->quote($cart_name).' ';
$db->setQuery($query);
$result = $db->loadResult();
if($result !== null) {
$url ="index.php?option=com_hikashop&ctrl=cart&task=showcart&cart_id=".$result."&cart_type=wishlist";
header( "Location: $url" );
}
else {JError::raiseNotice( 100, 'No wishlist was found' );}
}
else {JError::raiseNotice( 100, 'Please fill the wishlist name field"' );}
}
?>
<form id="idWeddinglistform" name="weddinglistForm" method="post" action="">
<label>
Wishlist name:
<span> *</span>
</label>
<input type="text" name="cart_name">
<button type="submit">Search</button>
<?php echo JHTML::_( 'form.token' ); ?>
</form>
I used both of these with a flexi module.