Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Specials_Module


surfalot

Recommended Posts

  • 4 weeks later...
  • Replies 120
  • Created
  • Last Reply

Top Posters In This Topic

I think there is a bug in product_specials.php, you didn't call for the database table name for products and products_description which would cause problems for people using table prefixes like me

 

  if ( (LIMIT_PRODUCT_SPECIALS_SCOPE=='true') && !empty($new_products_category_id) ) { /// We are in category depth 
$product_specials_query = tep_db_query("select distinct p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, specials s where p.products_status='1' and p.products_id=s.products_id and p.products_id=pd.products_id and pd.language_id='".(int)$languages_id."' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and s.status='1' and c.parent_id = '" . (int)$new_products_category_id . "' order by rand() limit ".MAX_DISPLAY_PRODUCT_SPECIALS); 
 } else if ( (LIMIT_PRODUCT_SPECIALS_SCOPE=='true') && !empty($product_category_id) ) { // products info page
$product_specials_query = tep_db_query("select distinct p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, specials s where p.products_status='1' and p.products_id=s.products_id and p.products_id=pd.products_id and pd.language_id='".(int)$languages_id."' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and s.status='1' and c.categories_id = '" . (int)$product_category_id . "' order by rand() limit ".MAX_DISPLAY_PRODUCT_SPECIALS);

 

I may be wrong as I'm not an experienced programmer, I also do not know how to solve it.

Edited by Skipster07
Link to comment
Share on other sites

Hi there,

 

I've encountered a problem when running SQL.

 

Here's the error :

 

Erreur

requ?te SQL:

INSERT INTO `configuration_group`
VALUES ( 6123, 'Specials Module', 'Product Specials Module Options', 50, 1 );

MySQL a r?pondu:Documentation
#1062 - Duplicate entry '6123' for key 1

 

Is it bad, doctor ? :'(

Link to comment
Share on other sites

  • 4 weeks later...
Nice contrib. Im having a problem with the style sheet install part.

When i install it my arrows go a bit strange

I can't see anything in the code that would cause that. I would have to see the page output to offer any suggestions

Link to comment
Share on other sites

also, i decided to switch all the option in admin to false until this is sorted but i've just noticed that the specials are still being displayed on the product pages.

The ouput page is the web page that is output from the code.

 

your problem is the style, you have a padding:3px; which is forcing the link to expand 6 pixels around a link. So when you add the extra classes to this style, you get the expansion and misaligned image. either remove the padding or create a new style for this contrib.

 

your style

 

TD.infoBoxHeading {

font-family: Verdana, Arial, sans-serif;

font-size: 12px;

font-weight: bold;

background: #66A0D5;

color: #ffffff;

padding: 3px;

}

 

create new style(or remove padding from style above and complete instructions).

 

TD.infoBoxHeading A,

TD.infoBoxHeading A:hover {

font-family: Verdana, Arial, sans-serif;

font-size: 12px;

font-weight: bold;

background: #66A0D5;

color: #ffffff;

}

 

 

updated instruction for product info page:

 

 

==============================

 

 

---------------------------------------

OPEN catalog/product_info.php and find:

---------------------------------------

 

 

	  <tr>
	<td>
<?php
if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
 }
?>
	</td>
  </tr>

 

 

----------

add after:

----------

 

<?php 
/* Begin: Product Specials  */ 
if (SHOW_PRODUCT_SPECIALS_ON_PRODUCTS=='true') {
?>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_SPECIALS); ?></td>
	  </tr>
<?php 
}
/* End: Product Specials  */ ?>

 

==============================

Link to comment
Share on other sites

Todd,

 

Thanks for the reply.

 

Removing the padding didn't work as it caused the same problem as before, adding

TD.infoBoxHeading A,

TD.infoBoxHeading A:hover {

font-family: Verdana, Arial, sans-serif;

font-size: 12px;

font-weight: bold;

background: #66A0D5;

color: #ffffff;

}

 

to the stylesheet fixed it though, thanks.

 

The second problem still is a problem. I added the code you said but the specials are still displayed, and now when i enable them i get 2 lots of specials displayed.

 

Daz

Link to comment
Share on other sites

The second problem still is a problem. I added the code you said but the specials are still displayed, and now when i enable them i get 2 lots of specials displayed.

