Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Star Product


euskopc

Recommended Posts

Hi

 

Nice contrib, I agree.

I like to know how I can change the length of the description text.

I find the amount of text to much (to long), so where can I change it for this contribution?

 

Thanks

 

Rich

 

you can change text lenght by aditing sql command. if you have already run sql, you can modify lenght from star_product table

Link to comment
Share on other sites

  • Replies 135
  • Created
  • Last Reply

Top Posters In This Topic

for mysql 5.x compability you must modify /catalog/includes/modeules/star_product.php sql command as follows;

 

$star_products_query = tep_db_query("select substring(pd.products_description, 1, 700)
		  as products_description,
			 p.products_id,
			 p.products_image,
			 p.manufacturers_id,
			 p.products_price,

			 IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,
			 IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id
			 from " .
			 TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
			 TABLE_PRODUCTS_DESCRIPTION . " pd, " .
			 TABLE_STAR_PRODUCT . " sp
			 where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '" . $languages_id . "'");

Link to comment
Share on other sites

you can change text lenght by aditing sql command. if you have already run sql, you can modify lenght from star_product table

 

Thanks for your respond expert

I looked into the star_product table, but there is nothing to be modified. My sql is the following:

 

CREATE TABLE `star_product` (
`product_id` VARCHAR( 11 ) DEFAULT '0' NOT NULL
);
INSERT INTO `star_product` ( `product_id` )
VALUES (
'1'
);

The only thing that is listed in this table is the product_id.

 

I was thinking to add a few more fields into the star_product table, like

star_product_starting_dated

star_product_ending_dated

start_product_status

 

But due to the lag of coding time :rolleyes: ... it has to wait.... :-"

 

and as I was posting before, I wanted to limit the characters shown in the description, something like

star_product_description_length which could have been located in the configuration section...

 

But I might have overlooked something. It is maybe already somewhere in the star_product contrib. If so please point it out to me. I am a bit blind due to all the codes :lol:

 

Thanks again for the respond

 

Rich

Link to comment
Share on other sites

  • 4 weeks later...

Hi all..

 

I just installed this contribution.. And so far I really like it.. But of course.. With things like this.. There is always something that can go wrong..

 

The problem I am having unfortunately is that in my star product panel in admin.. Two of each product are showing up (duplicates).. Is there a way to fix this? Or is there something in specific causing this? The only thing I can think of is that I have sm, md, and Lg images contribution installed on my store.. And that maybe the extra images may be causing the duplicate product to be showing up in star product's panel.. If this be the case.. I need to know what modifications need to be done in order to fix this.. I'm not sure.. And I don't want to break the cart.. I just need someone's expert help or opinion here..

 

I thank you very much in advance for your help..

 

Christine

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

great contribuition !

 

in german everything works perfect.

 

only little problem,

if i switch from german to english language

i cant see any product information of the "star_product" (name, description and the price is 0.00?

 

what i have done wrong ?

 

thanks

 

bg

Michael

Link to comment
Share on other sites

in german everything works perfect.

 

only little problem,

if i switch from german to english language

i cant see any product information of the "star_product" (name, description and the price is 0.00?

 

what i have done wrong ?

 

Hi,

I run this contrib in 3 languages and I have no problem with it. Saying that, the contrib is running fine in multi language settings.

 

can we have a look on it, to get an idea?

In the moment I would do wild guessing and that does not help.

Someone else has an idea?

 

Rich

Link to comment
Share on other sites

  • 1 month later...

This is a great contribution, it's working fine for me but i would like to know how to take off the infobox sytle? I don't want to use my stylesheet with this i just want it to output the data with out any design.

Link to comment
Share on other sites

  • 2 months later...

hi guys i need a litle help, this contribution give me this error

 

"1054 - Unknown column 'p.products_id' in 'on clause'

 

select substring(pd.products_description, 1, 598) as products_description, p.products_id, p.products_image, p.manufacturers_id, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id from products p, products_description pd, star_product sp left join specials s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '4'

 

[TEP STOP]"

 

i see every steps and everything its ok the contribution is a star_product 1.5, i dont now what i can do plese help me whit this~.

 

best regards

Link to comment
Share on other sites

Great contrib but I need a little help solving a problem.

 

All works great but when generating the code to be integrated on my home page lots of empty table cells can be seen just after the product when you "view source".

 

Is this supposed to happen? Its causing me layout problems, all the empty table cells take up around 10px of space onscreen underneath my "Star Product" which I could do without.

 

Any help??

Link to comment
Share on other sites

  • 3 weeks later...

Minor update:

A slight addition to Expert's update. His new admin ability of turning the Star Product on or off is great however it called a configuration value that didn't exist.

 

Run this sql command on your database:

INSERT INTO `configuration` VALUES (768, 'Show Start Product', 'SHOW_STARPRODUCT', 'false', 'Show Star Product on Index Page', 1, 154, '2006-08-12 19:45:03', '2003-08-14 00:25:08', NULL, 'tep_cfg_select_option(array(''false'', ''true''),');

 

Next...to get rid of the star product box on the index page when turned off in admin:

 

Find these lines:

<tr>

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

</tr>

 

And replace with these:

<?

// STAR PRODUCT START...

if (SHOW_STARPRODUCT=="true") {

?>

<tr>

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

</tr>

 

<?

}

// STAR PRODUCT END...

?>

 

That's it...

All credit goes to the original authors...I just updated it a touch.

I only do what my Rice Krispies tell me to do!

Link to comment
Share on other sites

  • 3 weeks later...

Hi folks,

 

I'm having a problem with this contribution. It works great, except when I click on the buy now button it takes me to the shopping cart. If I then click on continue shopping, I get a ''page cannot be displayed'' error.

 

You can see it here:

 

www.vintagevibrations.com

 

Thanks in advance,

 

Di11on

Link to comment
Share on other sites

Hi and thanks for the contribution.

 

I have a newbie problem.

 

On my index page in the catalog I get this message

 

1146 - Table 'radioshop.table_star_product' doesn't exist

 

select substring(pd.products_description, 1, 700) as products_description, p.products_id, p.products_image, p.manufacturers_id, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id from products p left join specials s on p.products_id = s.products_id, products_description pd, TABLE_STAR_PRODUCT sp where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '1'

 

[TEP STOP]

 

When I go to catalog\includes\modules\star_product.php I can't seem to find the problem and I know that the table star_product exist in the database.

 

//MY star_product.php

 

<?php

//REMOVE THIS LINES IF YOU DON'T WANT TO SHOW THE HEADER

$header_star_product = array();

$header_star_product[] = array('align' => 'center', 'text' => sprintf(STAR_TITLE));

new contentBoxHeading($header_star_product);

//END OF -REMOVE THIS LINES IF YOU DON'T WANT TO SHOW THE HEADER-

 

$star_products_query = tep_db_query("select substring(pd.products_description, 1, 700)

as products_description,

p.products_id,

p.products_image,

p.manufacturers_id,

p.products_price,

 

IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,

IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id

from " .

TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .

TABLE_PRODUCTS_DESCRIPTION . " pd, " .

TABLE_STAR_PRODUCT . " sp

where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '" . $languages_id . "'");

 

if (!tep_star_product_with_attributes($star_products['products_id'])) {

$star_products["0"] = array('align' => 'center',

'params' => 'width="100%" valign="top"',

'text' => '<table border="0" width="95%">

<tr>

<td align="left" width="20%" rowspan="4"><a href="' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $star_products['products_id']) . '"' . ' target="popup"' . ' onClick="window.open(this.href, this.target, \'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' . SMALL_IMAGE_WIDTH . ', height=' . SMALL_IMAGE_HEIGHT . '\').focus(); return false;">' . tep_image(DIR_WS_IMAGES . $star_products['products_image'], $star_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>

<td align="left" height="40" class="star-product-title">' . $star_products['products_name'] . '</td>

</tr>

<tr>

<td height="80%" width="85%" class="star-product">'. strip_tags($star_products["products_description"]) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . STAR_READ_MORE . '</a></td>

</tr>

<tr>

<td align="right" height="5%" width="15%" class="star-product-price">'.

$currencies->display_price($star_products['final_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '<br><br></td>

</tr>

<tr>

<td align="right" height="20"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/more_info.gif') . '</a>' . tep_draw_separator('pixel_trans.gif', '10', '10') . '<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $star_products['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_IN_CART) . '</a></td>

</tr>

</table>');

$star_products_output = array_slice($star_products, sizeof($star_products)-1);

new contentBox($star_products_output);

}

 

else {

$star_products["0"] = array('align' => 'center',

'params' => 'width="100%" valign="top"',

'text' => '

<table border="0" width="95%">

<tr>

<td align="left" width="20%" rowspan="4"><a href="' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $star_products['products_id']) . '"' . ' target="popup"' . ' onClick="window.open(this.href, this.target, \'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' . SMALL_IMAGE_WIDTH . ', height=' . SMALL_IMAGE_HEIGHT . '\').focus(); return false;">' . tep_image(DIR_WS_IMAGES . $star_products['products_image'], $star_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>

<td align="left" height="40" class="star-product-title">' . $star_products['products_name'] . '</td>

</tr>

<tr>

<td height="80%" width="85%" class="star-product">'. strip_tags($star_products["products_description"]) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . STAR_READ_MORE . '</a></td>

</tr>

<tr>

<td align="right" height="5%" width="15%" class="star-product-price">'. $currencies->display_price($star_products['final_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '<br><br></td>

</tr>

<tr>

<td align="right" height="20"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/more_info.gif') . '</a>' . tep_draw_separator('pixel_trans.gif', '10', '10') . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $star_products['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_IN_CART) . '</a></td>

</tr>

</table>');

new contentBox($star_products);

}

?>

 

please advice

 

/Konrad

Link to comment
Share on other sites

Hello

 

this could be a problem with MySQL 5.0

 

open file:

 

catalog/include/modules/star_products.php

 

and find:

 

$star_products_query = tep_db_query("select substring(pd.products_description, 1, 598) as products_description, p.products_id, p.products_image, p.manufacturers_id, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_STAR_PRODUCT . " sp left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '" . $languages_id . "'");

 

replace:

 

$star_products_query = tep_db_query("select substring(pd.products_description, 1, 598) as products_description, p.products_id, p.products_image, p.manufacturers_id, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id from ( " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_STAR_PRODUCT . " sp ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '" . $languages_id . "'");

 

 

This is a BUG reported here:

 

http://www.oscommerce.com/community/bugs,3171

Link to comment
Share on other sites

Hello

 

this could be a problem with MySQL 5.0

 

open file:

 

catalog/include/modules/star_products.php

 

and find:

 

$star_products_query = tep_db_query("select substring(pd.products_description, 1, 598) as products_description, p.products_id, p.products_image, p.manufacturers_id, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_STAR_PRODUCT . " sp left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '" . $languages_id . "'");

 

replace:

 

$star_products_query = tep_db_query("select substring(pd.products_description, 1, 598) as products_description, p.products_id, p.products_image, p.manufacturers_id, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_tax_class_id, sp.product_id from ( " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_STAR_PRODUCT . " sp ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '" . $languages_id . "'");

This is a BUG reported here:

 

http://www.oscommerce.com/community/bugs,3171

 

thanks for the quick reply. However It didn't work. Perhaps I will just have too wait until there is a new release.

 

/Konke

Link to comment
Share on other sites

thanks for the quick reply. However It didn't work. Perhaps I will just have too wait until there is a new release.

 

/Konke

 

 

Then see if in

 

catalog/includes/database_tables.php

 

added the define for the table of star products

Link to comment
Share on other sites

Then see if in

 

catalog/includes/database_tables.php

 

added the define for the table of star products

I have these lines in catalog/includes/database_tables.php. I'm I missing something?

 

//Star product Start

define('STAR_TITLE', 'Star Product'); // star product

define('STAR_READ_MORE', '<FONT color=blue> ... read more.</FONT>'); // ... read more.

//Star product End

Link to comment
Share on other sites

I have these lines in catalog/includes/database_tables.php. I'm I missing something?

 

//Star product Start

define('STAR_TITLE', 'Star Product'); // star product

define('STAR_READ_MORE', '<FONT color=blue> ... read more.</FONT>'); // ... read more.

//Star product End

 

that is!

 

the line to add is this:

 

  //Star Products Start
 define('TABLE_STAR_PRODUCT', 'star_product');
 //Star Products End

 

 

the lines you say are for:

 

of /catalog/includes/languages/english.php

Edited by nicko107
Link to comment
Share on other sites

that is!

 

the line to add is this:

 

  //Star Products Start
 define('TABLE_STAR_PRODUCT', 'star_product');
 //Star Products End

the lines you say are for:

 

of /catalog/includes/languages/english.php

 

 

It's working! thanks a million!

 

/Konrad

Link to comment
Share on other sites

if you encounter alignment problem with tables most probably some portion of product information text couses this if it has HTML formatting. I mean lets assume product info has <table> tag at beginning, contribution cuts its whole info before </table> tag is closed. Therefore you will have extra <table> tag on general code that it causes main page alignment problem.

 

I'm working on this to strip some html tags.

 

BTW, there is a missing close </table> tag in star_product.php in modules. So correct one as follows:

 

Thanks for pointing that out! I had the same problem and knew there was an unclosed tag somewhere, but after an hour of looking at the code, I gave up. I have had this problem several times and never figured out the trick of finding where the missing tag should be filled in. Is there such a trick, or is it just a matter of counting the diffrent tags: <table<tr><td> and </table</tr></td> and so forth...

Link to comment
Share on other sites

  • 2 weeks later...

Hello

 

I uploaded version:

 

Star Product v 1.6

 

 

Is a COMPLETE PACK thats include all previous fixed and changes.

 

 

- include all fixes and changes of before versions, all credits for they authors. Module can be select active o not active and select the star product by the admin side. With version Star Product v 1.5c (by mickeymouse)

 

- unified sql changes in one file star_product.sql (the new table start_product and sql of Star Product v 1.5c) for a easy install.

 

- include fix to don?t cut words (Another quick fix by Iv?n Prieto 13 Dec 2004)

 

- a better order of installation steps for not display errors during installation

 

- include install instructions in spanish

 

- screenshots of admin configuration of star product and Star Product module of main index page of catalog.

 

- Folder called: catalog_for_new_shops_only, that include all files changed with this contribution for upload to new shop only that didn?t have modifications in his files.

 

 

 

And is available a online DEMO:

 

http://www.oscommerce-demo.com/demo01/

 

(this demo include graphical modification of modules and boxes not include in this contribution)

Link to comment
Share on other sites

Hi Nicko,

 

(this demo include graphical modification of modules and boxes not include in this contribution)

 

I dont suppose your planning on releasing your graphical mod for this contrib as I am using your other contrib and I think it is one of the best sets of contributions released for osc.

 

If your not going to release it is there anychance your would email it to me?

 

Many Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

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