• Resolved Fujyn

    (@arwah12)


    Hi,
    how to change the add basket icon on the product page, with just text “add to cart”
    I use the theme “dokan”
    and I see this code

    Dokan: add-to-cart.php (woocommerce/loop/add-to-cart.php)

    <?php
    /**
     * Loop Add to Cart
     *
     * This template can be overridden by copying it to yourtheme/woocommerce/loop/add-to-cart.php.
     *
     * HOWEVER, on occasion WooCommerce will need to update template files and you
     * (the theme developer) will need to copy the new files to your theme to
     * maintain compatibility. We try to do this as little as possible, but it does
     * happen. When this occurs the version of the template file will be bumped and
     * the readme will list any important changes.
     *
     * @see         https://docs.woocommerce.com/document/template-structure/
     * @author      WooThemes
     * @package     WooCommerce/Templates
     * @version     3.3.1
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
        exit;
    }
    
    global $product;
    
    $icon_class = ( $product->get_type() == 'simple' ) ? 'fa-shopping-cart' : 'fa-shopping-cart';
    
    echo apply_filters( 'woocommerce_loop_add_to_cart_link',
        sprintf( '<a href="%s" rel="nofollow" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="cat btn add_to_cart_button %s" title="%s">%s</a>',
            esc_url( $product->add_to_cart_url() ),
            esc_attr( isset( $quantity ) ? $quantity : 1 ),
            esc_attr( $product->get_id() ),
            esc_attr( $product->get_sku() ),
            esc_attr( isset( $class ) ? $class : 'button' ),
            esc_html( $product->add_to_cart_text() ),
            sprintf( '<i class="fa %s"></i>', $icon_class )
        ),
    $product );
    

    screenshot 1
    https://i.paste.pics/c9ac7bcd6610bffc3bc68b8e99856b53.png
    screenshot 2
    https://i.paste.pics/185212311efd92d171debf0ac54d47c9.png

    I hope someone there can help me
    Thank you very much

Viewing 2 replies - 16 through 17 (of 17 total)
Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘change the add basket icon on the product page, with just text “add to cart’ is closed to new replies.