• Resolved mincu

    (@mincu)


    Hi, Is it possible to manage upsells or gifts for different languages?

    In the sense that if a customer in Italy buys I would like to offer two gifts whereas if a customer in France buys I would like to offer 3 gifts. Is it possible to do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Giacomo

    (@jakjako)

    With standard options, not.
    Only way I can think of is working with custom code.
    We have 2 filters “wjufw_gift_is_valid” and “wjufw_upsell_is_valid” that decide when an upsell or gift is displayed and can stay on cart.

    You can work there.
    Small example:

    add_filter(‘wjufw_gift_is_valid’, function( $value, $gift, $in_cart_upsells ){

    $idOfProductOnlyFromItaly = 31;

    //If the gift is not the one we want to give only to customers from Italy, default beheaviour

    if( !$gift || $gift[‘id’] != $idOfProductOnlyFromItaly) return $value;

    //Logic to check if customer is from Italy (IP?)

    $fromItaly = true;

    return $fromItaly;

    }, 3 , 10 );


    Plugin Author Giacomo

    (@jakjako)

    I close this topic for no reply, if you need assistance feel free to open a new one ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.