admin管理员组

文章数量:1130349

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

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

本文标签: phpWoocommerce Add custom quotAdd to cart buttonquot in single page with tags