<Solved>How to setup shop module for phpwcms 1.3.5

Get help with installation and running official modules for phpwcms here. Please do not post bug reports or feature requests here.

<Solved>How to setup shop module for phpwcms 1.3.5

Postby sunny123 on Sat Oct 06, 2007 08:46

why I use shop module and include\inc_module\mod_shop\setup\setup.php is blank?
Could anyone teach me step by step?
Thank you!
I can't read other language!
Last edited by sunny123 on Wed Oct 10, 2007 00:26, edited 1 time in total.
sunny123
 
Posts: 52
Joined: Wed Sep 26, 2007 00:11

Postby FN-Media on Sun Oct 07, 2007 14:16

Delete Folder : .../include/inc_module/mod_shop/setup

Edit .../config/phpwcms/conf.inc.php Add Code:

$phpwcms['SESSION_FEinit'] = 1; // set 1 to enable sessions in frontend, 0 to disable sessions in frontend

$phpwcms['Login_IPcheck'] = 0;

Open Database with phpmyadmin or other tool

Run SQL:

CREATE TABLE `phpwcms_categories` (
`cat_id` int(10) unsigned NOT NULL auto_increment,
`cat_type` varchar(255) NOT NULL default '',
`cat_status` int(1) NOT NULL default '0',
`cat_createdate` datetime NOT NULL default '0000-00-00 00:00:00',
`cat_changedate` datetime NOT NULL default '0000-00-00 00:00:00',
`cat_name` varchar(255) NOT NULL default '',
`cat_info` text NOT NULL,
PRIMARY KEY (`cat_id`),
KEY `cat_type` (`cat_type`,`cat_status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `phpwcms_shop_orders` (
`order_id` int(10) unsigned NOT NULL auto_increment,
`order_number` varchar(20) NOT NULL default '',
`order_date` datetime NOT NULL default '0000-00-00 00:00:00',
`order_name` varchar(255) NOT NULL default '',
`order_firstname` varchar(255) NOT NULL default '',
`order_email` varchar(255) NOT NULL default '',
`order_net` float NOT NULL default '0',
`order_gross` float NOT NULL default '0',
`order_payment` varchar(255) NOT NULL default '',
`order_data` mediumtext NOT NULL,
`order_status` varchar(100) NOT NULL default '',
PRIMARY KEY (`order_id`),
KEY `order_number` (`order_number`,`order_status`)
) TYPE = MYISAM DEFAULT CHARSET=utf8;

CREATE TABLE `phpwcms_shop_products` (
`shopprod_id` int(10) unsigned NOT NULL auto_increment,
`shopprod_createdate` datetime NOT NULL default '0000-00-00 00:00:00',
`shopprod_changedate` datetime NOT NULL default '0000-00-00 00:00:00',
`shopprod_status` int(1) unsigned NOT NULL default '0',
`shopprod_uid` int(10) unsigned NOT NULL default '0',
`shopprod_ordernumber` varchar(255) NOT NULL default '',
`shopprod_model` varchar(255) NOT NULL default '',
`shopprod_name1` varchar(255) NOT NULL default '',
`shopprod_name2` varchar(255) NOT NULL default '',
`shopprod_tag` varchar(255) NOT NULL default '',
`shopprod_vat` float unsigned NOT NULL default '0',
`shopprod_netgross` int(1) unsigned NOT NULL default '0',
`shopprod_price` float NOT NULL default '0',
`shopprod_maxrebate` float NOT NULL default '0',
`shopprod_description0` text NOT NULL,
`shopprod_description1` text NOT NULL,
`shopprod_description2` text NOT NULL,
`shopprod_description3` text NOT NULL,
`shopprod_var` mediumtext NOT NULL,
`shopprod_category` varchar(255) NOT NULL default '',
`shopprod_weight` float NOT NULL default '0',
`shopprod_color` varchar(255) NOT NULL default '',
`shopprod_size` varchar(255) NOT NULL default '',
`shopprod_listall` int(1) unsigned NOT NULL default '0',
PRIMARY KEY (`shopprod_id`),
KEY `shopprod_status` (`shopprod_status`),
KEY `category` (`shopprod_category`),
KEY `tag` (`shopprod_tag`),
KEY `all` (`shopprod_listall`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `phpwcms_sysvalue` (
`sysvalue_key` varchar(255) NOT NULL default '',
`sysvalue_group` varchar(255) NOT NULL default '',
`sysvalue_lastchange` int(11) NOT NULL default '0',
`sysvalue_status` int(1) NOT NULL default '0',
`sysvalue_vartype` varchar(100) NOT NULL default '',
`sysvalue_value` text NOT NULL,
PRIMARY KEY (`sysvalue_key`),
KEY `sysvalue_group` (`sysvalue_group`),
KEY `sysvalue_status` (`sysvalue_status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `phpwcms_categories` ADD `cat_pid` INT( 11 ) NOT NULL AFTER `cat_type` ;
ALTER TABLE `phpwcms_categories` ADD INDEX ( `cat_pid` ) ;

thats all.

sorry, my smale english is very bad. :D
bye Rene
FN-Media
 
Posts: 44
Joined: Thu Jan 13, 2005 12:23

Postby sunny123 on Mon Oct 08, 2007 00:31

FN-Media wrote:Delete Folder : .../include/inc_module/mod_shop/setup

Edit .../config/phpwcms/conf.inc.php Add Code:
.......


Thank FN-Media!
my phpmyadmin show error:"#1050 - Table 'phpwcms_sysvalue' already exists " when I run sql, how?
sunny123
 
Posts: 52
Joined: Wed Sep 26, 2007 00:11

Postby sunny123 on Mon Oct 08, 2007 13:54

why no answer?
sunny123
 
Posts: 52
Joined: Wed Sep 26, 2007 00:11

Postby flip-flop on Mon Oct 08, 2007 14:11

my phpmyadmin show error:"#1050 - Table 'phpwcms_sysvalue' already exists " when I run sql, how?
Mhh, the answer is showing in the error message. If this table exists, it is ok.
Please run the next part in phpMyAdmin:
Code: Select all
ALTER TABLE `phpwcms_categories` ADD `cat_pid` INT( 11 ) NOT NULL AFTER `cat_type` ;
ALTER TABLE `phpwcms_categories` ADD INDEX ( `cat_pid` ) ;
and insert/switch in conf.inc.php
Code: Select all
$phpwcms['SESSION_FEinit'] = 1; // set 1 to enable sessions in frontend, 0 to disable sessions in frontend

$phpwcms['Login_IPcheck'] = 0;

Knut
>> DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
flip-flop
 
Posts: 5732
Joined: Sat May 21, 2005 19:25
Location: HAMM (Germany)

Postby sunny123 on Mon Oct 08, 2007 23:22

flip-flop wrote:
my phpmyadmin show error:"#1050 - Table 'phpwcms_sysvalue' already exists " when I run sql, how?
Mhh, the answer is showing in the error message. If this table exists, it is ok. ..................


But how to do about
Code: Select all
CREATE TABLE `phpwcms_sysvalue` (
`sysvalue_key` varchar(255) NOT NULL default '',
`sysvalue_group` varchar(255) NOT NULL default '',
`sysvalue_lastchange` int(11) NOT NULL default '0',
`sysvalue_status` int(1) NOT NULL default '0',
`sysvalue_vartype` varchar(100) NOT NULL default '',
`sysvalue_value` text NOT NULL,
PRIMARY KEY (`sysvalue_key`),
KEY `sysvalue_group` (`sysvalue_group`),
KEY `sysvalue_status` (`sysvalue_status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
??????
It does not need? :?:
sunny123
 
Posts: 52
Joined: Wed Sep 26, 2007 00:11

Postby sunny123 on Tue Oct 09, 2007 01:28

May I delete the original `phpwcms_sysvalue`in database?
sunny123
 
Posts: 52
Joined: Wed Sep 26, 2007 00:11

Postby DF6IH on Tue Oct 09, 2007 04:03

sunny123 wrote:May I delete the original `phpwcms_sysvalue`in database?


Yes, you may ;)

And then redo :
Code: Select all
CREATE TABLE `phpwcms_sysvalue` (
`sysvalue_key` varchar(255) NOT NULL default '',
`sysvalue_group` varchar(255) NOT NULL default '',
`sysvalue_lastchange` int(11) NOT NULL default '0',
`sysvalue_status` int(1) NOT NULL default '0',
`sysvalue_vartype` varchar(100) NOT NULL default '',
`sysvalue_value` text NOT NULL,
PRIMARY KEY (`sysvalue_key`),
KEY `sysvalue_group` (`sysvalue_group`),
KEY `sysvalue_status` (`sysvalue_status`)
)


and all works fine
http://www.phpwcms-docu.de/download-dev-versions.phtml --> playing 312
http://jgbm.de/bensheim_2009.phtml Wir haben uns getroffen und die Freude am CMS ist wieder steil gestiegen, Bilder folgen !!
How to code my own Module? -> http://jgbm.de/Module-creation-guide-1.phtml
User avatar
DF6IH
 
Posts: 2681
Joined: Mon Jan 10, 2005 17:10
Location: Hoffenheim (fast)

Postby sunny123 on Wed Oct 10, 2007 00:26

DF6IH wrote:
sunny123 wrote:May I delete the original `phpwcms_sysvalue`in database?


Yes, you may ;)..................and all works fine


Thank you!
sunny123
 
Posts: 52
Joined: Wed Sep 26, 2007 00:11

Can't change settings

Postby zelsyus on Thu Oct 25, 2007 15:12

I've done the steps as given in this thread here three times now...
...and still I can't change the settings for the shop (currency, tax, ...).

I can add categories, products. That's working just fine.

What is wrong?
User avatar
zelsyus
 
Posts: 50
Joined: Wed Nov 05, 2003 13:23
Location: Lauffen am Neckar

Postby design on Tue Oct 30, 2007 10:09

Hello!
I'm trying to install shop module in 2007/10/29 version.
There is a mysql error:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=utf8' at line 11

How can I solve it?
Thanks!
design
 
Posts: 52
Joined: Thu Feb 17, 2005 16:19

Postby DF6IH on Tue Oct 30, 2007 10:15

design wrote:Hello!

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=utf8' at line 11

How can I solve it?
Thanks!


leave the complete "DEFAULT........" away from the sql syntax
http://www.phpwcms-docu.de/download-dev-versions.phtml --> playing 312
http://jgbm.de/bensheim_2009.phtml Wir haben uns getroffen und die Freude am CMS ist wieder steil gestiegen, Bilder folgen !!
How to code my own Module? -> http://jgbm.de/Module-creation-guide-1.phtml
User avatar
DF6IH
 
Posts: 2681
Joined: Mon Jan 10, 2005 17:10
Location: Hoffenheim (fast)

Postby design on Tue Oct 30, 2007 10:21

Thank you!
Now it works!
design
 
Posts: 52
Joined: Thu Feb 17, 2005 16:19

Postby design on Tue Oct 30, 2007 10:40

Nooooo!
I can't create a new category.
the error is:

inc_module/mod_shop/inc/listing.categories.inc.php on line 214

Code: Select all
foreach($data as $row)


This can be connected with the charset?
The post about this was in german! :roll:
design
 
Posts: 52
Joined: Thu Feb 17, 2005 16:19

Re: <Solved>How to setup shop module for phpwcms 1.3.5

Postby nebenaube on Fri Mar 07, 2008 15:37

Greetings, I just upgraded a site from 1.3.3 to 1.3.5 and I am trying to install the shop module.
as noted above, the tables needed to be created so I took the sql file from setup and modified a copy of the setup.php that is in the banner module so as to install the required database tables.

This is the second pass.
Code: Select all
<?php


// do everything in here which is neccessary for module setup

// ceate neccessary db table
$sql = array();

//on edit: integrated the following statements into create statement:
//ALTER TABLE `phpwcms_categories` ADD `cat_pid` INT( 11 ) NOT NULL AFTER `cat_type` ;
//ALTER TABLE `phpwcms_categories` ADD INDEX ( `cat_pid` ) ;
// made sure that db_prepend was actually matching other tables in the database, note extra '_' if applicable


$sql[0] = "DROP TABLE ".$phpwcms["db_prepend"]."_phpwcms_categories;";
echo $sql[0]."<br />\n";

$sql[1] = "CREATE TABLE ".$phpwcms["db_prepend"]."_phpwcms_categories (
                    `cat_id` int(10) unsigned NOT NULL auto_increment,
                    `cat_type` varchar(255) NOT NULL default '',
                                                  `cat_pid` int(11) NOT NULL,
                    `cat_status` int(1) NOT NULL default '0',
                    `cat_createdate` datetime NOT NULL default '0000-00-00 00:00:00',
                    `cat_changedate` datetime NOT NULL default '0000-00-00 00:00:00',
                    `cat_name` varchar(255) NOT NULL default '',
                    `cat_info` text NOT NULL,
                    PRIMARY KEY  (`cat_id`),
                                                  INDEX(`cat_pid`),
                    KEY `cat_type` (`cat_type`,`cat_status`)
                     ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";

echo $sql[1]."<br />\n";

$sql[2] = "DROP TABLE ".$phpwcms["db_prepend"]."_phpwcms_shop_orders;";
echo $sql[2]."<br />\n";

$sql[3] = "CREATE TABLE ".$phpwcms["db_prepend"]."_phpwcms_shop_orders (
                    `order_id` int(10) unsigned NOT NULL auto_increment,
                    `order_number` varchar(20) NOT NULL default '',
                    `order_date` datetime NOT NULL default '0000-00-00 00:00:00',
                    `order_name` varchar(255) NOT NULL default '',
                    `order_firstname` varchar(255) NOT NULL default '',
                    `order_email` varchar(255) NOT NULL default '',
                    `order_net` float NOT NULL default '0',
                    `order_gross` float NOT NULL default '0',
                    `order_payment` varchar(255) NOT NULL default '',
                    `order_data` mediumtext NOT NULL,
                    `order_status` varchar(100) NOT NULL default '',
                    PRIMARY KEY  (`order_id`),
                    KEY `order_number` (`order_number`,`order_status`)
                  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";

echo $sql[3]."<br />\n";

$sql[4] = "DROP TABLE ".$phpwcms["db_prepend"]."_phpwcms_shop_products;";
echo $sql[4]."<br />\n";

$sql[5] = "CREATE TABLE ".$phpwcms["db_prepend"]."_phpwcms_shop_products (
                    `shopprod_id` int(10) unsigned NOT NULL auto_increment,
                    `shopprod_createdate` datetime NOT NULL default '0000-00-00 00:00:00',
                    `shopprod_changedate` datetime NOT NULL default '0000-00-00 00:00:00',
                    `shopprod_status` int(1) unsigned NOT NULL default '0',
                    `shopprod_uid` int(10) unsigned NOT NULL default '0',
                    `shopprod_ordernumber` varchar(255) NOT NULL default '',
                    `shopprod_model` varchar(255) NOT NULL default '',
                    `shopprod_name1` varchar(255) NOT NULL default '',
                    `shopprod_name2` varchar(255) NOT NULL default '',
                    `shopprod_tag` varchar(255) NOT NULL default '',
                    `shopprod_vat` float unsigned NOT NULL default '0',
                    `shopprod_netgross` int(1) unsigned NOT NULL default '0',
                    `shopprod_price` float NOT NULL default '0',
                    `shopprod_maxrebate` float NOT NULL default '0',
                    `shopprod_description0` text NOT NULL,
                    `shopprod_description1` text NOT NULL,
                    `shopprod_description2` text NOT NULL,
                    `shopprod_description3` text NOT NULL,
                    `shopprod_var` mediumtext NOT NULL,
                    `shopprod_category` varchar(255) NOT NULL default '',
                    `shopprod_weight` float NOT NULL default '0',
                    `shopprod_color` varchar(255) NOT NULL default '',
                    `shopprod_size` varchar(255) NOT NULL default '',
                    `shopprod_listall` int(1) unsigned NOT NULL default '0',
                    PRIMARY KEY  (`shopprod_id`),
                    KEY `shopprod_status` (`shopprod_status`),
                    KEY `category` (`shopprod_category`),
                    KEY `tag` (`shopprod_tag`),
                    KEY `all` (`shopprod_listall`)
                  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";

echo $sql[5]."<br />\n";


$sql[6] = "DROP TABLE ".$phpwcms["db_prepend"]."_phpwcms_sysvalue;";
echo $sql[6]."<br />\n";

$sql[7] = "CREATE TABLE ".$phpwcms["db_prepend"]."_phpwcms_sysvalue (
                    `sysvalue_key` varchar(255) NOT NULL default '',
                    `sysvalue_group` varchar(255) NOT NULL default '',
                    `sysvalue_lastchange` int(11) NOT NULL default '0',
                    `sysvalue_status` int(1) NOT NULL default '0',
                    `sysvalue_vartype` varchar(100) NOT NULL default '',
                    `sysvalue_value` text NOT NULL,
                    PRIMARY KEY  (`sysvalue_key`),
                    KEY `sysvalue_group` (`sysvalue_group`),
                    KEY `sysvalue_status` (`sysvalue_status`)
               ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";

echo $sql[7]."<br />\n";

      
// setup inital ad formats
$sql_error = array();




// first create db tables
if(!_dbQuery($sql[0], 'DROP')) {

   
   //ignore errors
   //$sql_error[0] = '<p class="error">Error DROPPING <b>categories</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}

if(!_dbQuery($sql[1], 'CREATE')) {

   $sql_error[1] = '<p class="error">Error creating <b>categories</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}

if(!_dbQuery($sql[2], 'DROP')) {

   //ignore errors
   //$sql_error[2] = '<p class="error">Error DROPPING <b>shop_orders</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}

if(!_dbQuery($sql[3], 'CREATE')) {

   $sql_error[3] = '<p class="error">Error creating <b>shop_orders</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}

if(!_dbQuery($sql[4], 'DROP')) {

   //ignore errors
   //$sql_error[4] = '<p class="error">Error DROPPING <b>shop_products</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}

if(!_dbQuery($sql[5], 'CREATE')) {

   $sql_error[5] = '<p class="error">Error creating <b>shop_products</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}

if(!_dbQuery($sql[6], 'DROP')) {

   //ignore errors
   //$sql_error[6] = '<p class="error">Error DROPPING <b>sysvalue</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}

if(!_dbQuery($sql[7], 'CREATE')) {

   $sql_error[7] = '<p class="error">Error creating <b>sysvalue</b> initial database table: '.@htmlentities(@mysql_error(), ENT_QUOTES, PHPWCMS_CHARSET).'</p>';

}



if(!count($sql_error)) {

   echo '<p>All inital db tables and values were created.</p>';
   echo "<p>Edit .../config/phpwcms/conf.inc.php change Code:<br /> \$phpwcms['SESSION_FEinit'] = 1; // set 1 to enable sessions in frontend, 0 to disable sessions in frontend<br /> Add:  \$phpwcms['Login_IPcheck'] = 0;</p>\n";
   echo '<p>Please delete folder <b>setup</b> which can be found inside the module folder here:</p>';
   
} else {

   echo implode(LF, $sql_error);

}


?>


Anyway, I had many of the same problems others had and the problem boiled down to getting the table names in the database to be consistent with the other table names. I can now save preferences and create catagories and products.

To incorporate this in the front end see the tutorial: ShopPHPWCMS.pdf file in the shop-module add-on for phpwcms 1.3.3 at:
http://web.casa-loca.com/index.php?shopmodule

my test site is working perfectly now.
nebenaube
 
Posts: 106
Joined: Fri Nov 23, 2007 19:39

Next

Return to phpwcms Modules English

Who is online

Users browsing this forum: Alexa [Bot] and 0 guests