Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wolfen Featured Sets SUPPORT


241

Recommended Posts

Hi Steve,

 

This is a great contribution! Amazing design and maximum functionality at very little installation effort!

 

I still installed the "Featured Products" separately as I wanted to replace the "New Products..."-box also for the category pages. One comment regarding this:

Both contributions are using (and are trying to declare) functions named tep_expire_featured() and tep_set_featured_status() (in file \includes\functions\featured_sets.php). So whoever wants to have both contributions running side by side has to rename the functions of one contribution. The functions are pretty much the same, but they're using different database tables.

 

Thanks for the great work!

Michael

 

 

Could someone explain a bit more detail what I should do if I want to install "Featured Products" AFTER I have installed "Wolfen Featured Sets"?

 

I mean what files should be changed and how?

Edited by aapinen
Link to comment
Share on other sites

  • Replies 398
  • Created
  • Last Reply

Top Posters In This Topic

If you have time I would like to ask one more question, is there possibility to rotate featured products display on main page (their default display order to be random) ? If I set 9 product to be present on main page in 3x3 layout I would appreciate if 'the engine' would rotate them for example two weeks untill I change them to some other set of featured products ?

 

Just set the sort order to rand()

 

 

Set the sort order for the feature products. p.products_id

 

I dont understand this advice.. can you explain?

Link to comment
Share on other sites

I think here is a bug:

 

When choosing "Display featured categories" and putting "Set the sort order for the feature categories." for "random". There will be only one random product from the category which picture is above the products.

Link to comment
Share on other sites

I think here is a bug:

 

When choosing "Display featured categories" and putting "Set the sort order for the feature categories." for "random". There will be only one random product from the category which picture is above the products.

 

Please read through the support prior to posting.

 

Page: #2 Post: #22

 

Page: #9 Post: #176

 

Page: #13 Post: #257

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Please read through the support prior to posting.

 

Page: #2 Post: #22

 

Page: #9 Post: #176

 

Page: #13 Post: #257

 

Its sometimes very hard to find information when reading foreing language many pages of things you wouldnt undestand much even with your own language :blush: But I put this info for future seekers for help.

 

for the moment you can only show one category with products at a time.
Link to comment
Share on other sites

  • 2 weeks later...

Hey 241 - Steve B, love your work.

 

