#!/bin/bash
folder=${PWD##*/}
themes=catalog/view/theme
language=admin/language/en-gb/extension/theme/
view=admin/view/template/extension/theme/
controller=admin/controller/extension/theme/
read -p "Name of new theme (latin): " themename
if [[ -d admin ]]; then
themenameup=`echo $themename | sed 's/./\U&/1'`
cp -r $themes/default $themes/$themename
cp $language/default.php $language/$themename.php
sed -i "s/Default Store Theme/$themenameup theme/g" $language/$themename.php
sed -i "s/default store theme/$themename theme/g" $language/$themename.php
cp $view/default.twig $view/$themename.twig
sed -i "s/theme_default/theme_$themename/g" $view/$themename.twig
cp $controller/default.php $controller/$themename.php
sed -i "s/theme_default/theme_$themename/g" $controller/$themename.php
sed -i "s/theme\/default/theme\/$themename/g" $controller/$themename.php
sed -i "s/ControllerExtensionThemeDefault/ControllerExtensionTheme"$themenameup"/g" $controller/$themename.php
sed -i "s/default/$themename/g" $controller/$themename.php
sed -i "s/default/$themename/g" $themes/$themename/template/common/header.twig
else
echo "Move the script to site's root directory and try again"
fi
Easy clone Opencart v.3 default theme
See in action here - https://yadi.sk/d/nY1pb83dGDthng
Github - https://github.com/vallyol/shell-script/blob/master/opencart_create_theme.sh
See in action here - https://yadi.sk/d/nY1pb83dGDthng
Github - https://github.com/vallyol/shell-script/blob/master/opencart_create_theme.sh
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.