<s> from __future__ import unicode_literals <EOL> from shop . modifiers . defaults import DefaultCartModifier <EOL> from myshop . models . polymorphic . smartphone import SmartPhoneModel <EOL> class MyShopCartModifier ( DefaultCartModifier ) : <EOL> """<STR_LIT>""" <EOL> def process_cart_item ( self , cart_item , request ) : <EOL> if isinstance ( cart_item . product , SmartPhoneModel ) : <EOL> product_code = cart_item . extra . get ( '<STR_LIT>' ) <EOL> cart_item . unit_price = cart_item . product . get_product_variant ( product_code ) . unit_price <EOL> else : <EOL> cart_item . unit_price = cart_item . product . get_price ( request ) <EOL> cart_item . line_total = cart_item . unit_price * cart_item . quantity <EOL> return super ( DefaultCartModifier , self ) . process_cart_item ( cart_item , request ) </s>
