Jump to content
Bicrypto v4.6.0 + All Plugins

eShop- eCommerce Single Vendor App | Shopping eCommerce App with Flutter v4.0.2

Posted
  • Administrators
comment_45018

07 eShop Single-Vendor App.jpg 

 Change Log: – 1 March 2023
– Version: 4.0.2
+ [Added] URL type in slider Home screen
+ [Added] URL type in Notification
+ [Added] Promo code for specific user
+ [Update] Updated Latest flutter version
+ [Fix] Improvements & bug fixes

Demohttps://codecanyon.net/item/eshop-flutter-ecommerce-full-app/29880351

Download

This is the hidden content, please

Support is available for paid files only
Support for free files is offered for a fee only

Featured Replies

  • 5 months later...
  • 4 months later...
  • 7 months later...
  • 1 month later...
comment_86132
13 hours ago, Foxizworld said:

@izabela lacerda bafini i need help need purchase code

Yo, sup bro.
Well, just find in files “purchase_code” and make all it local validation!

i’m struggling with the app, still saying that’s inactivated, but i’m making progress!

If u don’t know how to program and how to make it local validation bypassing, i can help u with more info.

but it’s no secret, it shoul be like this on CoreComponentRepository:

/vendor/mehedi-iitdu/core-component-repository/src

<?php

namespace MehediIitdu\CoreComponentRepository;

use App\Models\Addon;
use Cache;

class CoreComponentRepository
{
    // Predefined valid system key
    protected static $validSystemKey = '91X36x28-xxx5-4X70-x109-x9wc8xxc6X10';

    public static function instantiateShopRepository()
    {
        if (self::validateSystemKey()) {
            // Valid system key, proceed normally
            return;
        } else {
            // Invalid system key, finalize repository with 'bad' response
            self::finalizeRepository('bad');
        }
    }

    protected static function validateSystemKey()
    {
        // Fetch the system key from the environment
        $systemKey = env('SYSTEM_KEY');
        return $systemKey === self::$validSystemKey;
    }

    protected static function serializeObjectResponse($zn, $request_data_json)
    {
        // Bypass external request and return 'good' for valid key
        return self::validateSystemKey() ? 'good' : 'bad';
    }

    protected static function finalizeRepository($rn)
    {
        if ($rn == "bad" && env('DEMO_MODE') != 'On') {
            abort(403, 'Invalid system key. Please provide a valid key.');
        }
    }

    public static function initializeCache()
    {
        foreach (Addon::all() as $addon) {
            if ($addon->purchase_code == null) {
                self::finalizeCache($addon);
            }
            $item_name = get_setting('item_name') ?? 'ecommerce';

            if (Cache::get($addon->unique_identifier . '-purchased', 'no') == 'no') {
                if (self::validateSystemKey()) {
                    Cache::rememberForever($addon->unique_identifier . '-purchased', function () {
                        return 'yes';
                    });
                } else {
                    self::finalizeCache($addon);
                }
            }
        }
    }

    public static function finalizeCache($addon)
    {
        $addon->activated = 0;
        $addon->save();

        flash('Please reinstall ' . $addon->name . ' using a valid purchase code')->warning();
        return redirect()->route('addons.index')->send();
    }
}
comment_86160

@Foxizworld,What u needing?
Let me show you what to do:

coverImage Correction on api endpoint:

App\Http\Resources\V2\CategoryCollection.php


<?php

namespace App\Http\Resources\V2;

use Illuminate\Http\Resources\Json\ResourceCollection;
use App\Utility\CategoryUtility;

class CategoryCollection extends ResourceCollection
{
    public function toArray($request)
    {
        return [
            'data' => $this->collection->map(function ($data) {
                $banner = '';
                if (uploaded_asset($data->banner)) {
                    $banner = uploaded_asset($data->banner);
                }
                $icon = '';
                if (uploaded_asset(uploaded_asset($data->icon))) {
                    $icon = uploaded_asset($data->icon);
                }
                 // Novo código para adicionar cover_image
                $coverImage = '';
                if (uploaded_asset($data->cover_image)) {
                    $coverImage = uploaded_asset($data->cover_image);
                }
                return [
                    'id' => $data->id,
                    'slug' => $data->slug,
                    'name' => $data->getTranslation('name'),
                    'banner' => $banner,
                    'icon' => $icon,
                    'cover_image' => $coverImage, // Adicionando cover_image à resposta
                    'number_of_children' => CategoryUtility::get_immediate_children_count($data->id),
                    'links' => [
                        'products' => route('api.products.category', $data->id),
                        'sub_categories' => route('subCategories.index', $data->id)
                    ]
                ];
            })
        ];
    }