The padding was the problem, maybe you didn't quite get that right.

as far as the products info showing when turned of goes, you must have added a second include for the module instead of replacing the old code. that's the only way it could appear twice.

Link to comment
Share on other sites

The padding was the problem, maybe you didn't quite get that right.

as far as the products info showing when turned of goes, you must have added a second include for the module instead of replacing the old code. that's the only way it could appear twice.

 

:blush: Thanks mate, that's sorted it :thumbsup:

Link to comment
Share on other sites

Im getting new products listings not specials. Any help would be appreciated. Also, the settings show up in the admin section but applying them does not do anything.

sounds like you have not completed the changes. Look over the instructions again and verify each step. Note there is one step that says to look for TWO occurrences.

Link to comment
Share on other sites

I rechecked my installation and its still not working - I have sts installed but i dont think that effects it. Think of anything?

depending on the version and how you have it setup, yes it will. STS messes everything up. If you don't know exactly how it works you will have trouble with most of the contribs you add after it. I wish there was more warning in that contribution.

 

You need to be more specific because I'm not psychic. Its hard to help someone when all they can say is it's not working. This contribution add the specials box to 4 areas of the shop. Which area is not showing? If you are telling me it's not showing up in any of them, then you need to take a closer look at the instructions or STS to find your problem. I know it's not much help, but it's par with the info you're providing. ;)

Link to comment
Share on other sites

Hi there again Todd.

 

In the admin section for this contrib the first option states

 

"Show only Product Specials that are under the current category level."

 

I have this set to true, but it doesn't seems to work with the "Show Specials on Products List Pages" option.

 

Specials are listed on the product pages even if there are no relevant specials for that section, is that correct?

 

Also, when going to certain page, such as this one

http://www.chapelradiocontrol.com/shop/tyr...th-c-56_64.html

I get things other than tyres listed in specials, is that correct?

 

If this is correct what is the first option supposed to do?

 

Thanks

 

Daz

Link to comment
Share on other sites

In the admin section for this contrib the first option states

"Show only Product Specials that are under the current category level."

I have this set to true, but it doesn't seems to work with the "Show Specials on Products List Pages" option.

yup flawed logic, try the package I just uploaded. There are instructions for the 2 step upgrade in the "upgrade_instructions" folder. I had to integrate the more robust limiting code from my Open Feature Sets contrib. Should be right now. It should grab products listed in the current category and any categories deeper then the current, but not above.
Link to comment
Share on other sites

me again, sorry

 

I've just noticed another problem.

 

If i go to a category without any specials it doesn't show anything as expected. But if i pick a manufacturer from the drop down list it displays specials even if that company has non

 

Daz

Link to comment
Share on other sites

at this time no provision has been made for the manufacturers filter. I can add it to the next version when time allows.

 

if you wish to simply not have it display on a manufacturer's filter you can do this.

 

find in /catalog/index.php

 

SHOW_PRODUCT_SPECIALS_ON_PRODUCTS_LIST=='true'

 

change to:

 

SHOW_PRODUCT_SPECIALS_ON_PRODUCTS_LIST=='true' && !isset($HTTP_GET_VARS['manufacturers_id'])

Link to comment
Share on other sites

at this time no provision has been made for the manufacturers filter. I can add it to the next version when time allows.

 

if you wish to simply not have it display on a manufacturer's filter you can do this.

 

find in /catalog/index.php

 

SHOW_PRODUCT_SPECIALS_ON_PRODUCTS_LIST=='true'

 

change to:

 

SHOW_PRODUCT_SPECIALS_ON_PRODUCTS_LIST=='true' && !isset($HTTP_GET_VARS['manufacturers_id'])

 

OK mate, thanks for the reply, i've done that :thumbsup:

Link to comment
Share on other sites

Hi all,

 

Im working on a new site and try to instal the special module. but I get some small errors that i could not know where they are coming from.

 

Warning: Missing argument 3 for display_price() in /home/quick05/public_html/includes/classes/currencies.php on line 73

 

Warning: Missing argument 3 for display_price() in /home/quick05/public_html/includes/classes/currencies.php on line 73

 

also the price is not the same any more, could somebody advice me

 

please have a look at: www.quickspot.be

 

regarding

Rico

Edited by quickspot
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...