2 from Products
.CMFCore
.utils
import getToolByName
3 from ZTUtils
import make_query
as mq
4 utool
= getToolByName(context
, 'portal_url')
5 pptool
= getToolByName(context
, 'portal_photo_print', None)
7 sd
= context
.session_data_manager
.getSessionData(create
= 1)
8 cart
= sd
.get('cart', None)
12 portfolio
= context
.getParentNode()
13 posOfPhoto
= portfolio
.getObjectPosition(context
.getId())
14 options
['backToContextUrl'] = '%s?b_start:int=%s' % (portfolio
.absolute_url(), posOfPhoto
/bsize
*bsize
)
15 options
['lastBcUrl'] = context
.absolute_url()
17 buyable
= bool(pptool
.getPrintingOptionsFor(context
))
18 if cart
and cart
.locked
:
23 options
['buyable'] = buyable
24 return context
.photo_view_ajax_template(**options
)