Yii 1.1: yiishop

A simple, but full featured, i18n, extensible Web Shop for easy integration into your Yii Web Application
94 followers

News:

Yii-Shop is alive again! I added a SVN repository at Google Code: http://code.google.com/p/yii-shop/

This extension is a simple, but full featured, internationalized, extensible Web Shop for easy integration into your Yii Web Application...

Features

  • Server-side Shopping cart via Session
  • Customizable Product specifications (weight, color, material, size, ...)
  • Customizable Variations (product t-shirt, variation: red, blue, yellow; small, medium, huge)
  • Tax system (7%, 19%, ...) VAT
  • Customizable shipping methods
  • Customizable payment methods
  • Generate Invoice and Delivery slip automatically with good template, can be customized to fit your company needs
  • 100% Translated to english, german

Resources

Documentation

Requirements

  • Yii 1.1 or above

detailed Documentation

Detailed Documentation is provided with the package unter the docs/ directory. There is also a Mysql Workbench .mwb Schema available.

Installation

To install this module, follow the following steps:

1.) extract the file under the modules/ directory of your Web Application

2.) set up the Module in your protected/config/main.php:

return array(
 [...]
 'modules' => array('shop' => array( 'debug' => 'true')),
 [...]

3.) run /shop/install in your Web Browser

4.) follow the on-screen installation instructions

5.) Create an empty directory containing your Product Images. By Default, this is approot/productimages. Make sure it is writable by your Web Server Process.

6.) After Installation, make sure to remove the 'debug' => 'true' in your Configuration.

7.) Read docs/config.txt for Configuration Options

Usage

Just run http://your_app/index.php?r=shop/products/index for the frontend and http://your_app/index.php?r=shop/products/admin for the backend/Admin interface.

Note that this Module does NOT handle User/Admin authentification. You have to do this by yourself, either by CAuthManager, CDbManager, the yii-user-management or the srbac Module. Instructions on how to integrate this Module with the Yii User Management Module will be available soon, it is already prepared

Change Log

March 15, 2011

0.7rc3 * much new things

February 13, 2010

0.5 * still alive * minor bugfixes

0.4 alpha * Added Installation routine * added german i18n Strings

February 4, 2010

0.1 alpha * Added shopping Cart * Added Ordering & Ordering administration * Added (primitive) Price Calculation

February 1, 2010

  • First development snapshot

Total 20 comments

#18926 report it
viktor_au at 2015/02/05 03:05am
Creating a new variation table, new model, new controller and so on...

Hi Todd Anstis

I want to note that I am the same user of this product as you are. The author of this module is (I can be wrong) a German guy and after he has done this good module he is now (may be) in progress of a making a new project. I was a bit confused at first with the labels: products variations and product specifications. As I understood, the specifications are just a labels. Note: I don't use the variations. I don't need it. But if you do... And If I understood you correctly...


How to add a row to a variation table?

