Forum Replies Created
-
AuthorPosts
-
December 7, 2018 at 1:54 pm in reply to: how to select 2 free products on products with 2 quantity #4395numepParticipant
thanks for ur time, I found the SOLUTION, but will definitely be hiring soft79 if I need further customization’s, also I recommended your Plugin to a few friends of mine, so be assured you have a good client here. Thanks for ur time.
December 7, 2018 at 1:16 pm in reply to: how to select 2 free products on products with 2 quantity #4393numepParticipantok, thanks for your help will try to apply hack using those hooks.
About the extra free item can u help me out with some example code since I’m kind of lost. I appreciate your help and time.
December 7, 2018 at 12:56 pm in reply to: how to select 2 free products on products with 2 quantity #4391numepParticipantOk think I found the solution for this:
// Add free products or adjust the quantity $cart_item_key = $this->set_free_product_amount_in_cart( 854, 1 ); foreach ( $free_product_ids as $product_id => $qty ) { $cart_item_key = $this->set_free_product_amount_in_cart( $product_id, $qty ); } }
UPDATE: Only problem it wont remove when coupon is not valid 🙁
December 7, 2018 at 12:48 pm in reply to: how to select 2 free products on products with 2 quantity #4390numepParticipantyeah thanks for suggestion, I do know is best not to edit the core files but since I need to add a input field in admin so they can choose the QUANTITY than I had to edit core files, anyways this is no issues since if u update plugin I can compare files and update necessary files, at the moment hack is working as I want it to work.
Just want to add other hack that lets add 1 manual additional FREE PRODUCT if coupon applied can u help me with this can’t seem to find where to insert code however I suspect is in this function
private function set_free_product_amount_in_cart( $product_id, $quantity ) {
.December 7, 2018 at 12:34 pm in reply to: how to select 2 free products on products with 2 quantity #4387numepParticipantok so I read other posts and created a hack and added a INPUT type number so ADMIN can choose quantity of Free products using this code:
private function get_free_product_amount_for_coupon( $coupon ) { $coupon_qty = $this->get_quantity_products_value( $coupon ); $coupon_multiplier_qty = $this->get_product_multiplier_value( $coupon ); return apply_filters( 'wjecf_free_product_amount_for_coupon', ($coupon_qty > 0 ? $coupon_qty:$coupon_multiplier_qty ), $coupon ); // 2.3.3 }
so now I would like to know a last question, can u help me out with a filter or code to add an ADDITIONAL free gift on a coupon? it should be 1 free product something like this
$this->add_to_cart( 854, 1,'', '', $cart_item_data );
numepParticipanthey thanks for the quick response! and yeah that will do.
-
AuthorPosts