Woocommerce custom attributes list help

If I understand your question correctly: <?php global $product; $sizes = $product->get_attribute( ‘size’ ); $sizes = explode(“, “,$sizes); ?> <?php if($sizes[0]!=”){ // if product sizes are defined ?> <ul class=”list-group”> <?php foreach($sizes as $size){ ?> <li class=”list-group-item”><?php echo $size; ?></li> <?php } ?> </ul> <?php } ?>

Custom plugin issue – Notice: Trying to get property of non-object in

try use global $post; at the beginning of your function Note that you’ve to run on a specific hook in order to work. see this post: https://www.ibenic.com/how-to-add-woocommerce-custom-product-fields/ function spinna360_nof() { $noy=array( ‘id’ => ‘_select_noi’, ‘label’ => __( ‘Select number of images: ‘, ‘spinna360’ ), ‘selected’ => true, ‘options’ => [ ’24’ => __( ’24’, ‘spinna360’ … Read more

How to trigger WooCommerce user profile edit change?

Try this below code add_action( ‘personal_options_update’, ‘save_user_profile_update’ ); add_action( ‘edit_user_profile_update’, ‘save_user_profile_update’ ); function save_user_profile_update( $user_id ) { update_user_meta( $user_id, ‘address’, $_POST[‘address’] ); update_user_meta( $user_id, ‘city’, $_POST[‘city’] ); update_user_meta( $user_id, ‘postalcode’, $_POST[‘postalcode’] ); }

WooCommerce subcategories help

<div class=”col-sm-3 col-sm-pull-9 sidebar”> <div class=”list-group products box”> <h4>Product Range</h4> <?php $terms = get_the_terms( $post->ID, ‘product_cat’ ); foreach ( $terms as $term ){ $category_name = $term->name; $parent_category_id = $term->term_id; $categories=get_categories(array( ‘parent’ => $category_id )); $children = get_terms( ‘product_cat’, array( ‘parent’ => $parent_category_id, ‘hide_empty’ => false ) ); foreach( $children as $subcat ){ ?> <a href=”https://wordpress.stackexchange.com/questions/315072/<?php … Read more