Jump to content
Latest News: (loading..)
Sign in to follow this  
PupStar

Star Product 1.6 Pimped by Mindsparx

Recommended Posts

forget it I have it sorted. It was because I had no description entered into the test product! >_<

Hi,

 

I have installed the above contribution on 2.3.1 and it works to a degree. The admin panel is working correctly and inserting the products_id into the star_product table.

 

However the catalog side is not displaying the product, just an empty box with no image, no price etc.

 

Would someone take a look for me and see if they can see what I am missing?

 

<?php

 function tep_star_product_with_attributes($products_id) {
 $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'");
 $attributes = tep_db_fetch_array($attributes_query);

 if ($attributes['count'] > 0) {
   return true;
 }
 else {
   return false;
   }
 }

 $star_products_query = tep_db_query("select substring(pd.products_description, 1, 100) 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 . "'");

 $star_products = tep_db_fetch_array($star_products_query);
 $star_products['products_name'] = tep_get_products_name($star_products['products_id']);
 $evita_cortar_palabras = explode( ' ',  $star_products["products_description"] );
 array_pop( $evita_cortar_palabras );
 $star_products["products_description"]  = implode( ' ', $evita_cortar_palabras );

 $star_products_price = $star_products;
   if (tep_not_null($star_products_price['specials_new_products_price'])) {
     $new_price = '<span class="starPrice">' . $currencies->display_price($star_products_price['specials_new_products_price'], tep_get_tax_rate($star_products_price['products_tax_class_id'])) . '</span><br>';
     $new_price .= '<span  style="color:#ffffff;font-size:12px; font-weight:normal;"><s>' . $currencies->display_price($star_products_price['products_price'], tep_get_tax_rate($star_products_price['products_tax_class_id'])) . '</s></span>';
   } else {
     $new_price = '<span class="starPrice">' . $currencies->display_price($star_products_price['products_price'], tep_get_tax_rate($star_products_price['products_tax_class_id'])). '</span>';
   }



 if (!tep_star_product_with_attributes($star_products['products_id'])) {
 $star_products["0"] = array('align' => 'left',
			      'params' => 'width="100%" valign="top" padding="0"',
                                     'text' => '
							<table class="box_outline3" width="99%"  border="0" cellpadding="0" cellspacing="0" >
 <tr>
   <td width="191"  rowspan="3" align="right" valign="top" background="images/star_img.gif"><table width="191"  border="0" cellpadding="0">

     <tr>
       <td width="30" align="left" valign="top"> <div   style="padding-left:7px; padding-top:15px;  " align="left"  >'.$new_price . '</div></td>
       <td height="115" align="right" valign="middle"><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>
   </table>
  </td>
   <td height="3" align="right" class="starTitle">    </td>
 </tr>
 <tr>
   <td align="left" valign="top"><div style="padding-left:20px;">

<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '"><span class="starName" >' . $star_products['products_name'] . '</span></a><br />
<span class="starTitle" >'.STAR_TITLE.'</span><br />
<span class="starProdDesc" >
    <div style="padding-right:15px;" >'. strip_tags($star_products["products_description"]) . '...</div></span></td>

 </tr>

</table>');
$star_products_output = array_slice($star_products, sizeof($star_products)-1);
new contentBox1($star_products_output);

}


else {
 $star_products["0"] = array('align' => 'center',
			      'params' => 'width="100%" valign="top"',
                                    'text' => '
			      		<table class="box_outline3" width="99%"   border="0" cellpadding="0" cellspacing="0" >
 <tr>
   <td width="191"  rowspan="3" align="right" valign="top" background="images/star_img.gif"><table width="191"  border="0" cellpadding="0">

     <tr>
       <td width="30" align="left" valign="top"> <div   style="padding-left:7px; padding-top:15px;  " align="left" >'.$new_price . '</div></td>
       <td height="115" align="right" valign="middle"><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>
   </table>
  </td>
   <td height="3" align="right" class="starTitle">    </td>
 </tr>
 <tr>
   <td align="left" valign="top"><div style="padding-left:20px;">

<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '"><span class="starName" >' . $star_products['products_name'] . '</span></a><br />
<span class="starTitle" >'.STAR_TITLE.'</span><br />
<span class="starProdDesc" >
  <div style="padding-right:15px;" > '. strip_tags($star_products["products_description"]) . '...</div></span></td>

 </tr>
</table>');

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

}

?>

 

Thanks

 

Mark

Edited by PupStar

Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

In my case the catalog side displays fine, but the admin page:

 

"http://www.myshop.com/admin/star_product.php"

 

is not displaying correctly. The left column has lost it formatting and the text from the star_product.php displays over the entire page, overlapping the left column.

 

Help on that?

 

Thanks


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

In my case the catalog side displays fine, but the admin page:

 

"http://www.myshop.com/admin/star_product.php"

 

is not displaying correctly. The left column has lost it formatting and the text from the star_product.php displays over the entire page, overlapping the left column.

 

Help on that?

 

Thanks

 

Im not sure if you have installed the 2.2 version or the oscommerce 2.3 version that i released yesterday,

 

Anyway, can you post the source code for that page so i can see. I have my contribution mindsparx admin installed but it should work with the standard admin... is there any one else with standard admin that have this problem?

 

/janne

Edited by iankil

My contributions

Mindsparx admin for 2.2

Mindsparx admin for 2.3

Mindsparx admin for 3.0

Mindsparx specials 2.2

Starproduct pimped for 2.2

Starproduct pimped for 2.3

Mindsparx template osc Sport 2.2

Mindsparx template Horizon 2.3

+ a few more...

Share this post


Link to post
Share on other sites

Im not sure if you have installed the 2.2 version or the oscommerce 2.3 version that i released yesterday,

 

Anyway, can you post the source code for that page so i can see. I have my contribution mindsparx admin installed but it should work with the standard admin... is there any one else with standard admin that have this problem?

 

/janne

 

My apologies, I am using the 2.3.1 version you just posted.

 

I hope I was clear on describing the problem on teh admin page. To rephrase, the catalog side is fine...but on the admin side the page is there, but it "bleeds" over onto the left column where the menus are. The page is functional, I can select the product and activate it, etc. It's just the distortion of the page that is present.

 

The install is pretty simple, especially on the admin side and I went over that a couple times to see if I made any errors (which is possible), but I just don't see a mistake in my install at this point.

 

It just came to me, that while I think the sql processed properly when I ran that through PHPMyAdmin, I should look at the database to verify that all got set up. I will do that tonight, I am currently at my "day job" and can't get to it right now.

 

If you'd like I could post a screenshot here so you can see what I am seeing.

 

Thanks for responding.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

To rephrase, the catalog side is fine...but on the admin side the page is there, but it "bleeds" over onto the left column where the menus are. The page is functional, I can select the product and activate it, etc. It's just the distortion of the page that is present.

 

A follow up here on this and my disclaimer is that I am far from being an experienced coder. But it looks like I did get this sorted this out and got it working correctly for me.

 

In looking closer at admin/star_product.php and comparing with the review.php and specials.php coding under admin>>catalog it looked like there was coding in the star_product.php that was causing my situation. I looks like code intended for perhaps 2.2.

 

Anyway, I removed the require header, column left, footer and body code, and put in require template_top.php and template_bottom.php coding as per those other pages I referred to. That fixed things up.

Edited by altoid

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Thanks for explaining, i know what it is... I have uploaded a new version and please let me know it that one works ok for your store.

 

The problem was some left over codes from version 2.2 that only shows up in explorer, i hardly use explorer so i missed it, but as a developer i should... shame on me :blink:

 

/Janne


My contributions

Mindsparx admin for 2.2

Mindsparx admin for 2.3

Mindsparx admin for 3.0

Mindsparx specials 2.2

Starproduct pimped for 2.2

Starproduct pimped for 2.3

Mindsparx template osc Sport 2.2

Mindsparx template Horizon 2.3

+ a few more...

Share this post


Link to post
Share on other sites

Thanks for explaining, i know what it is... I have uploaded a new version and please let me know it that one works ok for your store.

 

The problem was some left over codes from version 2.2 that only shows up in explorer, i hardly use explorer so i missed it, but as a developer i should... shame on me :blink:

 

/Janne

 

Janne, I have replaced my tweaked version of that file with yours. All works very well.

 

Thank you.

 

I am also going to use your 2.2 version of this add on for a couple 2.2 stores I run.

Thank you for your work.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

I really like this contribution and used it on a v.2.2 store. I am now building a 2.3 store and have installed the updated star product contribution. It has installed ok in that I can update via admin and it does update the database but I have two problems now. Firstly when I tried to activate star product, I got this error message

 

Warning: Cannot modify header information - headers already sent by (output started at /home/ikbyprls/public_html/tecpro/includes/template_top.php:14) in /home/ikbyprls/public_html/tecpro/includes/functions/general.php on line 34

 

Also it does not appear at all on the home page - no image, no text so I am guessing it has not really activated, although the icon in admin is now showing green.

 

Can anyone point me in the right direction please

Share this post


Link to post
Share on other sites

... it does not appear at all on the home page - no image, no text so I am guessing it has not really activated, although the icon in admin is now showing green...

I worked it out, I had pasted the relevant text into the index.php but by mistake into the wrong place. The star product does work and was showing clearly when products were being listed but not on the 'initial' index page with the welcome text etc.

 

re. the error message, I think this may have been due to other changes I was making on the site

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×