php - Woocommerce Add custom "Add to cart button" in single page with tags

admin2025-06-06  3

I want to add a custom "ADD TO CART" button in the single product page.

I have done it using the id of the product.

<?php echo '<a href="?add-to-cart='.get_the_id($product_id).'">ADD TO CART</a>'; ?>

I want to add quantity, variation and attribute tags too.

so that I can get sth like:

domain/myproduct/?add-to-cart=100&variation_id=200&attribute_pa_colour=blue
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749139478a316696.html

最新回复(0)