Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Add button next to "ADD TO CART" on product archive

add_action('woocommerce_after_shop_loop_item', 'add_a_custom_button_apply', 1 );
function add_a_custom_button_apply() {
    global $product;

    // Not for variable and grouped products that doesn't have an "add to cart" button
    if( $product->is_type('variable') || $product->is_type('grouped') ) return;

    // Output the custom button linked to the product
    echo '<a class="button custom-button apply-now" href="../act-now/apply-now">' . __('Apply Now') . '</a>';
}
Source by www.sae.edu.za #
 
PREVIOUS NEXT
Tagged: #Add #button #TO #product #archive
ADD COMMENT
Topic
Name
4+3 =