How to default New Listing to specific Woo Product Category?

When a new listing is created by a Seller, how an we default the listing to a defined and specific WooCommerce Product Category? The use case is such:

Since we are payingout via PayPal, we want the Seller of the Listing and the Buyer of the listing only have the option of using PayPal during checkout. We don’t want them to be able to use any other payment method we have activated. I believe we found the solution on how to limit payment options by Product Category, but I need to get all such listings in a payment category by default in order to control the experience. We created a Woo Product Category called “Listings”. We want all new listings created to default to “Listings”.

I appreciate your help and expertise!

Sorry, this would require customizations, but maybe this extension or settings that limit payment methods per category has some option for limiting per product type? The products generated by HivePress all have the Catalog Mode set to Hidden, also they are marked as Virtual

Understood. While I found a plugin that will force a payment option based on the category of the item in the cart, I have not found where I can default a product category.

For now, we will handle this manually, marking the category when the listing is verified.

We need to have a Woo category called, “Listings”. We want to put all HivePress listings under the Woo category but we are not seeing a way to do this. The reason is, that when someone purchases a Private Listing, we want to restrict the payment method they are allowed to use and we can only set this restriction based on the Woo Categories.

I noticed there is no way to manually mark the category on the listing but the Woo Categories are not listed on the HP listing’s page. How do we expose or link the “Virtual” category that is hidden to a Woo category called “Listings” for which we created? What is the cost for a custom snippet, if required, to do this?

Yes, all the hidden products for HivePress listings are generated automatically. If you have a developer for custom work please suggest using the hivepress/v1/models/listing/update action with some high priority (e.g. 1000, so the attached function will run after the HivePress functions). Here’s an example:

add_action(
	'hivepress/v1/models/listing/update',
	function( $listing_id ) {
		$product = hivepress()->woocommerce->get_related_product( $listing_id );

		if ( $product ) {
			// do anything, e.g. assign a category.
		}
	},
	1000
);

Okay. We have access to a developer who can do snippets for us. How can we set up the system so a new Listing defaults under a Woo>Products Parent Category? Any guidance that we are relay is appreciated.

Please try using this code snippet as a sample, it disables specific payment gateways for Marketplace listings, while keeping them for other purposes (e.g. Paid Listings, Memberships…) Payment method based - #8 by LTON So mapping to product categories may not be required, along with the WooCommerce extension.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.