This contribution is just what i need for my shop, problem is it has a lot of other contributions :(

 

I have applied the code by comparising with a program, but im getting a parsing error in admin/categories.php now:

 

Parse error: parse error, unexpected T_ELSEIF in /home/x/public_html/admin/categories.php on line 1065

 

I have double checked back and forth, and i think it might be because i have a contribution thats interfeering?

Edited by suzz
Link to comment
Share on other sites

  • 2 weeks later...

I hope I not hijacking the post. I just installed a fresh oscommerce and replacing all files from Wolfen Featured Sets v1.05 for default osCommerce. now I can't get in admin page, it shown these errors

 

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/content/a/c/c/accexr/html/os/catalog/admin/includes/application_top.php on line 126

 

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/content/a/c/c/accexr/html/os/catalog/admin/includes/application_top.php on line 126

 

Fatal error: main(): Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/local/lib/php') in /home/content/a/c/c/accexr/html/os/catalog/admin/includes/application_top.php on line 126

 

 

please help! Thanks

Edited by anchim
Link to comment
Share on other sites

I hope I not hijacking the post. I just installed a fresh oscommerce and replacing all files from Wolfen Featured Sets v1.05 for default osCommerce. now I can't get in admin page, it shown these errors

 

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/content/a/c/c/accexr/html/os/catalog/admin/includes/application_top.php on line 126

 

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/content/a/c/c/accexr/html/os/catalog/admin/includes/application_top.php on line 126

 

Fatal error: main(): Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/local/lib/php') in /home/content/a/c/c/accexr/html/os/catalog/admin/includes/application_top.php on line 126

please help! Thanks

 

 

I think you will find that you have uploaded the catalog/includes/application_top.php into the admin/includes/

 

Look at the error message no file or directory in admin/includes/application_top.php on line 126 and the reference to includes/classes/navigation_history.php

 

 

line 126 of admin/includes/application_top.php is for languages id

 

	$language = $lng->language['directory'];
$languages_id = $lng->language['id'];

 

whereas line 126 of catalog/includes/application_top.php is for navigation history

 

// include navigation history class
 require(DIR_WS_CLASSES . 'navigation_history.php');

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I think you will find that you have uploaded the catalog/includes/application_top.php into the admin/includes/

 

Look at the error message no file or directory in admin/includes/application_top.php on line 126 and the reference to includes/classes/navigation_history.php

line 126 of admin/includes/application_top.php is for languages id

 

	$language = $lng->language['directory'];
$languages_id = $lng->language['id'];

 

whereas line 126 of catalog/includes/application_top.php is for navigation history

 

// include navigation history class
 require(DIR_WS_CLASSES . 'navigation_history.php');

 

Thanks for the replying. I solve the problem by replacing the a line inside index.php

with the following line found it in install.html

<td><?php include(DIR_WS_MODULES . FILENAME_FEATURED_SETS); ?></td>

 

close file and save catalog/index.php

 

now everything working, I give 2 thumb up for this amazing works. Thank you.

two little question, is it possible to move the buy it now buttom lower away from the image,

a bit too close. second, how can I control the image in right and left column to the size I wanted,

instead of the default size of the product page. One again, Thanks for sharing this wonderfull contribution.

Anchim

Link to comment
Share on other sites

I've installed the contribution according to the instructions and have it working. I'm running into a problem in the admin when I try to work on a product. The product page is cut off right after the British flag for the product short description. There is no box or anything to input the description nor anything else after it. I have a Template Monster template installed on the catalog side but not in the admin. Everything else seemed to work fine. Has anyone else experienced this issue?

 

Thanks in advance,

Toni

Link to comment
Share on other sites

  • 1 month later...

I updated my install with the 2.2 Milestone 2 060817 Update Release (aug. 2006). The latest Wolfen featured set is ver. 1.05 (28 Jul 2006). So I checked for overlapping files which may need to be updated.

 

Am I correct that the only Wolfen file that needs to be changed is: catalog/admin/includes/functions/general.php

 

And the only change needed in the Wolfen version of general.php is this:

Find this code on line 14:

// Redirect to another page or site
 function tep_redirect($url) {
global $logger;

and add this code directly beneath it:

if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
	tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
		}

 

So the result would look like this:

// Redirect to another page or site
 function tep_redirect($url) {
global $logger;

if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
	tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
		}

 

Thanks!

Link to comment
Share on other sites

  • 4 weeks later...

Hi Steve,

First off, thanks for what looks like an awesome contribution! I say "looks like", as i've just installed the contrib and although everything seems to be working in the backend, i cant seem to get the featured category to show in the frontend.

 

Heres an outline of what i've done:

- Full site and db backup

- Replaced all the necessary files

- Run the sql file

- Updated the catelogue/index.php file

- Logged into the OSC admin, go to Featured Sets under the configuration section

- Set a featured Category, with an expiry date of 01/01/07

- Checked that no other categories are featured.

 

Any suggestions what i'm doing wrong?

 

Many thanks,

Chris

Link to comment
Share on other sites

Hi Guys,

It seems all my other posts have "disappeared"!

 

I've applied all the instructions and the home page featured is working like a bomb, only prob now is when i try click on any of the categories, i get a message "Unable to determine the page link!".

 

I'm still desperately trying to get this working. If anyone has any suggestions, i'd really appreciate it!

Thanks,

Chris

Link to comment
Share on other sites

Hi Guys,

It seems all my other posts have "disappeared"!

 

I've applied all the instructions and the home page featured is working like a bomb, only prob now is when i try click on any of the categories, i get a message "Unable to determine the page link!".

 

I'm still desperately trying to get this working. If anyone has any suggestions, i'd really appreciate it!

Thanks,

Chris

 

Your other posts were removed because they were not relevent to the thread as the issue was not caused by the contribution as is the same with the issue you are now posting which is caused by having Search engine safe urls set to true in the admin.

 

The resolve is to set Use Search-Engine Safe URLs (still in development) to false in the admin.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Hi

 

Spend a great deal of time getting this contrib running. I'm using "HeaderTags_V_2.6.1" and there was a lot of mixing code - finally it ran. I actually have a lot of contribs I believe, if it's any help, here you can see which: http://www.onlinekompagniet.dk/article_inf...amp;language=en

 

But in admin "Featured Sets", when I click on one of these

 

Choose a featured product layout

Choose a featured product layout set style

 

Choose a featured cetagories set layout

Choose a featured categories set style

 

Choose a featured manufacturer set layout

Choose a featured manufacturer set style

 

....... the update possibilities dissapear ?? The form buttons are gone?

 

Is it me somehow??

 

Heeeeeeelllllp *s*

 

Helle :'(

Link to comment
Share on other sites

This is too hard for me!!!!! I can't make manufacturers.php and categories.php working in admin. I know this post is VERY long - sorry, but I'm totally lost and really need help on this one....

 

HOW on earth do I get the code implemented into this categories.php:

 

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::

categories.php

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::

 

<?php

/*

$Id: categories.php,v 1.146 2003/07/11 14:40:27 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

if (tep_not_null($action)) {

switch ($action) {

case 'setflag':

if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {

if (isset($HTTP_GET_VARS['pID'])) {

tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID']));

break;

case 'insert_category':

case 'update_category':

if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

 

$sql_data_array = array('sort_order' => $sort_order);

 

if ($action == 'insert_category') {

$insert_sql_data = array('parent_id' => $current_category_id,

'date_added' => 'now()');

 

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);

 

tep_db_perform(TABLE_CATEGORIES, $sql_data_array);

 

$categories_id = tep_db_insert_id();

} elseif ($action == 'update_category') {

$update_sql_data = array('last_modified' => 'now()');

 

$sql_data_array = array_merge($sql_data_array, $update_sql_data);

 

tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "'");

}

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

$categories_name_array = $HTTP_POST_VARS['categories_name'];

//HTC BOC

$categories_htc_title_array = $HTTP_POST_VARS['categories_htc_title_tag'];

$categories_htc_desc_array = $HTTP_POST_VARS['categories_htc_desc_tag'];

$categories_htc_keywords_array = $HTTP_POST_VARS['categories_htc_keywords_tag'];

$categories_htc_description_array = $HTTP_POST_VARS['categories_htc_description'];

//HTC EOC

 

$language_id = $languages[$i]['id'];

 

//HTC BOC

$sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),

'categories_htc_title_tag' => (tep_not_null($categories_htc_title_array[$language_id]) ? tep_db_prepare_input($categories_htc_title_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

'categories_htc_desc_tag' => (tep_not_null($categories_htc_desc_array[$language_id]) ? tep_db_prepare_input($categories_htc_desc_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

'categories_htc_keywords_tag' => (tep_not_null($categories_htc_keywords_array[$language_id]) ? tep_db_prepare_input($categories_htc_keywords_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

'categories_htc_description' => tep_db_prepare_input($categories_htc_description_array[$language_id]));

//HTC EOC

 

if ($action == 'insert_category') {

$insert_sql_data = array('categories_id' => $categories_id,

'language_id' => $languages[$i]['id']);

 

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);

 

tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);

} elseif ($action == 'update_category') {

tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");

}

}

 

if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {

if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");

}

} else {

if (isset($HTTP_POST_VARS['categories_image']) && tep_not_null($HTTP_POST_VARS['categories_image']) && ($HTTP_POST_VARS['categories_image'] != 'none')) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($HTTP_POST_VARS['categories_image']) . "' where categories_id = '" . (int)$categories_id . "'");

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));

break;

case 'delete_category_confirm':

if (isset($HTTP_POST_VARS['categories_id'])) {

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

$categories = tep_get_category_tree($categories_id, '', '0', '', true);

$products = array();

$products_delete = array();

 

for ($i=0, $n=sizeof($categories); $i<$n; $i++) {

$product_ids_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$categories[$i]['id'] . "'");

 

while ($product_ids = tep_db_fetch_array($product_ids_query)) {

$products[$product_ids['products_id']]['categories'][] = $categories[$i]['id'];

}

}

 

reset($products);

while (list($key, $value) = each($products)) {

$category_ids = '';

 

for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {

$category_ids .= "'" . (int)$value['categories'][$i] . "', ";

}

$category_ids = substr($category_ids, 0, -2);

 

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")");

$check = tep_db_fetch_array($check_query);

if ($check['total'] < '1') {

$products_delete[$key] = $key;

}

}

 

// removing categories can be a lengthy process

tep_set_time_limit(0);

for ($i=0, $n=sizeof($categories); $i<$n; $i++) {

tep_remove_category($categories[$i]['id']);

}

 

reset($products_delete);

while (list($key) = each($products_delete)) {

tep_remove_product($key);

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));

break;

case 'delete_product_confirm':

if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && is_array($HTTP_POST_VARS['product_categories'])) {

$product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$product_categories = $HTTP_POST_VARS['product_categories'];

 

for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {

tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "' and categories_id = '" . (int)$product_categories[$i] . "'");

}

 

$product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");

$product_categories = tep_db_fetch_array($product_categories_query);

 

if ($product_categories['total'] == '0') {

tep_remove_product($product_id);

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));

break;

case 'move_category_confirm':

if (isset($HTTP_POST_VARS['categories_id']) && ($HTTP_POST_VARS['categories_id'] != $HTTP_POST_VARS['move_to_category_id'])) {

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

$new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);

 

$path = explode('_', tep_get_generated_category_path_ids($new_parent_id));

 

if (in_array($categories_id, $path)) {

$messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));

} else {

tep_db_query("update " . TABLE_CATEGORIES . " set parent_id = '" . (int)$new_parent_id . "', last_modified = now() where categories_id = '" . (int)$categories_id . "'");

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&cID=' . $categories_id));

}

}

 

break;

case 'move_product_confirm':

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);

 

$duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$new_parent_id . "'");

$duplicate_check = tep_db_fetch_array($duplicate_check_query);

if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_id = '" . (int)$new_parent_id . "' where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$current_category_id . "'");

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&pID=' . $products_id));

break;

case 'insert_product':

case 'update_product':

if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {

$action = 'new_product';

} else {

if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);

$products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']);

 

$products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';

 

$sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),

'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

'products_date_available' => $products_date_available,

'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),

'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),

'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),

'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

 

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {

$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);

}

 

if ($action == 'insert_product') {

$insert_sql_data = array('products_date_added' => 'now()');

 

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);

 

tep_db_perform(TABLE_PRODUCTS, $sql_data_array);

$products_id = tep_db_insert_id();

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");

} elseif ($action == 'update_product') {

$update_sql_data = array('products_last_modified' => 'now()');

 

$sql_data_array = array_merge($sql_data_array, $update_sql_data);

 

tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");

}

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

$language_id = $languages[$i]['id'];

 

//HTC BOC

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),

'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),

'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]),

'products_head_title_tag' => ((tep_not_null($HTTP_POST_VARS['products_head_title_tag'][$language_id])) ? tep_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]) : tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id])),

'products_head_desc_tag' => ((tep_not_null($HTTP_POST_VARS['products_head_desc_tag'][$language_id])) ? tep_db_prepare_input($HTTP_POST_VARS['products_head_desc_tag'][$language_id]) : tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id])),

'products_head_keywords_tag' => ((tep_not_null($HTTP_POST_VARS['products_head_keywords_tag'][$language_id])) ? tep_db_prepare_input($HTTP_POST_VARS['products_head_keywords_tag'][$language_id]) : tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id])));

//HTC EOC

 

if ($action == 'insert_product') {

$insert_sql_data = array('products_id' => $products_id,

'language_id' => $language_id);

 

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);

 

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);

} elseif ($action == 'update_product') {

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));

}

break;

case 'copy_to_confirm':

if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) {

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

if ($HTTP_POST_VARS['copy_as'] == 'link') {

if ($categories_id != $current_category_id) {

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['total'] < '1') {

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$categories_id . "')");

}

} else {

$messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');

}

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$product = tep_db_fetch_array($product_query);

 

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

$dup_products_id = tep_db_insert_id();

 

//HTC BOC

$description_query = tep_db_query("select language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

}

//HTC EOC

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

$products_id = $dup_products_id;

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));

break;

case 'new_product_preview':

if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {

// copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

} else {

$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

}

} else {

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {

$products_image_name = $HTTP_POST_VARS['products_image'];

} else {

$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

}

}

break;

}

}

 

// check if the catalog image directory exists

if (is_dir(DIR_FS_CATALOG_IMAGES)) {

if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');

} else {

$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

 

<script language="Javascript1.2"><!-- // load htmlarea

// MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 Products Description HTML - Head

_editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/"; // URL to htmlarea files

var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);

if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }

if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }

if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }

<?php if (HTML_AREA_WYSIWYG_BASIC_PD == 'Basic'){ ?> if (win_ie_ver >= 5.5) {

document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"');

document.write(' language="Javascript1.2"></scr' + 'ipt>');

} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

<?php } else{ ?> if (win_ie_ver >= 5.5) {

document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"');

document.write(' language="Javascript1.2"></scr' + 'ipt>');

} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

<?php }?>

// --></script>

 

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">

<div id="spiffycalendar" class="text"></div>

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top">

<?php

if ($action == 'new_product') {

$parameters = array('products_name' => '',

'products_description' => '',

'products_url' => '',

'products_id' => '',

'products_quantity' => '',

'products_model' => '',

'products_image' => '',

'products_price' => '',

'products_weight' => '',

'products_date_added' => '',

'products_last_modified' => '',

'products_date_available' => '',

'products_status' => '',

'products_tax_class_id' => '',

'manufacturers_id' => '');

 

$pInfo = new objectInfo($parameters);

 

//HTC BOC

if (isset ($HTTP_GET_VARS['pID']) && (!$HTTP_POST_VARS) ) {

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product = tep_db_fetch_array($product_query);

//HTC EOC

 

$pInfo->objectInfo($product);

} elseif (tep_not_null($HTTP_POST_VARS)) {

$pInfo->objectInfo($HTTP_POST_VARS);

$products_name = $HTTP_POST_VARS['products_name'];

$products_description = $HTTP_POST_VARS['products_description'];

$products_url = $HTTP_POST_VARS['products_url'];

}

 

$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],

'text' => $manufacturers['manufacturers_name']);

}

 

$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));

$tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");

while ($tax_class = tep_db_fetch_array($tax_class_query)) {

$tax_class_array[] = array('id' => $tax_class['tax_class_id'],

'text' => $tax_class['tax_class_title']);

}

 

$languages = tep_get_languages();

 

if (!isset($pInfo->products_status)) $pInfo->products_status = '1';

switch ($pInfo->products_status) {

case '0': $in_status = false; $out_status = true; break;

case '1':

default: $in_status = true; $out_status = false;

}

?>

<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">

<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>

<script language="javascript"><!--

var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);

//--></script>

<script language="javascript"><!--

var tax_rates = new Array();

<?php

for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {

if ($tax_class_array[$i]['id'] > 0) {

echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";

}

}

?>

 

function doRound(x, places) {

return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);

}

 

function getTaxRate() {

var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;

var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;

 

if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {

return tax_rates[parameterVal];

} else {

return 0;

}

}

 

function updateGross() {

var taxRate = getTaxRate();

var grossValue = document.forms["new_product"].products_price.value;

 

if (taxRate > 0) {

grossValue = grossValue * ((taxRate / 100) + 1);

}

 

document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);

}

 

function updateNet() {

var taxRate = getTaxRate();

var netValue = document.forms["new_product"].products_price_gross.value;

 

if (taxRate > 0) {

netValue = netValue / ((taxRate / 100) + 1);

}

 

document.forms["new_product"].products_price.value = doRound(netValue, 4);

}

//--></script>

<?php echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 &nbs

Link to comment
Share on other sites

  • 3 weeks later...

Hi All,

 

Please forgive me for posting this here, i have also posted in the forum for the graphical infobox contribution.

 

I was just wondering whether anyone has both 'wolfen featured sets' and 'graphical infoboxes' working together. Everything works fine straight from the box apart from the titles of the featured sets boxes, which all display 'categories'. If i change define('BOX_HEADING_CATEGORIES', ' '); to something else in english.php the featured sets change to that also?

 

I was just wondering if anyone else had installed these contributions together, and if so did they get the same issue?

 

Best Regards

 

Donna

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I followed the instructions to transfer the database, but get this:

 

#1060 - Duplicate column name 'products_featured'

 

setup is bog standard, tried several times and have looked through the forum several times and also searched the net, but cannot find a solution.

 

New to os and php. What happens to the documents in the 'docs' directory? do they need installed to? if so how?

 

Sorry for being stupid, but i do try before i post.

 

Can anyone help to resolve this matter

Link to comment
Share on other sites

Hello, first of all I wanna thank you for a nice contribution secondly I wanna ask you a fast question:

Is there any way I could place this box in a subcategory and let it show featured products from the that main category?

When I place the box there I will get featured products from all over the shop.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...