You have to create a new model, new controller, new view files and so on. To be short, you have to use the great tool: gii (http://localhost/shop/gii) or check your direction.

Example:

Welcome to Yii Code Generator!

You may use the following generators to quickly build up your Yii application: Controller Generator Crud Generator Form Generator Model Generator Module Generator Widget Generator


You know how to use it: create a new table with your rows

Example:

Model Generator This generator generates a model class for the specified database table. Fields with * are required. Click on the highlighted fields to edit them. Database Connection * db Table Prefix [empty] Table Name * Model Class * Base Class * CActiveRecord Model Path * application.models


When you enter table name in the Table Name row the rest should be created for you automatically.

By default the GII will place the new model file in the default directory, not under the modules directory.

Then you have to create the other file using the Crud generator.

Example:

Crud Generator

This generator generates a controller and views that implement CRUD operations for the specified data model.

Fields with * are required. Click on the highlighted fields to edit them.

Model Class *

Controller ID *

Base Controller Class * Controller


Create a few variation tables mysql table type innodb only.

Have a good time with your project.

#18924 report it
Todd Anstis at 2015/02/04 04:00pm
Adding a variation?

I've been working with the module and overall its a good start. One question I have is this, however - I'm not clear on how to add a "variation" to a product? So I have the grid/table at the bottom of the Product Update page but I don't see a way to add a variation/row to the list? Am I misunderstanding how this part functions?

#18716 report it
viktor_au at 2014/12/17 12:17am
Ionut2014 questions

Sorry Ionut2014
Can not help you more.
Looks like the yii works.
If you cannot open the shop module, check the configurations and so on... Please read some info on this site. Plenty of help here.

#18715 report it
Ionut2014 at 2014/12/16 07:12pm
resp

Here is a video from my PC https://vid.me/S1rf

#18714 report it
Ionut2014 at 2014/12/16 07:02pm
re

i have wamp not xampp and if i add folder from demo in my www folder, in browser it say hellow world without errors. If you want to add in my htdocs i have to put in my apache folder in my version, in bin folder....

#18713 report it
Ionut2014 at 2014/12/16 06:55pm
resp

I have WAMP, in my WWW folder i installed YII from console, i can see my yii default page, i add youre code in E:\wamp\www\eccyii\protected\modules (i created modules folder) My wamp path is: E:\wamp\www\eccyii

but i will try your method

#18708 report it
viktor_au at 2014/12/16 03:14am
testing the yii app

Ionut2014 wrote:
I putt yii and modules yuurs in folder http://127.0.0.1:90/eccyii/shop/install

I am a bit confused about it.
You gave me a link of your browser (http://127.0.0.1:90/eccyii/shop/install)
It is not a folder. It is a link. The folder might be: eccyii/shop/install

Let me do a simple test

Note: I think you have the folder framework somewhere (important!)

Download file: yii-1.1.15.022a51.tar.gz (.zip file)
From link: http://www.yiiframework.com/download/

Unzip it into somewhere... C:\...Yii_1.1\yii-1.1.15.022a51\yii-1.1.15.022a51

Copy from the folder demos the folder helloworld
Move this folder to C:\xampp\htdocs\helloworld
Start xampp.

Open your browser and type into the browser address window: http://127.0.0.1/helloworld/

You will get some warnings as:

Warning: require_once(C:\xampp\htdocs\helloworld/../../framework/yii.php): failed to open stream: No such file or directory in C:\xampp\htdocs\helloworld\index.php on line 4

Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\helloworld/../../framework/yii.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\helloworld\index.php on line 4

Open the folder helloworld (in  C:\xampp\htdocs\helloworld )

Open in php editor (like Eclipse) the file: index.php

Edit the next lines:
require_once
(dirname(__FILE__).'/../../framework/yii.php');
Yii::createWebApplication()->run();

Check is where have you put the framework folder. In my situation it is in C://
Note: this is important. You have to know the location of the framework folder.

Write:

$yii=dirname(__FILE__).'/../../../framework/yii.php';
Note: this is my directory, your directory can be different
$config=dirname(__FILE__).'/protected/config/main.php';
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();

Open your browser and type into the browser address window:
http://127.0.0.1/helloworld/

You will get some warnings as:

Warning: require(C:\xampp\htdocs\helloworld/protected/config/main.php): failed to open stream: No such file or directory in C:\framework\base\CApplication.php on line 133

Fatal error: require(): Failed opening required 'C:\xampp\htdocs\helloworld/protected/config/main.php' (include_path='.;C:\xampp\php\PEAR') in C:\framework\base\CApplication.php on line 133

Note that we have to work now with main.php.

This is the configuration file.

Create folder config. C:\xampp\htdocs\helloworld\protected\config

Create blank main.php file and save it into the folder C:\xampp\htdocs\helloworld\protected\config
Write in main.php file

<?php

return array(

      'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

      'name'=>'My Web Application',

);

Open your browser and try again http://127.0.0.1/helloworld/
Should be no more warnings.
You should have a page with text

Hello World

The test is finished.

 
#18707 report it
Ionut2014 at 2014/12/15 05:36pm
Response

I have wampp and in my www i hav others folders with websites . I putt yii and modules yuurs in folder http://127.0.0.1:90/eccyii/shop/install

eccyii in folder. My server is ok, i have many websites here

#18706 report it
viktor_au at 2014/12/15 02:14pm
URL was not found on this server

Hi Ionut2014
What program do you use on your PC?
Is it XAMPP?
If it is, when you enter in your browser in the address bar: http://127.0.0.1
Do you see Welcome to XAMPP for Windows! (page)?

#18705 report it
Ionut2014 at 2014/12/15 01:13pm
I can't make it to work

Hi, in my protected i create folder modules and i add all youre folders and files. in my protected folder in config/mail.php i add return array( 'modules' => array('shop' => array( 'debug' => 'true')),

in top. but when i go to http://127.0.0.1:90/eccyii/shop/install it say Not Found

The requested URL /eccyii/shop/install was not found on this server.

#18021 report it
viktor_au at 2014/08/27 03:57am
Cannot create new or update product

Please check you controller. Have you done the permissions setup correctly? ................................... public function accessRules() array('allow', // allow admin only 'actions'=>array('admin','create','update','delete'), 'users'=>array('admin_my_site'), ), ..................................... Where admin_my_site is you or your admin name to log in.

#18008 report it
Larry Jr. at 2014/08/26 02:09am
Cannot create new or update product

When i tried to add new product it only showed this this printscreen

how do we fix it? Thanks

#17987 report it
moginn at 2014/08/22 11:14pm
lots of errors

I have SQLite database and I got an Exception in the install script. Then I changed to MySQL and worked fine. I ran the program and, to be honest, I expected something else. Moreover I got an CException when purchasing the products -> Please specify the "data" property.

#17478 report it
Todd Anstis at 2014/06/18 05:50pm
The table "shop_category" for active record class "Category" cannot be found in the database.

To anyone having this issue - for some reason the default layout for the Install controller has elements that reference several ActiveRecords that (obviously, since you haven't installed the module yet) haven't been created yet. Change the layout to something other than the "shop" layout and you should be able to install fine.

#17177 report it
viktor_au at 2014/05/09 08:12am
About themes....

About themes.... In my situation the folder themes is outside the protected folder. In this folder you have to have another folder, say, folder shop (can be any name). Usually in this folder you have to have a folder css (for css files (for example: main.css)), a folder for views, inside it another folder: layouts (with main.php file). Then you have to add in each of your shop controllers (at the bottom of the controller page): **Yii::app()->theme = 'shop'; **

I think if you search the web you can find a free yii themes. You just tailor them to your needs.

#17174 report it
333ashok333 at 2014/05/09 06:57am
How to load themes to this module..??

great work by the developer ... but how can i load the themes or how can i load the theme of main web application into this module?? pls can any one help me..??

#17173 report it
333ashok333 at 2014/05/09 06:56am
How to load themes to this module..??

great work by the developer ... but how can i load the themes or how can i load the theme of main web application into this module?? pls can any one help me..??

#16261 report it
viktor_au at 2014/02/04 01:57am
yii shop user table doesn't exist.

Hi phamdoan. Please read the installation more carefully. The creator of yiishop wrote:....

Note that this Module does NOT handle User/Admin authentification (!!!). You have to do this by yourself, either by CAuthManager, CDbManager, the yii-user-management or the srbac Module................................. I can make a suggestion: download a yii-user extension (http://www.yiiframework.com/extension/yii-user). Please read the installation instructions very carefully. Please have a look at info from: http://www.benjaminlhaas.com/blog/installing-yii-users-and-rights-5-steps. Please don't rush with yiishop. Take you time. Do it slowly.

#16257 report it
phamdoan at 2014/02/03 07:40pm
can't get di customer_id

in _form.php on customer view have function

<?php echo $form->textField($customer, 'user_id', array('value'=> Yii::app()->user->id)); ?>

them I insert data , on database null , can you help me !!

untitled - Upanh.com

#16145 report it
viktor_au at 2014/01/23 04:10am
What error phamdoan?

What error? You cannot see the table with text? Or You cannot render partial the view.php?

Leave a comment

Please to leave your comment.

Create extension