Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: how to select 2 free products on products with 2 quantity #4395
    numep
    Participant

    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.

    in reply to: how to select 2 free products on products with 2 quantity #4393
    numep
    Participant

    ok, 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.

    in reply to: how to select 2 free products on products with 2 quantity #4391
    numep
    Participant

    Ok 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 🙁

    in reply to: how to select 2 free products on products with 2 quantity #4390
    numep
    Participant

    yeah 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 ) {.

    in reply to: how to select 2 free products on products with 2 quantity #4387
    numep
    Participant

    ok 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 );

    in reply to: Validation on select Free Products #4370
    numep
    Participant

    hey thanks for the quick response! and yeah that will do.

Viewing 6 posts - 1 through 6 (of 6 total)