Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Different price
- This topic has 21 replies, 2 voices, and was last updated 5 years, 1 month ago by WCFM Forum.
- AuthorPosts
- September 23, 2019 at 3:02 am #83044info100Participant
Hello there
I created two kinds of member plans.
1) Plan type: One_time
2) Plan type: FREE
I would like to add an automatic price increase to the products they add using this code below.
For both simple and variant products.function return_custom_price($price, $product) {
global $post, $blog_id;
$product = wc_get_product( $post_id );
$post_id = $post->ID;
$price = ($price*1.25);
return $price;
}
add_filter (‘woocommerce_get_price’, ‘return_custom_price’, 10, 2); - September 24, 2019 at 10:08 am #83337WCFM ForumMember
OK, but what’t the problem? Code is not working?
- September 26, 2019 at 3:48 pm #83775info100Participant
Problem
This code works for all added products.
I just code this for store vendor free membership
function return_custom_price ($ price, $ product) {
global $ post, $ blog_id;
$ product = wc_get_product ($ post_id);
$ post_id = $ post-> ID;
$ price = ($ price * 1.25);
$ return price;
}
add_filter (‘woocommerce_get_price’, ‘return_custom_price’, 10, 2);store vendar one time for this code
function return_custom_price ($ price, $ product) {
global $ post, $ blog_id;
$ product = wc_get_product ($ post_id);
$ post_id = $ post-> ID;
$ price = ($ price * 1.50);
$ return price;
}
add_filter (‘woocommerce_get_price’, ‘return_custom_price’, 10, 2);I want to show.
Different prices for both memberships
- September 27, 2019 at 1:24 pm #83970WCFM ForumMember
HI,
$ post_id = $ post-> ID;
$ price = ($ price * 1.50);– Yo have to change here, fetch product’s vendor id. Vendor’s membership and then get commission for that membership.
Thank You
- September 27, 2019 at 5:43 pm #84042info100Participant
I don’t know how to do this.
Can you give me an example?Vendor id: 47
membership: one_timeCan I just set it as a membership?
- September 30, 2019 at 10:05 am #84428WCFM ForumMember
HI,
Please use this revised code –
function return_custom_price( $price, $product ) { global $WCFM, $WCFMmp, $post, $blog_id; $vendor_id = wcfm_get_vendor_id_by_post( $product->get_id() ); if( $vendor_id ) { $commisson_rule = $WCFMmp->wcfmmp_product->wcfmmp_get_product_commission_rule( $product->get_id() ); if( !empty( $commisson_rule ) && is_array( $commisson_rule ) && isset( $commisson_rule['percent'] ) ) { $price += ( $price * ((float)$commisson_rule['percent']/100) ); } } return $price; } add_filter( 'woocommerce_product_get_price', 'return_custom_price', 10, 2 );
Thank You
- October 2, 2019 at 12:56 pm #84757info100Participant
Hello there
my english is not very good so i may not be able to tell.
I’m sorry for that.
But I can’t solve my problem, and it’s urgent.
I have two vendor memberships, one is “one_time” and the other is “free”I would like to automatically multiply the product price by 1.5 when one_time adds a sale price to a member product.
When I add a free membership product, I want it to multiply the sales price by 1.25 and offer the sale price with the new price in the store.
- October 2, 2019 at 3:25 pm #84774info100Participant
Please, this is very urgent.
Submit a link if I’m going to make a payment.
But paypal is not used in our country. - October 2, 2019 at 4:33 pm #84789info100Participant
function return_custom_price( $price, $product ) {
global $WCFM, $WCFMmp, $post, $blog_id;$vendor_id = wcfm_get_vendor_id_by_post( $product->get_id() );
if ( vendor_user(‘subscription_type_one_time’) ) {
$ price = ($ price * 1.50);
$ return price;
}
add_filter (‘woocommerce_get_price’, ‘return_custom_price’, 10, 2);is it possible
- October 3, 2019 at 6:51 pm #84933info100Participant
thank you for not answering
- October 8, 2019 at 4:29 pm #85652info100ParticipantThis reply has been marked as private.
- October 11, 2019 at 10:19 am #86177WCFM ForumMember
Hi,
Really sorry for the delay. Actually, our site was down for few days due to upgradation.
I would like to automatically multiply the product price by 1.5 when one_time adds a sale price to a member product.
When I add a free membership product, I want it to multiply the sales price by 1.25 and offer the sale price with the new price in the store.
– Do not change my code, just setup membership wise commission accordingly.
Submit a link if I’m going to make a payment.
– Don’t get this clearly. - October 14, 2019 at 3:09 pm #86829info100ParticipantThis reply has been marked as private.
- October 14, 2019 at 7:25 pm #86881info100Participant
OK I did it.
Thank you so much.
well you are - October 16, 2019 at 12:40 pm #87104WCFM ForumMember
Great .. thanks for the update 🙂
- October 16, 2019 at 3:17 pm #87140info100Participant
The code works very well. Thank you.
But when I add a discount price, the normal only adds 50% to the discount price. Can we do this for both prices? - October 18, 2019 at 9:53 am #87511WCFM ForumMember
Hi,
Sorry, not getting this clearly.
Commission Setting – https://ibb.co/bd6jT3j
I have created discounted product – https://ibb.co/R9t2d4G
It’s showing product cost perfectly – https://ibb.co/CKn6gtBThank You
- November 7, 2019 at 4:37 pm #91287info100Participant
Hello there
As shown in the picture, the price of $ 100 remains the same.
The discount price is increasing.
But this time it seems that only $ 1 discount has been made.
It is true that both increase.
Can you give me a code to edit this? - November 12, 2019 at 9:18 am #91901WCFM ForumMember
Sorry, may be I am not getting your requirement clearly.
For creating this product I have added product’s regular price and sale price – https://ibb.co/R9t2d4G
You may add anything as per your requirement. There is no such rule to set “only $ 1 discount ” always!
Thank You
- November 12, 2019 at 3:16 pm #91968info100Participant
Hello there
My English is not very good.
Sale price: $ 100
Discount price: $ 90
In the code you provide, only the discounted price increases by 10%.false
Sale price: $ 100
Discount price: $ 99Sales price: $ 110
Discount price: $ 99
true - November 14, 2019 at 4:08 pm #92293info100Participant
I am waiting answer.
- November 22, 2019 at 10:10 am #93377WCFM ForumMember
Well, products has two prices – Regular Price and Sales Price.
Now, what you referring here as “Discount Price”?
- AuthorPosts
- The topic ‘Different price’ is closed to new replies.