scenario: I'm trying to add a query string to the add-to-cart-wrapper in my search at the bottom of every product page.
So far I've successfully done it for the button, but not for all the other links present into the add-to-cart-wrapper div.
you can see what I mean at the very bottom of this page: Demo page to see the problem
There are two links that I cannot find in the code: one added under
<div class="product-header">
and one under
<div class="add-to-cart-wrapper">
I don't know where they are added and wheter it is by php or JS. Anyone can help pointing me in the right direction?
Thanks a lot in advance!!
Here for reference the last part of content-product.php with my little modification.
<li <?php post_class( $classes ); ?>>
<?php do_action( 'woocommerce_before_shop_loop_item' ); ?>
<?php
/**
* woocommerce_before_shop_loop_item_title hook
*
* @hooked woocommerce_show_product_loop_sale_flash - 10
* @hooked woocommerce_template_loop_product_thumbnail - 10
*/
do_action( 'woocommerce_before_shop_loop_item_title' );
?>
<div class="product-header">
<?php
echo '<div class="add-to-cart-wrapper">';
echo apply_filters( 'woocommerce_loop_add_to_cart_link',
sprintf( '<a href="%s?%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="btn btn-md %s product_type_%s">%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_html($myargs["query"]),
esc_attr( $product->id ),
esc_attr( $product->get_sku() ),
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
esc_attr( $product->product_type ),
esc_html( $product->add_to_cart_text() )
),
$product );
echo '</div>';
?>
</div>
<a href="<?php the_permalink(); echo ("?".$myargs["query"]); ?>"><h3><?php the_title(); ?></h3></a>
<?php
/**
* woocommerce_after_shop_loop_item_title hook
*
* @hooked woocommerce_template_loop_rating - 5
* @hooked woocommerce_template_loop_price - 10
*/
do_action( 'woocommerce_after_shop_loop_item_title' );
?>
<?php
/**
* woocommerce_after_shop_loop_item hook
*
* @hooked woocommerce_template_loop_add_to_cart - 10
*/
do_action( 'woocommerce_after_shop_loop_item' );
?>