From c98a8a6cd75614d770c5efb8e3f3429257503dfb Mon Sep 17 00:00:00 2001 From: Jordan Morin Date: Thu, 7 Dec 2017 08:57:31 +0100 Subject: [PATCH] fix : wowow logo et ajout module install fasony --- app/code/Ves/Fasony/.DS_Store | Bin 0 -> 6148 bytes app/code/Ves/Fasony/Setup/InstallSchema.php | 537 ++++++++++++++++++ app/code/Ves/Fasony/etc/module.xml | 26 + app/code/Ves/Fasony/registration.php | 26 + .../Debug/Console/Command/LogoCommand.php | 4 +- 5 files changed, 592 insertions(+), 1 deletion(-) create mode 100644 app/code/Ves/Fasony/.DS_Store create mode 100755 app/code/Ves/Fasony/Setup/InstallSchema.php create mode 100755 app/code/Ves/Fasony/etc/module.xml create mode 100755 app/code/Ves/Fasony/registration.php diff --git a/app/code/Ves/Fasony/.DS_Store b/app/code/Ves/Fasony/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c00bbaa453f3444aa2519b32a6c49549de2c565d GIT binary patch literal 6148 zcmeHK%}T^D5T3ECEO^P6FqFBT)q9^1OtWod>)RhJ!%M!K@Jp9eYow8ed925`xiyb>f2;8_-#q5I zbsqPi&d~(}!9Xw&3uba4gMnZm82Dm9?uUdXSUOIIdUc@F5&*b@S_NZ$ z>jIM~fTiPP2n~eI6=<&PB?g;2^vTzij+3Fe6MON&9{IC)VU3RclP)JN4WkbRf`K^$ zg-th-|M&Q17K{A3OU#0SVBnuIz^kgRb~u#h*0bYDu1#nMG!a=h$pC_}redI`Voc;7 fxlyCplZ;_69VbKCMfB_logger = $logger; + } + + /** + * Installs DB schema for a module + * + * @param SchemaSetupInterface $setup + * @param ModuleContextInterface $context + * @return void + */ + public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) + { + $installer = $setup; + $installer->startSetup(); + + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $homepage = $objectManager->create('\Magento\Cms\Model\Page'); + if(!$homepage->getCollection()->addFieldToFilter('identifier','home-fasony')->getFirstItem()->getId()){ + $homepage->setIdentifier('home-fasony'); + $homepage->setTitle('Home Page Fasony'); + $homepage->setPageLayout('1column'); + $homepage->setCreationTime(date('Y-m-d H:i:s')); + $homepage->setUpdateTime(date('Y-m-d H:i:s')); + $homepage->setSortOrder('0'); + $homepage->setStores(array(0)); + $layoutUpdateXml = ' + + + fasony-slideshow-banner + + + + + + + fasony-showcase-category + + + + + + + fasony-newproducts + + + + + + + fasony-ourservice + + + + + + + fasony-testimonial + + + + + + + fasony-ourbrands + + + '; + + $homepage->setLayoutUpdateXml($layoutUpdateXml); + $homepage->setIsActive(true); + try{ + $homepage->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + + $slideshow = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$slideshow->getCollection()->addFieldToFilter('identifier','fasony-slideshow-banner')->getFirstItem()->getId()){ + $slideshow->setIdentifier('fasony-slideshow-banner'); + $slideshow->setTitle('Fasony - Slideshow - Banner'); + $slideshow->setContent(' +
 
+ '); + + $slideshow->setCreationTime(date('Y-m-d H:i:s')); + $slideshow->setUpdateTime(date('Y-m-d H:i:s')); + $slideshow->setIsActive(true); + $slideshow->setStores(array(0)); + try{ + $slideshow->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + $showcaseCategory = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$showcaseCategory->getCollection()->addFieldToFilter('identifier','fasony-showcase-category')->getFirstItem()->getId()){ + $showcaseCategory->setIdentifier('fasony-showcase-category'); + $showcaseCategory->setTitle('Fasony - Showcase - Category'); + $showcaseCategory->setContent('
+
+
+
+

Women

+

it on you how you want to live you life. Everyone has a choise.

+ view more
+
+
+
+
+
+

Women Fashion

+

it on you how you want to live you life. Everyone has a choise.

+ view more
+
+
+
+
+
+

Women Clothes

+

it on you how you want to live you life. Everyone has a choise.

+ view more
+
+
+
+
+
+
+
+

Men Clothing

+

it on you how you want to live you life. Everyone has a choise.

+ view more
+
+
+
+
+
+

Men Fashion

+

it on you how you want to live you life. Everyone has a choise.

+ view more
+
+
+
+
+
+

Accessories

+

it on you how you want to live you life. Everyone has a choise.

+ view more
+
+
+
'); + $showcaseCategory->setCreationTime(date('Y-m-d H:i:s')); + $showcaseCategory->setUpdateTime(date('Y-m-d H:i:s')); + $showcaseCategory->setIsActive(true); + $showcaseCategory->setStores(array(0)); + try{ + $showcaseCategory->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + $newProduct = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$newProduct->getCollection()->addFieldToFilter('identifier','fasony-newproducts')->getFirstItem()->getId()){ + $newProduct->setIdentifier('fasony-newproducts'); + $newProduct->setTitle('Fasony - NewProducts'); + $newProduct->setContent('

{{widget type="Magento\Catalog\Block\Product\Widget\NewWidget" display_type="all_products" products_count="8" template="product/widget/new/content/new_grid.phtml"}}

'); + $newProduct->setCreationTime(date('Y-m-d H:i:s')); + $newProduct->setUpdateTime(date('Y-m-d H:i:s')); + $newProduct->setIsActive(true); + $newProduct->setStores(array(0)); + try{ + $newProduct->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + $ourService = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$ourService->getCollection()->addFieldToFilter('identifier','fasony-ourservice')->getFirstItem()->getId()){ + $ourService->setIdentifier('fasony-ourservice'); + $ourService->setTitle('Fasony - Ourservice'); + $ourService->setContent('
+
+
+

Money Back Guarantee!

+

we free 30 days 100% money back & return

+
+
+
+
+

Free shipping world wide

+

Free shipping on all order over $99.00

+
+
+
+
+

Online support 24/7

+

we are here to make your day. Lets talk!

+
+
+
'); + $ourService->setCreationTime(date('Y-m-d H:i:s')); + $ourService->setUpdateTime(date('Y-m-d H:i:s')); + $ourService->setIsActive(true); + $ourService->setStores(array(0)); + try{ + $ourService->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + $testimonial = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$testimonial->getCollection()->addFieldToFilter('identifier','fasony-testimonial')->getFirstItem()->getId()){ + $testimonial->setIdentifier('fasony-testimonial'); + $testimonial->setTitle('Fasony - Testimonial'); + $testimonial->setContent('
+
+
Testimonial
+ +
 
+ +
+
'); + $testimonial->setCreationTime(date('Y-m-d H:i:s')); + $testimonial->setUpdateTime(date('Y-m-d H:i:s')); + $testimonial->setIsActive(true); + $testimonial->setStores(array(0)); + try{ + $testimonial->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + $ourBrands = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$ourBrands->getCollection()->addFieldToFilter('identifier','fasony-ourbrands')->getFirstItem()->getId()){ + $ourBrands->setIdentifier('fasony-ourbrands'); + $ourBrands->setTitle('Fasony - OurBrands'); + $ourBrands->setContent('
+ +
 
+ +
'); + $ourBrands->setCreationTime(date('Y-m-d H:i:s')); + $ourBrands->setUpdateTime(date('Y-m-d H:i:s')); + $ourBrands->setIsActive(true); + $ourBrands->setStores(array(0)); + try{ + $ourBrands->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + $footer = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$footer->getCollection()->addFieldToFilter('identifier','fasony-footer')->getFirstItem()->getId()){ + $footer->setIdentifier('fasony-footer'); + $footer->setTitle('Fasony - Footer'); + $footer->setContent(''); + $footer->setCreationTime(date('Y-m-d H:i:s')); + $footer->setUpdateTime(date('Y-m-d H:i:s')); + $footer->setIsActive(true); + $footer->setStores(array(0)); + try{ + $footer->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + + $menuTop = $objectManager->create('\Magento\Cms\Model\Block'); + if(!$menuTop->getCollection()->addFieldToFilter('identifier','fasony-menutop')->getFirstItem()->getId()){ + $menuTop->setIdentifier('fasony-menutop'); + $menuTop->setTitle('Fasony - MenuTop'); + $menuTop->setContent(''); + $menuTop->setCreationTime(date('Y-m-d H:i:s')); + $menuTop->setUpdateTime(date('Y-m-d H:i:s')); + $menuTop->setIsActive(true); + $menuTop->setStores(array(0)); + try{ + $menuTop->save(); + }catch(Exception $e){ + $this->_logger->debug($e->getMessage()); + } + } + $resourceConfig = $objectManager->create('\Magento\Config\Model\ResourceModel\Config'); + $resourceConfig->saveConfig('web/default/cms_home_page','home-fasony','default',0); + + + + } + + + +} \ No newline at end of file diff --git a/app/code/Ves/Fasony/etc/module.xml b/app/code/Ves/Fasony/etc/module.xml new file mode 100755 index 0000000..49324a0 --- /dev/null +++ b/app/code/Ves/Fasony/etc/module.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/app/code/Ves/Fasony/registration.php b/app/code/Ves/Fasony/registration.php new file mode 100755 index 0000000..1dfec67 --- /dev/null +++ b/app/code/Ves/Fasony/registration.php @@ -0,0 +1,26 @@ +_directoryList->getPath('media').'/logo/'; if(!is_dir($logoFolder)) mkdir($logoFolder,0775); - $logoEmail = $this->_directoryList->getPath('media').'/email/logo/'; + $folderEmail = $this->_directoryList->getPath('media').'/email/'; + $logoEmail = $folderEmail.'logo/'; + if(!is_dir($folderEmail)) mkdir($folderEmail,0775); if(!is_dir($logoEmail)) mkdir($logoEmail,0775); $arrayLogo = array(); foreach ($finder as $file) {