    public function with($request)
    {
        return [
            'success' => true,
            'status' => 200
        ];
    }
}

It ensures coverImage has been get on the server and passed to response.

Now we need to bypass the purchase code:
You need to open the entire folder of your source project, and Ctrl+Shift+F to search in all files and folders.
Then you type: itzone
image.png

so after this, you came to the controllers and utility codes.
searching for things like this:

this one is at CompareController.php, in the businessSettings it’s just for downloading demos, we won’t use it.

    public function details($unique_identifier)
    {
        $data['url'] = $_SERVER['SERVER_NAME'];
        $data['unique_identifier'] = $unique_identifier;
        $data['main_item'] = get_setting('item_name') ?? 'eCommerce';
        $request_data_json = json_encode($data);

        $gate = "https://activation.activeitzone.com/check_addon_activation";

        $header = array(
            'Content-Type:application/json'
        );

        $stream = curl_init();

        curl_setopt($stream, CURLOPT_URL, $gate);
        curl_setopt($stream, CURLOPT_HTTPHEADER, $header);
        curl_setopt($stream, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($stream, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($stream, CURLOPT_POSTFIELDS, $request_data_json);
        curl_setopt($stream, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($stream, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

        $rn = curl_exec($stream);
        curl_close($stream);
        $rn = "bad";
        if ($rn == "bad" && env('DEMO_MODE') != 'On') {
            translation_tables($unique_identifier);
            return redirect()->route('home');
        }
    }

after u will change it for something like:

    public function details($unique_identifier)
    {
        // Local validation logic
        $data['url'] = $_SERVER['SERVER_NAME'];
        $data['unique_identifier'] = $unique_identifier;
        $data['main_item'] = get_setting('item_name') ?? 'eCommerce';
    
        // Simulated response for local validation
        $rn = "good"; // Change to "good" to simulate a successful activation
    
        // If the validation fails, redirect to home (for local testing, set $rn to "good")
        if ($rn == "bad" && env('DEMO_MODE') != 'On') {
            translation_tables($unique_identifier);
            return redirect()->route('home');
        }
    
        // Optional: Add any logic you need for successful activation here
    }

then do it for every single archive containing a curl validation.

another detail, to validation purchase code on instalation i’ve done it like this:

at this archive image.png

you’ll change all to :

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use URL;
use DB;
use Hash;
use App\Models\BusinessSetting;
use App\Models\User;
use MehediIitdu\CoreComponentRepository\CoreComponentRepository;
use Artisan;
use Session;

class InstallController extends Controller
{
    public function step0() {
        $this->writeEnvironmentFile('APP_URL', URL::to('/'));
        return view('installation.step0');
    }

    public function step1() {
        $permission['curl_enabled']           = function_exists('curl_version');
        $permission['db_file_write_perm']     = is_writable(base_path('.env'));
        $permission['routes_file_write_perm'] = is_writable(base_path('app/Providers/RouteServiceProvider.php'));
        return view('installation.step1', compact('permission'));
    }

    public function step2() {
        return view('installation.step2');
    }

    public function step3($error = "") {
        CoreComponentRepository::instantiateShopRepository();
        if($error == ""){
            return view('installation.step3');
        }else {
            return view('installation.step3', compact('error'));
        }
    }

    public function step4() {
        return view('installation.step4');
    }

    public function step5() {
        return view('installation.step5');
    }

    public function purchase_code(Request $request) {
        if (\App\Utility\CategoryUtility::create_initial_category($request->purchase_code) == false) {
            flash("Sorry! The purchase code you have provided is not valid.")->error();
            return back();
        }
        if ($request->system_key == null) {
            flash("Sorry! The System Key required")->error();
            return back();
        }
        Session::put('purchase_code', $request->purchase_code);
        $this->writeEnvironmentFile('SYSTEM_KEY', $request->system_key);
        return redirect('step3');
    }

    public function system_settings(Request $request) {
        $businessSetting = BusinessSetting::where('type', 'system_default_currency')->first();
        $businessSetting->value = $request->system_default_currency;
        $businessSetting->save();

        $businessSetting = BusinessSetting::where('type', 'home_default_currency')->first();
        $businessSetting->value = $request->system_default_currency;
        $businessSetting->save();

        $this->writeEnvironmentFile('APP_NAME', $request->system_name);
        Artisan::call('key:generate');

        $user = new User;
        $user->name      = $request->admin_name;
        $user->email     = $request->admin_email;
        $user->password  = Hash::make($request->admin_password);
        $user->user_type = 'admin';
        $user->email_verified_at = date('Y-m-d H:m:s');
        $user->save();

        //Assign Super-Admin Role
        $user->assignRole(['Super Admin']);

        $previousRouteServiceProvier = base_path('app/Providers/RouteServiceProvider.php');
        $newRouteServiceProvier      = base_path('app/Providers/RouteServiceProvider.txt');
        copy($newRouteServiceProvier, $previousRouteServiceProvier);
        //sleep(5);

        if (Session::has('purchase_code')) {
            $business_settings = new BusinessSetting;
            $business_settings->type = 'purchase_code';
            $business_settings->value = Session::get('purchase_code');
            $business_settings->save();
            Session::forget('purchase_code');
        }
        return view('installation.step6');
    }
    public function database_installation(Request $request) {

        if(self::check_database_connection($request->DB_HOST, $request->DB_DATABASE, $request->DB_USERNAME, $request->DB_PASSWORD)) {
            $path = base_path('.env');
            if (file_exists($path)) {
                foreach ($request->types as $type) {
                    $this->writeEnvironmentFile($type, $request[$type]);
                }
                return redirect('step4');
            }else {
                return redirect('step3');
            }
        }else {
            return redirect('step3/database_error');
        }
    }

    public function import_sql() {
        $sql_path = base_path('shop.sql');
        DB::unprepared(file_get_contents($sql_path));
        return redirect('step5');
    }

    function check_database_connection($db_host = "", $db_name = "", $db_user = "", $db_pass = "") {

        if(@mysqli_connect($db_host, $db_user, $db_pass, $db_name)) {
            return true;
        }else {
            return false;
        }
    }

    public function writeEnvironmentFile($type, $val) {
        $path = base_path('.env');
        if (file_exists($path)) {
            $val = '"'.trim($val).'"';
            if(is_numeric(strpos(file_get_contents($path), $type)) && strpos(file_get_contents($path), $type) >= 0){
                file_put_contents($path, str_replace(
                    $type.'="'.env($type).'"', $type.'='.$val, file_get_contents($path)
                ));
            }
            else{
                file_put_contents($path, file_get_contents($path)."\r\n".$type.'='.$val);
            }
        }
    }
}

then you will go to your .env file and put something like this:

SYSTEM_KEY="91X36x28-xxx5-4X70-x109-x9wc8xxc6X10"

then you will go to

Vendor\mehedi-iitdu\core-component-repository\src\CoreComponentRepository.php

and change everything inside this file to:

<?php

namespace MehediIitdu\CoreComponentRepository;

use App\Models\Addon;
use Cache;

class CoreComponentRepository
{
    // Predefined valid system key
    protected static $validSystemKey = '91X36x28-xxx5-4X70-x109-x9wc8xxc6X10';

    public static function instantiateShopRepository()
    {
        if (self::validateSystemKey()) {
            // Valid system key, proceed normally
            return;
        } else {
            // Invalid system key, finalize repository with 'bad' response
            self::finalizeRepository('bad');
        }
    }

    protected static function validateSystemKey()
    {
        // Fetch the system key from the environment
        $systemKey = env('SYSTEM_KEY');
        return $systemKey === self::$validSystemKey;
    }

    protected static function serializeObjectResponse($zn, $request_data_json)
    {
        // Bypass external request and return 'good' for valid key
        return self::validateSystemKey() ? 'good' : 'bad';
    }

    protected static function finalizeRepository($rn)
    {
        if ($rn == "bad" && env('DEMO_MODE') != 'On') {
            abort(403, 'Invalid system key. Please provide a valid key.');
        }
    }

    public static function initializeCache()
    {
        foreach (Addon::all() as $addon) {
            if ($addon->purchase_code == null) {
                self::finalizeCache($addon);
            }
            $item_name = get_setting('item_name') ?? 'ecommerce';

            if (Cache::get($addon->unique_identifier . '-purchased', 'no') == 'no') {
                if (self::validateSystemKey()) {
                    Cache::rememberForever($addon->unique_identifier . '-purchased', function () {
                        return 'yes';
                    });
                } else {
                    self::finalizeCache($addon);
                }
            }
        }
    }

    public static function finalizeCache($addon)
    {
        $addon->activated = 0;
        $addon->save();

        flash('Please reinstall ' . $addon->name . ' using a valid purchase code')->warning();
        return redirect()->route('addons.index')->send();
    }
}

when proceeding the installations steps, if you’re done it right when u put the same SYSTEMS_KEY serials on both places and try to go to step 3 it will show and error of invalid purchase code, but in the URL you’ll force it to go to step3 changing the url step2 to step3, and it’ll go well all the final install.

if in need of anything more i can help u more specifically if u send me and DM!

comment_86161
5 minutes ago, Izabela Lacerda Bafini said:

@Foxizworld,What u needing?
Let me show you what to do:

coverImage Correction on api endpoint:

App\Http\Resources\V2\CategoryCollection.php


<?php

namespace App\Http\Resources\V2;

use Illuminate\Http\Resources\Json\ResourceCollection;
use App\Utility\CategoryUtility;

class CategoryCollection extends ResourceCollection{
    public function toArray($request)
    {
        return [
            'data' => $this->collection->map(function ($data) {
                $banner = '';
                if (uploaded_asset($data->banner)) {
                    $banner = uploaded_asset($data->banner);
                }
                $icon = '';
                if (uploaded_asset(uploaded_asset($data->icon))) {
                    $icon = uploaded_asset($data->icon);
                }
                 // Novo código para adicionar cover_image
                $coverImage = '';
                if (uploaded_asset($data->cover_image)) {
                    $coverImage = uploaded_asset($data->cover_image);
                }
                return [
                    'id' => $data->id,
                    'slug' => $data->slug,
                    'name' => $data->getTranslation('name'),
                    'banner' => $banner,
                    'icon' => $icon,
                    'cover_image' => $coverImage, // Adicionando cover_image à resposta
                    'number_of_children' => CategoryUtility::get_immediate_children_count($data->id),
                    'links' => [
                        'products' => route('api.products.category', $data->id),
                        'sub_categories' => route('subCategories.index', $data->id)
                    ]
                ];
            })
        ];
    }

    public function with($request)
    {
        return [
            'success' => true,
            'status' => 200
        ];
    }
}

It ensures coverImage has been get on the server and passed to response.

Now we need to bypass the purchase code:
You need to open the entire folder of your source project, and Ctrl+Shift+F to search in all files and folders.
Then you type: itzone
image.png

so after this, you came to the controllers and utility codes.
searching for things like this:

this one is at CompareController.php, in the businessSettings it’s just for downloading demos, we won’t use it.

    public function details($unique_identifier)
    {
        $data['url'] = $_SERVER['SERVER_NAME'];
        $data['unique_identifier'] = $unique_identifier;
        $data['main_item'] = get_setting('item_name') ?? 'eCommerce';
        $request_data_json = json_encode($data);

        $gate = "https://activation.activeitzone.com/check_addon_activation";

        $header = array(
            'Content-Type:application/json'
        );

        $stream = curl_init();

        curl_setopt($stream, CURLOPT_URL, $gate);
        curl_setopt($stream, CURLOPT_HTTPHEADER, $header);
        curl_setopt($stream, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($stream, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($stream, CURLOPT_POSTFIELDS, $request_data_json);
        curl_setopt($stream, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($stream, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

        $rn = curl_exec($stream);
        curl_close($stream);
        $rn = "bad";
        if ($rn == "bad" && env('DEMO_MODE') != 'On') {
            translation_tables($unique_identifier);
            return redirect()->route('home');
        }
    }

after u will change it for something like:

    public function details($unique_identifier)
    {
        // Local validation logic
        $data['url'] = $_SERVER['SERVER_NAME'];
        $data['unique_identifier'] = $unique_identifier;
        $data['main_item'] = get_setting('item_name') ?? 'eCommerce';
    
        // Simulated response for local validation
        $rn = "good"; // Change to "good" to simulate a successful activation
    
        // If the validation fails, redirect to home (for local testing, set $rn to "good")
        if ($rn == "bad" && env('DEMO_MODE') != 'On') {
            translation_tables($unique_identifier);
            return redirect()->route('home');
        }
    
        // Optional: Add any logic you need for successful activation here
    }

then do it for every single archive containing a curl validation.

another detail, to validation purchase code on instalation i’ve done it like this:

at this archive image.png

you’ll change all to :

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use URL;
use DB;
use Hash;
use App\Models\BusinessSetting;
use App\Models\User;
use MehediIitdu\CoreComponentRepository\CoreComponentRepository;
use Artisan;
use Session;

class InstallController extends Controller{
    public function step0() {
        $this->writeEnvironmentFile('APP_URL', URL::to('/'));
        return view('installation.step0');
    }

    public function step1() {
        $permission['curl_enabled']           = function_exists('curl_version');
        $permission['db_file_write_perm']     = is_writable(base_path('.env'));
        $permission['routes_file_write_perm'] = is_writable(base_path('app/Providers/RouteServiceProvider.php'));
        return view('installation.step1', compact('permission'));
    }

    public function step2() {
        return view('installation.step2');
    }

    public function step3($error = "") {
        CoreComponentRepository::instantiateShopRepository();
        if($error == ""){
            return view('installation.step3');
        }else {
            return view('installation.step3', compact('error'));
        }
    }

    public function step4() {
        return view('installation.step4');
    }

    public function step5() {
        return view('installation.step5');
    }

    public function purchase_code(Request $request) {
        if (\App\Utility\CategoryUtility::create_initial_category($request->purchase_code) == false) {
            flash("Sorry! The purchase code you have provided is not valid.")->error();
            return back();
        }
        if ($request->system_key == null) {
            flash("Sorry! The System Key required")->error();
            return back();
        }
        Session::put('purchase_code', $request->purchase_code);
        $this->writeEnvironmentFile('SYSTEM_KEY', $request->system_key);
        return redirect('step3');
    }

    public function system_settings(Request $request) {
        $businessSetting = BusinessSetting::where('type', 'system_default_currency')->first();
        $businessSetting->value = $request->system_default_currency;
        $businessSetting->save();

        $businessSetting = BusinessSetting::where('type', 'home_default_currency')->first();
        $businessSetting->value = $request->system_default_currency;
        $businessSetting->save();

        $this->writeEnvironmentFile('APP_NAME', $request->system_name);
        Artisan::call('key:generate');

        $user = new User;
        $user->name      = $request->admin_name;
        $user->email     = $request->admin_email;
        $user->password  = Hash::make($request->admin_password);
        $user->user_type = 'admin';
        $user->email_verified_at = date('Y-m-d H:m:s');
        $user->save();

        //Assign Super-Admin Role
        $user->assignRole(['Super Admin']);

        $previousRouteServiceProvier = base_path('app/Providers/RouteServiceProvider.php');
        $newRouteServiceProvier      = base_path('app/Providers/RouteServiceProvider.txt');
        copy($newRouteServiceProvier, $previousRouteServiceProvier);
        //sleep(5);

        if (Session::has('purchase_code')) {
            $business_settings = new BusinessSetting;
            $business_settings->type = 'purchase_code';
            $business_settings->value = Session::get('purchase_code');
            $business_settings->save();
            Session::forget('purchase_code');
        }
        return view('installation.step6');
    }
    public function database_installation(Request $request) {

        if(self::check_database_connection($request->DB_HOST, $request->DB_DATABASE, $request->DB_USERNAME, $request->DB_PASSWORD)) {
            $path = base_path('.env');
            if (file_exists($path)) {
                foreach ($request->types as $type) {
                    $this->writeEnvironmentFile($type, $request[$type]);
                }
                return redirect('step4');
            }else {
                return redirect('step3');
            }
        }else {
            return redirect('step3/database_error');
        }
    }

    public function import_sql() {
        $sql_path = base_path('shop.sql');
        DB::unprepared(file_get_contents($sql_path));
        return redirect('step5');
    }

    function check_database_connection($db_host = "", $db_name = "", $db_user = "", $db_pass = "") {

        if(@mysqli_connect($db_host, $db_user, $db_pass, $db_name)) {
            return true;
        }else {
            return false;
        }
    }

    public function writeEnvironmentFile($type, $val) {
        $path = base_path('.env');
        if (file_exists($path)) {
            $val = '"'.trim($val).'"';
            if(is_numeric(strpos(file_get_contents($path), $type)) && strpos(file_get_contents($path), $type) >= 0){
                file_put_contents($path, str_replace(
                    $type.'="'.env($type).'"', $type.'='.$val, file_get_contents($path)
                ));
            }
            else{
                file_put_contents($path, file_get_contents($path)."\r\n".$type.'='.$val);
            }
        }
    }
}

then you will go to your .env file and put something like this:

SYSTEM_KEY="91X36x28-xxx5-4X70-x109-x9wc8xxc6X10"

then you will go to

Vendor\mehedi-iitdu\core-component-repository\src\CoreComponentRepository.php

and change everything inside this file to:

<?php

namespace MehediIitdu\CoreComponentRepository;

use App\Models\Addon;
use Cache;

class CoreComponentRepository{
    // Predefined valid system key
    protected static $validSystemKey = '91X36x28-xxx5-4X70-x109-x9wc8xxc6X10';

    public static function instantiateShopRepository()
    {
        if (self::validateSystemKey()) {
            // Valid system key, proceed normally
            return;
        } else {
            // Invalid system key, finalize repository with 'bad' response
            self::finalizeRepository('bad');
        }
    }

    protected static function validateSystemKey()
    {
        // Fetch the system key from the environment
        $systemKey = env('SYSTEM_KEY');
        return $systemKey === self::$validSystemKey;
    }

    protected static function serializeObjectResponse($zn, $request_data_json)
    {
        // Bypass external request and return 'good' for valid key
        return self::validateSystemKey() ? 'good' : 'bad';
    }

    protected static function finalizeRepository($rn)
    {
        if ($rn == "bad" && env('DEMO_MODE') != 'On') {
            abort(403, 'Invalid system key. Please provide a valid key.');
        }
    }

    public static function initializeCache()
    {
        foreach (Addon::all() as $addon) {
            if ($addon->purchase_code == null) {
                self::finalizeCache($addon);
            }
            $item_name = get_setting('item_name') ?? 'ecommerce';

            if (Cache::get($addon->unique_identifier . '-purchased', 'no') == 'no') {
                if (self::validateSystemKey()) {
                    Cache::rememberForever($addon->unique_identifier . '-purchased', function () {
                        return 'yes';
                    });
                } else {
                    self::finalizeCache($addon);
                }
            }
        }
    }

    public static function finalizeCache($addon)
    {
        $addon->activated = 0;
        $addon->save();

        flash('Please reinstall ' . $addon->name . ' using a valid purchase code')->warning();
        return redirect()->route('addons.index')->send();
    }
}

when proceeding the installations steps, if you’re done it right when u put the same SYSTEMS_KEY serials on both places and try to go to step 3 it will show and error of invalid purchase code, but in the URL you’ll force it to go to step3 changing the url step2 to step3, and it’ll go well all the final install.

if in need of anything more i can help u more specifically if u send me and DM!

remember that u need to change every sngle file, even if it’s nonsense

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Latest Updated Files