Skip to content

Instantly share code, notes, and snippets.

View cyberdev's full-sized avatar
🏠
Working from home

Nasrul Fatoni cyberdev

🏠
Working from home
View GitHub Profile
@dazecoop
dazecoop / attributes-as-options.php
Last active April 16, 2024 02:57
WooCommerce product attributes as selectable options without variations
<?php
/**
* List available attributes on product page in a drop-down selection
*/
add_action('woocommerce_before_add_to_cart_button', 'list_attributes_on_product_page');
function list_attributes_on_product_page() {
global $product;
$attributes = $product->get_attributes();