By default, WooCommerce creates a link in both the image and the product title when it is created, which takes you to its own page. My intention is to change this link to take the client to another page where you can add designs to that product.
The code to change is this, in the file "cart.php"
<td class="product-name">
<?php // Avada edit ?>
<span class="product-thumbnail">
<?php
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
if ( ! $_product->is_visible() )
echo $thumbnail;
else
printf( '<a href="%s">%s</a>', _product->get_permalink( $cart_item ), $thumbnail );
?>
</span>
<div class="product-info">
<?php
if ( ! $_product->is_visible() )
echo apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key );
else
// Avada edit
echo apply_filters( 'woocommerce_cart_item_name', sprintf( '<a class="product-title" href="%s">%s</a>', $_product->get_permalink( $cart_item ), $_product->get_title() ), $cart_item, $cart_item_key );
If I'm not wrong to remove any link I have to manipulate the else
of the section <div class="product-info">
by this line:
sprintf( '%s', $_product->get_title() ), $cart_item, $cart_item_key );
Here's my question: How do I call the product to which I want to change your link with $_product->id
?? I do not know where to put it in the function or how to change the link without pifiarla ...
Thank you!