Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Star Product v1.0


mark27uk3

Recommended Posts

Hi Guys,

 

I have just installed the above contrib, unfortunately it does not work right.

 

You can view the contrib in action here

 

It does not display the image and when you click on the product, it obviously says no product found because the product id is missing.

 

Here is the code from /includes/modules/star_product.php

 

<?php

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

 $star_product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "'and pd.language_id = '" . $languages_id . "'");
 $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_tax_class_id, sp.product_id from " . TABLE_PRODUCTS . " p, " . 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 . "'");
 $star_products = tep_db_fetch_array($star_products_query);
 $star_products['products_name'] = tep_get_products_name($star_products['products_id']);
 $star_products["0"] = array('align' => 'center',
         'params' => 'width="100%" valign="top"',
                                     'text' => '<tr>
              <td height="15%" width="85%" class="star-product-title"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $star_products['products_id']) . '">' . $star_products['products_name'] . '</a></td>
        <td align="right"  height="100%" width="15%" rowspan="2"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $star_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $star_products['products_image'], $star_products['products_name'], 210) . '</a></td>
      </tr>
      <tr>
        <td height="85%" width="85%" class="star-product">'. $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><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . 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>');
new contentBox($star_products);
?>

 

If anyone has used it and got it working, please share!

 

Thanks

 

Mark

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

Link to comment
Share on other sites

I will try to fix the problem, you are experimenting problems because you dont have any product with ID=1, to fix it you can open the sql file with text edit and search this line:

 

INSERT INTO `star_product` ( `product_id` )

VALUES (

'1' //HERE INSERT ONE VALID PRODUCT_ID, FOR EXAMPLE '24'

);

 

After it, the contribution runs without problems.

Link to comment
Share on other sites

Start Product v1.1 is available to download here: http://www.oscommerce.com/community/contributions,2255

It fixed the errors with the database.

Finaly is very simple the fix, I only add some lines at the top of the catalog/admin/star_product.php to check if the actual product_id exists (in the first installation the product_id is '1'), if not, update this value with the first available product_id in your database, with this method the database problems with the first installation are solved, in adition if you delete in the database the product that is actually marked as "star product" you'll not have problems.

 

 

*Note that in two cases you must do the last step written in the manual

 

THANKS FOR USING THIS CONTRIBUTION

Link to comment
Share on other sites

Hi euskopc,

 

Thanks for fixing this great contrib, can you please tell me what I need to do to have the thumbnail picture show instead of the full size pic.

 

Also how do I remove the header of the box?

 

Thanks

 

Mark

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

Link to comment
Share on other sites

Remove the header is very easy, open catalog/includes/modules/star_product.php

and delete or comment this lines:

 

$header_star_product = array();

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

new contentBoxHeading($header_star_product);

 

My web is under develpment and I don't use thumbnails yet, for this reason I can't help you to solve this problem yet, probably I'll have the same problem that you when I begin to introduce products and images in the database and update the contribution to fix this isues.

 

unfortunately, I'm very occupied with other changes in my web (If I can, It will be another contribution, cool but very harder).

 

If you want to release a patch to the thumbnails problem, I will try to help you in everything possible.

 

Thanks

Link to comment
Share on other sites

Hi,

 

This is the replacement code for catalog/includes/modules/star_products.php

 

The image now displays as a thumbnail!

 

All credit goes to Burt who made it possible!

 

<?php

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

 $star_product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "'and pd.language_id = '" . $languages_id . "'");
 $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_tax_class_id, sp.product_id from " . TABLE_PRODUCTS . " p, " . 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 . "'");
 $star_products = tep_db_fetch_array($star_products_query);
 $star_products['products_name'] = tep_get_products_name($star_products['products_id']);
 $star_products["0"] = array('align' => 'center',
         'params' => 'width="100%" valign="top"',
                                     'text' => '<tr>
              <td height="15%" width="85%" class="star-product-title"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $star_products['products_id']) . '">' . $star_products['products_name'] . '</a></td>
        <td align="right" height="100%" width="15%" rowspan="2"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $star_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $star_products['products_image'], $star_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>


      </tr>
      <tr>
        <td height="85%" width="85%" class="star-product">'. $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><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . 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>');
