• Resolved Niraj Singh

    (@nirajsharp)


    How to add link to product to image i have put on checkout page in following code

    /**
     * @snippet       WooCommerce Show Product Image @ Checkout Page
     * @author        Sandesh Jangam
     * @donate $9     https://www.paypal.me/SandeshJangam/9
     */
    add_filter( 'woocommerce_cart_item_name', 'ts_product_image_on_checkout', 10, 3 );
     
    function ts_product_image_on_checkout( $name, $cart_item, $cart_item_key ) {
         
        /* Return if not checkout page */
        if ( ! is_checkout() ) {
            return $name;
        }
         
        /* Get product object */
        $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
     
        /* Get product thumbnail */
        $thumbnail = $_product->get_image();
     
        /* Add wrapper to image and add some css */
        $image = '<div class="ts-product-image" style="">'
                    . $thumbnail .
                '</div>'; 
     
        /* Prepend image to name and return it */
        return $image;
    }

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @nirajsharp,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers!

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to come up with a solution and the above info on available resources for developers helped you out. If you do require more help with the actual coding, you could hire a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding link of product to image’ is closed to new replies.