Skip to content

Commit

Permalink
Issue cubecart#976 - new products 'featured' by default
Browse files Browse the repository at this point in the history
  • Loading branch information
briansandall committed Sep 20, 2016
1 parent 3c4a7dc commit f889128
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions admin/sources/products.import.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
if(!isset($product_record['latest']) || empty($product_record['latest'])) {
$product_record['latest'] = 1;
}
if(!isset($product_record['featured']) || empty($product_record['featured'])) {
$product_record['featured'] = 1;
}
// If no stock level is set we assume no stock control is used
if(isset($product_record['use_stock_level']) && ($product_record['use_stock_level']==1 || strtolower($product_record['use_stock_level'])=='true')) {
$product_record['use_stock_level'] = 1;
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/products.index.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@
// Breadcrumb
$GLOBALS['gui']->addBreadcrumb($lang['catalogue']['product_add'], $_GET);
$result[0] = array(
'featured' => 0,
'featured' => 1,
'latest' => 1,
'tax_inclusive' => 0,
'use_stock_level' => 1,
Expand Down
2 changes: 1 addition & 1 deletion setup/db/install/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ CREATE TABLE IF NOT EXISTS `CubeCart_inventory` (
`product_weight` decimal(10,3) DEFAULT NULL COMMENT 'Product Weight',
`tax_type` int(10) unsigned DEFAULT NULL COMMENT 'Tax Type',
`tax_inclusive` tinyint(1) unsigned DEFAULT '0' COMMENT 'Price inclusive of tax',
`featured` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Featured product',
`featured` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT 'Featured product',
`latest` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT 'Included on Homepage',
`seo_meta_title` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'SEO Meta Title',
`seo_meta_description` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'SEO Meta Description',
Expand Down
2 changes: 1 addition & 1 deletion setup/db/upgrade/6.1.0.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ALTER TABLE `CubeCart_inventory` CHANGE COLUMN `featured` `featured` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Featured product'; #EOQ
ALTER TABLE `CubeCart_inventory` CHANGE COLUMN `featured` `featured` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Featured product'; #EOQ
ALTER TABLE `CubeCart_inventory` ADD COLUMN `latest` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Included on Homepage' AFTER `featured`; #EOQ
UPDATE `CubeCart_inventory` SET `latest`=`featured`; #EOQ
ALTER TABLE `CubeCart_order_history` ADD `initiator` CHAR(1) NOT NULL DEFAULT 'G'; #EOQ
Expand Down

0 comments on commit f889128

Please sign in to comment.