Example #1
0
 public function testApplyCustomDesign()
 {
     $this->_model->applyCustomDesign('package/theme/skin');
     $this->assertEquals('package', Mage::getDesign()->getPackageName());
     $this->assertEquals('theme', Mage::getDesign()->getTheme());
     $this->assertEquals('skin', Mage::getDesign()->getSkin());
 }
Example #2
0
 protected function _extractSettings($object)
 {
     $landingpage = Mage::registry('current_landingpage');
     if (!is_null($landingpage)) {
         $layout_update = $landingpage->getCustomLayoutUpdate();
         $layout_template = $landingpage->getCustomLayoutTemplate();
         $layout_laynav = (int) $landingpage->getDisplayLayeredNavigation();
         // object is present, not a product page and  landingspage has design updates
         if ($object && !Mage::registry('current_product') && (!empty($layout_update) || !empty($layout_template) || $layout_laynav == 0)) {
             // overwrite the category layout dates
             $object->setCustomDesignDate(array('from' => null, 'to' => null));
             // add XML layout update
             $category_design = $object->getCustomLayoutUpdate();
             // categories custom layout
             $category_design .= PHP_EOL . $layout_update;
             // landingpage's custom layout
             // remove the layered navigation block if required
             if ($layout_laynav == 0) {
                 $category_design .= PHP_EOL . "<remove name=\"catalog.leftnav\"/>";
             }
             // set all layout updates
             $object->setCustomLayoutUpdate($category_design);
             // set template if overwritten
             if (!empty($layout_template)) {
                 $object->setPageLayout($layout_template);
                 Mage::app()->getLayout()->getUpdate()->addHandle('page_' . $layout_template);
             }
         }
     }
     return parent::_extractSettings($object);
     // process design in parent as usual
 }
Example #3
0
 /**
  * Apply package and theme
  *
  * @param string $package
  * @param string $theme
  *
  * @return $this
  */
 protected function _apply($package, $theme)
 {
     if (Mage::helper('awmobile')->getTargetPlatform() != AW_Mobile_Model_Observer::TARGET_MOBILE) {
         parent::_apply($package, $theme);
         return $this;
     }
     return $this;
 }
Example #4
0
 /**
  * @dataProvider getThemeModel
  */
 public function testApplyCustomDesign($theme)
 {
     $this->_model->applyCustomDesign($theme);
     $this->assertEquals('package', Mage::getDesign()->getDesignTheme()->getPackageCode());
     $this->assertEquals('theme', Mage::getDesign()->getDesignTheme()->getThemeCode());
 }