Skip to content

Instantly share code, notes, and snippets.

@hakikz
Created April 25, 2021 09:41
Show Gist options
  • Save hakikz/2ba7ca7133ed40bfa8bb8b6620352fc0 to your computer and use it in GitHub Desktop.
Save hakikz/2ba7ca7133ed40bfa8bb8b6620352fc0 to your computer and use it in GitHub Desktop.
<?php
echo apply_filters(
'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
sprintf(
'<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s" %s>%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
esc_attr( $product->get_id() ),
esc_attr( $product->get_sku() ),
esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),
isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',
esc_html( $product->add_to_cart_text() )
),
$product,
$args
);
<?php
function wvs_noo_organici_theme_support() {
add_action( 'woocommerce_after_shop_loop_item_title', 'wvs_pro_archive_variation_template', 10 );
}
add_action( 'init', 'wvs_noo_organici_theme_support' );
a.add_to_cart_button:before {
font-family: 'FontAwesome';
content: '';
content: "\f07a";
padding-right: 10px;
}
<?php wc_product_class( ' ', $product ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment