Title: riew's Replies | WordPress.org

---

# riew

  [  ](https://wordpress.org/support/users/riew/)

 *   [Profile](https://wordpress.org/support/users/riew/)
 *   [Topics Started](https://wordpress.org/support/users/riew/topics/)
 *   [Replies Created](https://wordpress.org/support/users/riew/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/riew/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/riew/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/riew/engagements/)
 *   [Favorites](https://wordpress.org/support/users/riew/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Sell content access per product](https://wordpress.org/support/topic/sell-content-access-per-product/)
 *  Thread Starter [riew](https://wordpress.org/support/users/riew/)
 * (@riew)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/sell-content-access-per-product/#post-16595361)
 * Hi Roxy
   Thanks! I actually looked at those but could only find the option of 
   selling access to a lot of content on a user level basis – not to match a product
   with access to specific content.But meanwhile I got the “Protected Content Packages
   For WooCommerce” plugin to work. The error was my mistake. :o)
 * So problem is solved.
 * But thanks! If I end up having problems with the “Protected Packages” plugin 
   I will definately have a closer look at WooCommerce Memberships and Ultimate 
   Memberships. Thanks for taking the time to point me towards a solution.
 * Have a great day! :o)
 * Kind regards
   Rie
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Protected Content Packages For WooCommerce] Ooops! Plugin gives access to all protected content](https://wordpress.org/support/topic/ooops-plugin-gives-access-to-all-protected-content/)
 *  Thread Starter [riew](https://wordpress.org/support/users/riew/)
 * (@riew)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/ooops-plugin-gives-access-to-all-protected-content/#post-16593743)
 * Hahahahaha!! That was too stupid!! :os
 * I tried everything; went into Chrome incognito browser, F12+rightclick -> clear
   cache, not logged in, and I just kept having access to my hidden pages.
 * Why on earth didn’t it work?
   Because somehow I was still logged in as admin!!
   Don’t know how that could happen in new incognito window after logout, but apparently
   it could…!So now I am only left with text edit issues. I can fix those.
 * Yay!! :oD
 * Let me know if you make a premium version. I would definitely support you getting
   paid to keep this plugin working. :o)
   (You can write it as a comment in WordPress
   to those who have it installed – then I’ll see it. I won’t be letting go of this
   plugin.)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Link to chosen variable product from category page](https://wordpress.org/support/topic/link-to-chosen-variable-product-from-category-page/)
 *  Thread Starter [riew](https://wordpress.org/support/users/riew/)
 * (@riew)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/link-to-chosen-variable-product-from-category-page/#post-14211592)
 * Thanks for the suggestion! :o)
 * I would prefer not to install a plugin; I have a feeling that this can be done
   with a few lines of code… I just need to add the value from the dropdown to my
   link. :o)
 * I use this code to display the price of each variation in the dropdown:
 *     ```
       add_filter( 'woocommerce_variation_option_name', 'display_price_in_variation_option_name' );
   
       function display_price_in_variation_option_name( $term ) {
       global $wpdb, $product;
   
       $result = $wpdb->get_col( "SELECT slug FROM {$wpdb->prefix}terms WHERE name = '$term'" );
   
       $term_slug = ( !empty( $result ) ) ? $result[0] : $term;
   
       $query = "SELECT postmeta.post_id AS product_id
       FROM {$wpdb->prefix}postmeta AS postmeta
       LEFT JOIN {$wpdb->prefix}posts AS products ON ( products.ID = postmeta.post_id )
       WHERE postmeta.meta_key LIKE 'attribute_%'
       AND postmeta.meta_value = '$term_slug'
       AND products.post_parent = $product->id";
   
       $variation_id = $wpdb->get_col( $query );
   
       $parent = wp_get_post_parent_id( $variation_id[0] );
   
       if ( $parent > 0 ) {
       $_product = new WC_Product_Variation( $variation_id[0] );
   
       $itemPrice = strip_tags (woocommerce_price( $_product->get_price() ));
       //this is where you can actually customize how the price is displayed
       return $term . ' (' . $itemPrice . ')';
       }
       return $term;
       }
       ```
   
 *  Can’t I grab some information (chosen ID) from this dropdown and add it to the“
   View product” button? The code for that button is:
 *     ```
       function mycode_add_more_details_button_to_single() {
       	add_action( 'woocommerce_after_shop_loop_item', 'mycode_display_more_details_button_to_single' );
       }
   
       add_action( 'init', 'mycode_add_more_details_button_to_single' );
   
       function mycode_display_more_details_button_to_single() {
   
       	global $product;
   
       	$url   = $product->get_permalink();
       	$text  = __( 'Se varen', 'mycode' );
       	$title = sprintf( __( 'Se mere om %s', 'mycode' ), $product->get_name() );
       	$class = sprintf( 'button add_to_cart_button product_type_%s', $product->get_type() );
   
       	$format = '<a href="%1$s" title="%2$s" class="single_add_to_cart_button button alt">%4$s</a>';
   
       	printf( $format, esc_url( $url ), esc_attr( $title ), esc_attr( $class ), esc_html( $text ) );
       }
       ```
   
 * Any ideas…? :o)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Hide Add-to-cart button on category pages](https://wordpress.org/support/topic/hide-add-to-cart-button-on-category-pages/)
 *  Thread Starter [riew](https://wordpress.org/support/users/riew/)
 * (@riew)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/hide-add-to-cart-button-on-category-pages/#post-14211550)
 * Marking as closed. Thank you! :o)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Hide Add-to-cart button on category pages](https://wordpress.org/support/topic/hide-add-to-cart-button-on-category-pages/)
 *  Thread Starter [riew](https://wordpress.org/support/users/riew/)
 * (@riew)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/hide-add-to-cart-button-on-category-pages/#post-14211549)
 * This is perfect – worked like a charm!
 * Thank you so much for your fast help! :o)

Viewing 5 replies - 1 through 5 (of 5 total)