Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Different price
- This topic has 21 replies, 2 voices, and was last updated 5 years, 3 months ago by
WCFM Forum.
- AuthorPosts
- September 23, 2019 at 3:02 am #83044
info100
ParticipantHello 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 #83337
WCFM Forum
MemberOK, but what’t the problem? Code is not working?
- September 26, 2019 at 3:48 pm #83775
info100
ParticipantProblem
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 #83970
WCFM Forum
MemberHI,
$ 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 #84042
info100
ParticipantI 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 #84428
WCFM Forum
MemberHI,
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 #84757
info100
ParticipantHello 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 #84774
info100
ParticipantPlease, 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 #84789
info100
Participantfunction 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 #84933
info100
Participantthank you for not answering
- October 8, 2019 at 4:29 pm #85652
info100
ParticipantThis reply has been marked as private. - October 11, 2019 at 10:19 am #86177
WCFM Forum
MemberHi,
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 #86829
info100
ParticipantThis reply has been marked as private. - October 14, 2019 at 7:25 pm #86881
info100
ParticipantOK I did it.
Thank you so much.
well you are - October 16, 2019 at 12:40 pm #87104
WCFM Forum
MemberGreat .. thanks for the update 🙂
- October 16, 2019 at 3:17 pm #87140
info100
ParticipantThe 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 #87511
WCFM Forum
MemberHi,
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 #91287
info100
ParticipantHello 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 #91901
WCFM Forum
MemberSorry, 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 #91968
info100
ParticipantHello 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 #92293
info100
ParticipantI am waiting answer.
- November 22, 2019 at 10:10 am #93377
WCFM Forum
MemberWell, 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.