Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Specials on Default.php


nicko107

Recommended Posts

Hi

 

I search for a forum support of this contribution but i don?t find, I create this and upload a new version:

 

Specials on Default 3.0

 

URL of contribution:

 

http://www.oscommerce.com/community/contributions,123

 

 

 

FEATURES of version 3:

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

 

- DISPLAY IN MAIN PAGE AND CATEGORIES* PAGE:

 

include module of version: "Specials on Default under categories too" by Ethan Shalev of 20 Feb 2004

for display specials module in categories with subcategories*

 

- CHOOSE IN ADMIN SHOW OR NOT THE MODULE: can select show or not the module of specials in main page and / or categories separatelly.

ability in admin to select show o not the specials module in Main page and / or Categories page.

(based in modification by expert for Star Product contribution (http://www.oscommerce.com/community/contributions,2255) all credits of this all for him)

 

- SELECT IN ADMIN NUMBER OF PRODUCTS SPECIALS TO DISPLAY IN MODULE: add the option to select in admin in menu Configuration the number of products to display in the module.

 

- ADDED define for TABLE_HEADING_DEFAULT_SPECIALS for display the title of module

 

 

- install instructions in english and spanish.

 

- sql file in english and spanish

 

- screenshots of module specials and configuration in admin.

 

- folder with all files that modified this contribution to upload for new shops without modifications in files.

 

- see at the end instructions to how to let default on specials work together with TotalB2B (solution by Howard (wheeloftime))

 

 

 

DEMO:

------

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

 

(this demo include graphics modification of modules and boxes that not include this contribution)

 

 

 

nicko107

Link to comment
Share on other sites

Here are some screenshots of admin configuration:

 

 

The module can set in admin to not display:

 

setdisplayornotinadminpf6.png

 

 

And the number of products to show in module specials:

 

setproductstodisplayinadminui0.png

 

 

 

The pack include instructions to update older versions to version 3

Edited by nicko107
Link to comment
Share on other sites

  • 3 weeks later...

Can someone please make it possible for this contribution to display random products instead of static latest specials only?

 

I cant seem to get the array to fetch random products :'(

 

i.e.

Could be based on the Specials box (usealy) on the right... Where a random product is shown within a certain search range, stated in the admin (MAX_RANDOM_SELECT_SPECIALS).

Link to comment
Share on other sites

  • 2 weeks later...
Can someone please make it possible for this contribution to display random products instead of static latest specials only?

 

I cant seem to get the array to fetch random products :'(

 

i.e.

Could be based on the Specials box (usealy) on the right... Where a random product is shown within a certain search range, stated in the admin (MAX_RANDOM_SELECT_SPECIALS).

 

 

Hi

 

In:

 

catalog/includes/modules/default_specials.php

 

Find this:

 

order by s.specials_date_added DESC limit

 

replace:

 

order by rand() DESC limit

 

 

 

and find this:

 

order by p.products_date_added desc limit

 

replace:

 

order by rand() DESC limit

 

 

 

nicko107

Link to comment
Share on other sites

Hi

 

There are two locations to add the code in catalog/index.php

 

to display in the main page is in about line 324, before this:

 

		  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>

 

 

adding this code appear the specials module:

 

 

<?php
// DEFAULT SPECIALS START...
		   if (SHOW_DEFAULTSPECIALS=="true") {
?>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
  <tr>
 <td><?php include(DIR_WS_MODULES . FILENAME_DEFAULT_SPECIALS); ?></td>
  </tr>

<?php
  }
// DEFAULT SPECIALS END...
?>

 

 

 

and for display in categories, about line 130 before this:

 

		  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>

 

add this:

 

<?php
// DEFAULT SPECIALS ON CATEGORIES START...
		   if (SHOW_DEFAULTSPECIALS_CATEGORY=="true") {
?>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
  <tr>
 <td><?php include(DIR_WS_MODULES . FILENAME_DEFAULT_SPECIALS); ?></td>
  </tr>

<?php
  }
// DEFAULT SPECIALS ON CATEGORIES END...
?>

 

 

 

Note: the code is different for have the option to active / no active the module in admin

 

 

After do the all modifications then in admin there are new options in:

 

Admin >> Catalog menu >> Specials

 

"Display / not Display module Specials in Main Page:

 

and:

 

"Display / not Display module Specials in Categories with subcategorie:"

 

and two icons:

- a green icon (for active the module)

- and a red icon (for desactive the module)

 

click on green icon for active and show the module in catalog.

 

with this new options is possible select show the module in Main page and / or categories page

Link to comment
Share on other sites

  • 2 weeks later...

i installed this contribution and followed all steps in the install txt. But i get these errors on my index page where the specials are supossed to show up:

 

Warning: main(includes/modules/FILENAME_DEFAULT_SPECIALS): failed to open stream: No such file or directory in /httpdocs/catalog/index.php on line 330

 

Warning: main(includes/modules/FILENAME_DEFAULT_SPECIALS): failed to open stream: No such file or directory in /httpdocs/catalog/index.php on line 330

 

Warning: main(): Failed opening 'includes/modules/FILENAME_DEFAULT_SPECIALS' for inclusion (include_path='.:/usr/share/pear') in /httpdocs/catalog/index.php on line 330

 

line 330 in index.php is

 

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

 

default_specials.php is located in /httpdocs/catalog/includes/modules/

 

does anybody have a clue whats going wrong? :blink:

Edited by casualTG
Link to comment
Share on other sites

i installed this contribution and followed all steps in the install txt. But i get these errors on my index page where the specials are supossed to show up:

line 330 in index.php is

default_specials.php is located in /httpdocs/catalog/includes/modules/

 

does anybody have a clue whats going wrong? :blink:

 

 

hi

 

try this:

 

in file:

 

catalog/includes/filenames.php

 

find:

 

define('FILENAME_DEFAULT', 'index.php');

 

add after:

 

define('FILENAME_DEFAULT_SPECIALS', 'default_specials.php');

 

 

 

this define the file

Link to comment
Share on other sites

  • 3 months later...

Hi,

 

I have a similar problem. No error messages appear, everything seems to have been added ok, but no specials appear on my main page.

 

My code is:

 

<?php

// DEFAULT SPECIALS ON CATEGORIES START...

 

if (SHOW_DEFAULTSPECIALS_CATEGORY=="true") {

?>

<tr>

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

</tr>

<tr>

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

</tr>

<?php

}

// DEFAULT SPECIALS ON CATEGORIES END...

?>

<tr>

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

</tr>

<tr>

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

</tr>

 

 

 

 

AND

 

 

<?php

// DEFAULT SPECIALS START...

if (SHOW_DEFAULTSPECIALS=="true") {

?>

<tr>

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

</tr>

<tr>

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

 

</tr>

<?

}

// DEFAULT SPECIALS END...

 

?>

<tr>

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

</tr>

-->

<tr>

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

</tr>

</table></td>

<?php

} else { // default page

?>

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

<tr>

<td>

<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>

</td>

</tr>

</table>

</td>

<?php

 

I would love some help.

 

Thanks,

 

Debbie :huh:

Link to comment
Share on other sites

  • 1 month later...

Thanks for the contribution. Works fine.

 

But I want only show 1 article at a row, because I want to show some description, too.

 

Can't find how to do this. Can anybody help?

 

Thanks

 

Nick

Link to comment
Share on other sites

  • 1 month later...

Hi I just installed V3. I have a weird problem. When specials are displayed in the main page, the crossed-out old price is higher than the new special price which is the proper behavior according to what's in the database. However, if I click on a category to go to the categories page, then the crossed-out price displayed is the same as the special price (They both show the same special price, one is crossed out and the other is not). If I click on the product, the product_info.php page displays both the crossed out old price and the new special price properly.

Link to comment
Share on other sites

  • 2 months later...
Hi I just installed V3. I have a weird problem. When specials are displayed in the main page, the crossed-out old price is higher than the new special price which is the proper behavior according to what's in the database. However, if I click on a category to go to the categories page, then the crossed-out price displayed is the same as the special price (They both show the same special price, one is crossed out and the other is not). If I click on the product, the product_info.php page displays both the crossed out old price and the new special price properly.

 

Hi,

 

I have the same problem as you ... any solutions to this?, When specials are displayed in the main page everything looks great but if I click on a category to go to the categories page, then the crossed-out price displayed is the same as the special price. Any suggestions?.

 

Thanks!

 

J.

Link to comment
Share on other sites

  • 1 year later...
Hi,

 

I have the same problem as you ... any solutions to this?, When specials are displayed in the main page everything looks great but if I click on a category to go to the categories page, then the crossed-out price displayed is the same as the special price. Any suggestions?.

 

Thanks!

 

J.

 

 

Hi !

 

I have a same problem :(

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