Show
Ignore:
Timestamp:
02/17/10 15:25:48 (7 months ago)
Author:
av
Message:

fixed google price for minimum_quantity_for_purchase; ignored products with empty urls

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • modules/trunk/GoogleMerchant/views.py

    r618 r622  
    88from djw.core.ProductCatalog.models import Product 
    99from django.http import Http404 
     10# dependense 
     11from djw.custom.ProductCatalog_custom.models import customizedProduct 
    1012 
    1113# todo: move function to djhdgutils 
     
    2325        self._product = product 
    2426        self._country = country 
     27        self._customized_product = customizedProduct.objects.get( 
     28            product=product) 
    2529        super(GProduct, self).__init__(*args, **kwargs) 
    2630 
     
    3337    def price(self): 
    3438        if settings.PRICE_FOR_COUNTRY: 
    35             return settings.PRICE_FOR_COUNTRY(self.product, self._country) 
     39            single_price = settings.PRICE_FOR_COUNTRY(self.product, 
     40                                                    self._country) 
    3641        else: 
    37             return self.product.price 
     42            single_price = self.product.price 
     43 
     44        min_quantity_price = single_price * self._customized_product\ 
     45            .minimum_quantity_for_purchase 
     46 
     47        return min_quantity_price 
    3848 
    3949 
     
    5666    google_products = [GProduct(p, country) 
    5767                       for p in Product.objects.all() 
     68                       if p.get_absolute_url() != '' 
    5869                       ] 
    5970