Exemplo n.º 1
0
 public function addValuesToResult($storeId = null)
 {
     if (Mage::app()->getStore()->isAdmin() && Mage::app()->getRequest()->getControllerName() != 'catalog_product') {
         $storeId = Mage::getSingleton('adminhtml/session_quote')->getStoreId();
     }
     return parent::addValuesToResult($storeId);
 }
Exemplo n.º 2
0
 public function addPriceToResult($store_id)
 {
     parent::addPriceToResult($store_id);
     $this->getSelect()->joinLeft(array('default_option_aitimage' => $this->getTable('catalog/product_option_aitimage')), '`default_option_aitimage`.option_id=`main_table`.option_id AND ' . $this->getConnection()->quoteInto('`default_option_aitimage`.store_id=?', 0), array('default_image_template_id' => 'image_template_id', 'default_area_size_x' => 'area_size_x', 'default_area_size_y' => 'area_size_y', 'default_area_offset_x' => 'area_offset_x', 'default_area_offset_y' => 'area_offset_y', 'default_use_text' => 'use_text', 'default_use_user_image' => 'use_user_image', 'default_predefined_cats' => 'predefined_cats', 'default_use_masks' => 'use_masks', 'default_masks_cat_id' => 'masks_cat_id', 'default_mask_location' => 'mask_location', 'default_use_predefined_image' => 'use_predefined_image', 'default_allow_colorpick' => 'allow_colorpick', 'default_text_length' => 'text_length', 'default_allow_text_distortion' => 'allow_text_distortion', 'default_allow_predefined_colors' => 'allow_predefined_colors', 'default_color_set_id' => 'color_set_id', 'default_def_img_behind_text' => 'def_img_behind_text', 'default_def_img_behind_image' => 'def_img_behind_image', 'default_def_img_behind_clip' => 'def_img_behind_clip', 'default_allow_save_graphics' => 'allow_save_graphics'))->joinLeft(array('store_option_aitimage' => $this->getTable('catalog/product_option_aitimage')), '`store_option_aitimage`.option_id=`main_table`.option_id AND ' . $this->getConnection()->quoteInto('`store_option_aitimage`.store_id=?', $store_id), array('store_image_template_id' => 'image_template_id', 'store_area_size_x' => 'area_size_x', 'store_area_size_y' => 'area_size_y', 'store_area_offset_x' => 'area_offset_x', 'store_area_offset_y' => 'area_offset_y', 'store_use_text' => 'use_text', 'store_use_user_image' => 'use_user_image', 'store_predefined_cats' => 'predefined_cats', 'store_use_masks' => 'use_masks', 'store_masks_cat_id' => 'masks_cat_id', 'store_mask_location' => 'mask_location', 'store_use_predefined_image' => 'use_predefined_image', 'store_allow_colorpick' => 'allow_colorpick', 'store_text_length' => 'text_length', 'store_allow_text_distortion' => 'allow_text_distortion', 'store_allow_predefined_colors' => 'allow_predefined_colors', 'store_color_set_id' => 'color_set_id', 'store_def_img_behind_text' => 'def_img_behind_text', 'store_def_img_behind_image' => 'def_img_behind_image', 'store_def_img_behind_clip' => 'def_img_behind_clip', 'store_allow_save_graphics' => 'allow_save_graphics', 'image_template_id' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.image_template_id,`default_option_aitimage`.image_template_id)'), 'area_size_x' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.area_size_x,`default_option_aitimage`.area_size_x)'), 'area_size_y' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.area_size_y,`default_option_aitimage`.area_size_y)'), 'area_offset_x' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.area_offset_x,`default_option_aitimage`.area_offset_x)'), 'area_offset_y' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.area_offset_y,`default_option_aitimage`.area_offset_y)'), 'use_text' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.use_text,`default_option_aitimage`.use_text)'), 'use_user_image' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.use_user_image,`default_option_aitimage`.use_user_image)'), 'use_predefined_image' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.use_predefined_image,`default_option_aitimage`.use_predefined_image)'), 'use_masks' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.use_masks,`default_option_aitimage`.use_masks)'), 'masks_cat_id' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.masks_cat_id,`default_option_aitimage`.masks_cat_id)'), 'mask_location' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.mask_location,`default_option_aitimage`.mask_location)'), 'predefined_cats' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.predefined_cats,`default_option_aitimage`.predefined_cats)'), 'allow_colorpick' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.allow_colorpick,`default_option_aitimage`.allow_colorpick)'), 'text_length' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.text_length,`default_option_aitimage`.text_length)'), 'allow_text_distortion' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.allow_text_distortion,`default_option_aitimage`.allow_text_distortion)'), 'allow_predefined_colors' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.allow_predefined_colors,`default_option_aitimage`.allow_predefined_colors)'), 'color_set_id' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.color_set_id,`default_option_aitimage`.color_set_id)'), 'def_img_behind_text' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.def_img_behind_text,`default_option_aitimage`.def_img_behind_text)'), 'def_img_behind_image' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.def_img_behind_image,`default_option_aitimage`.def_img_behind_image)'), 'def_img_behind_clip' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.def_img_behind_clip,`default_option_aitimage`.def_img_behind_clip)'), 'allow_save_graphics' => new Zend_Db_Expr('IFNULL(`store_option_aitimage`.allow_save_graphics,`default_option_aitimage`.allow_save_graphics)')));
     return $this;
 }