new contentBox($star_products);
?>

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

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I am installing 'Star Products' several times so I can display different products on my main page, after quite a few code changes and a lot of head scratching I have just about finished it.

 

I have also changed the size of the box and the way the products are displayed.

 

The only little glitch I have now is that I need to have the boxes the same size no matter what the product, have a look here to see what I mean.

 

Thanks

 

Mark

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

Link to comment
Share on other sites

Thanks,

 

What I would really like to do is add a field in the admin so that I can enter some text to go below the product instead of having to add extra lines to the english.php file.

 

If you have any ideas on this please let me know, meanwhile I will have a go at doing this.

 

Mark

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

Link to comment
Share on other sites

You need add new "text" field to the database, for example "product_read_more".

Modify tha admin adding a text box (see the actual fields) for show/change the information of the new field "product_read_more".

In the catalog you need modify star_product.php and replace the actual read_more with the content of your new field in the database.

 

Pardon for not help with any code, but I'm not enought time in this moment. If I have more time the next week I try to make features to the Star Product.

Link to comment
Share on other sites

Hi.

I installed Star Product into my shop, the catalog displays STAR PRODUCT BOX and a link into Control Panel, but when I try to click into the link (in the control panel), I read follow message:

 

 

3 - Error writing file './green.log' (Errcode: 27)

 

select sp.product_id, pd.products_id, pd.products_name from TABLE_STAR_PRODUCT sp, products_description pd where pd.language_id = '3'

 

[TEP STOP]

 

 

 

How can I adjust the script?

I need it!!

Thank you for your attention.

Link to comment
Share on other sites

  • 4 weeks later...

Hi Ivan,

 

I hope you can help me with this one, cos I just cannot solve it!

 

If you take a look at my website you will see that I have 3 star products in a row.

 

My problem is that I have had to reduce the size of the tables that the products are in so that it does not screw up the rest of my layout, however the titles are being cut off.

 

Any ideas on how I can get the titles to display correctly without having to rename the product and without having to increase the tables again??

 

This is really bugging me now!

 

Mark

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

Link to comment
Share on other sites

Pardon but I don't understand you. Please try to explain for idiots ;)

 

I see in your webpage that you don't update star products, it's easy:

 

Open star_product.php and search this line:

 

new contentBox($star_products);

 

Replace with this:

 

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

new contentBox($star_products_output);

I think that this fix don't modify your great mods.

Link to comment
Share on other sites

Hi Ivan,

 

Thanks for the update, sorry I never got back to you earlier!

 

I have noticed a small bug in the admin side of star products, it lists all products even when they are not active.

 

Do you know how to fix this??

 

Mark

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

Link to comment
Share on other sites

  • 2 weeks later...

Does anybody have Star Products v1.4 working with products that have attributes assigned? I've got it looking great, formatted the way I want, etc - but if I select a product with attributes, then I just get the header for Star Products, without any information below (No product, no image, no sales copy, no links, nothing).

 

Anybody run up against this problem?

 

Jacob

Link to comment
Share on other sites

Hi Ivan,

 

I hope you can help me with this one, cos I just cannot solve it!

 

If you take a look at my website you will see that I have 3 star products in a row.

 

My problem is that I have had to reduce the size of the tables that the products are in so that it does not screw up the rest of my layout, however the titles are being cut off.

 

Any ideas on how I can get the titles to display correctly without having to rename the product and without having to increase the tables again??

 

This is really bugging me now!

 

Mark

Hi

Can you explain the modification of the script, to have 3 in a row?

 

Thanks

Frank

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