Join our new community forum for support & discussion

Join Now

Home Support General HivePress Select which categories Tiers attribute will appear.

Select which categories Tiers attribute will appear.

  • Author
    Posts
  • viniciusbh.soares

    The same way that is possible to select in which categories selling, there is some php snippet to select which categories the Tier Attribute from “Hivepress>Setting> [x]Allow sellers to set pricing” tiers attribute will appear?

    ihor developer

    If you mean making tiers category-specific it may be possible with a code snippet:

    add_filter(
    	'hivepress/v1/models/listing/attributes',
    	function( $attributes ) {
    		if ( isset( $attributes['price_tiers'] ) ) {
    			$categories = [ 1, 2, 3 ];
    
    			$attributes['price_tiers']['categories']  = $categories;
    		}
    
    		return $attributes;
    	},
    	1000
    );
    viniciusbh.soares

    How to select in which categories price_tiers will appear? = [ 1, 2, 3 ] is the category id?

    ihor developer

    Yes, if you replace this list of category IDs then the pricing tiers should appear for these categories only. You can hover on the category link on back-end to check the category ID, usually it looks like “?tag=123”.

Viewing 4 posts - 1 through 4 (of 4 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.