def select_variant_from_properties(request):
    product_id = request.POST.get("product_id")

    try:
        variant = Product.objects.get(pk=product_id)
    except Product.DoesNotExist:
        return HttpResponse("")
    else:
        product = variant.parent

    options = lfs_utils.parse_properties(request)
    variant = product.get_variant(options)

    if variant is None:
        msg = _(u"The choosen combination of properties is not deliverable.")
        variant = product.get_default_variant()
    else:
        msg = _(u"The product has been changed according to your selection.")

    result = json.dumps({
        "product": product_inline(request, variant),
        "message": msg,
    }, cls=LazyEncoder)

    return HttpResponse(result, content_type='application/json')
Gets the current face's html.
dataset/ETHPy150Open diefenbach/django-lfs/lfs/catalog/views.py/select_variant_from_properties--crossover with--dataset/ETHPy150Open anandology/pyjamas/library/pyjamas/ui/CustomButton.py/CustomButton.getHTML