Edit product details on front end

on the listing page the vendor can edit some details for this product ( price, name etc). Is possible by some code snippet edit other details like the commission rate for affiliate from Affiliates plugin by itthinx ?

Hi,

It could work if the commission rate were stored as a post-meta field and if the field name matches the attribute. But please note that it requires customization and integration.

If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY.

I need to:

  • create a add_filter to edit comission rate and show it on frontend

What is the name of the function that hivepress uses to edit an product on woocommerce?

Hi,

For example, you can try this PHP snippet (How to add custom code snippets - HivePress Help Center), which adds a custom fee to an order:

add_filter(
 'hivepress/v1/models/listing/cart',
 function($cart, $listing){
  $cart['meta']['fees'][] = [
   'name' => 'Test fee',
   'amount' => 100
  ];
  
  return $cart;
 },
 1000,
 2
);

Please note that it can require further customization.

P.S. If you purchased a theme or extension, please enter the license key in the forum profile settings, this will enable the Premium Support badge and ensure a 24-hour turnaround time.

1 Like

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