Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django djang奥斯卡优惠券和优惠_Django_Python 3.x_E Commerce_Django Oscar - Fatal编程技术网

Django djang奥斯卡优惠券和优惠

Django djang奥斯卡优惠券和优惠,django,python-3.x,e-commerce,django-oscar,Django,Python 3.x,E Commerce,Django Oscar,如果我有一个能打九折的单一报价 我还有一张优惠券,同样的产品可以打九折 当我将这两个优惠添加到我的购物篮中时,凭证折扣不适用。 如果我更改优惠的优先级,我可以添加凭证,但不应用单一优惠折扣 我需要将这两个报价应用到篮子中。 我为优惠券优惠创建了自定义条件。然后我试着消耗0个数量来提供。 但它没有像我预期的那样工作 class CustomCouponCondition(CountCondition): ''' oscar_customize.offer.models.C

如果我有一个能打九折的单一报价 我还有一张优惠券,同样的产品可以打九折

当我将这两个优惠添加到我的购物篮中时,凭证折扣不适用。 如果我更改优惠的优先级,我可以添加凭证,但不应用单一优惠折扣

我需要将这两个报价应用到篮子中。

我为优惠券优惠创建了自定义条件。然后我试着消耗0个数量来提供。 但它没有像我预期的那样工作

class CustomCouponCondition(CountCondition):

    '''
        oscar_customize.offer.models.CustomCouponCondition
    '''

    name = "Custom Coupon Conditions"

    class Meta:
        proxy = True

    def consume_items(self, offer, basket, affected_lines):

        for __, line in self.get_applicable_lines(offer, basket, most_expensive_first=True):
            line.consume(0, offer=offer)


你没有给我足够的代码让我完全理解逻辑。据我所知,您正在将优惠应用于篮子中的每一行,如果是这种情况,您能否检查两个优惠是否都适用,如果适用,请将折扣百分比合并并应用。是否有其他解决方案?我对django oscar没有太多经验,因此,最好的办法是再次发布这个问题,并提供更清晰的信息,以便其他人能够回答。