betam / m2-item-module-sample
Sample of extension for Base Item module
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php: ^7.4
- betam/m2-item-module: ~1.1.4
README
It is base extension module for betam/m2-item-module
How to install:
composer require betam/m2-item-module-sample
bin/magento setup:upgrade
bin/magento setup:di:compile
how to clone
- Sample of sh script
#!/bin/bash
if [ -n "$1" ]; then echo Hello, work with Vendor Space "$1". VENDOR=$1 else echo "No parameters found. Use clone_item_sample_module.sh VendorSpace ModuleName, e.g. BTM Balabol" exit fi
if [ -n "$2" ]; then echo 'Module name: '"$2"'.' MODULE=$2 else echo "No parameters found. Use clone_item_sample_module.sh VendorSpace ModuleName, e.g. BTM Balabol" exit fi
MYBASEPWD=${PWD} SOURCE_DIR=$MYBASEPWD"/vendor/betam/m2-item-module-sample/lib" MODULE_DIR=$MYBASEPWD"/app/code/${VENDOR}/Item${MODULE}" VENDOR_DIR=$MYBASEPWD"/app/code/${VENDOR}" VENDOR_LOWER=${VENDOR,,} MODULE_LOWER=${MODULE,,}
echo "Upper/Lowercase is ${VENDOR}/${VENDOR_LOWER}; ${MODULE}/${MODULE_LOWER}"
if [ ! -d "$SOURCE_DIR" ]; then echo Directory "$SOURCE_DIR" not exits exit fi
if [ ! -d "$VENDOR_DIR" ]; then echo Directory "$VENDOR_DIR" not exits exit fi
if [ -d "$MODULE_DIR" ]; then echo Directory "$MODULE_DIR" allready exits exit fi
cp -r "$SOURCE_DIR" "$MODULE_DIR" echo "New module dir ${MODULE_DIR}" find "${MODULE_DIR}" ( -type d -name .git -prune ) -o -type f -print0 | xargs -0 sed -i 's/Betam\\ItemSample/'"${VENDOR}"'\\Item'"${MODULE}"'/' find "${MODULE_DIR}" ( -type d -name .git -prune ) -o -type f -print0 | xargs -0 sed -i 's/Betam_ItemSample/'"${VENDOR}"'_Item'"${MODULE}"'/' find "${MODULE_DIR}" ( -type d -name .git -prune ) -o -type f -print0 | xargs -0 sed -i 's/item_sample_betamentity/item'"${VENDORLOWER}"''"${MODULE_LOWER}"'_entity/' find "${MODULE_DIR}" ( -type d -name .git -prune ) -o -type f -print0 | xargs -0 sed -i 's/\/V1\/item\/sample/\/V1\/item\/'"${VENDOR_LOWER}"'\/'"${MODULE_LOWER}"'/'
Install module, place this script on one level with vendor-folder and run
clone_item_sample_module.sh YourVendorName YourModuleName