Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

'Specials' section in same format as 'New Products'


joshoisasleep

Recommended Posts

Hi,

Just a quick question... I'm setting up an osCommerce site for the first time. I'm wondering if there's an easy, simple way to create a "Specials" box in the same format as the default "New Products" box that sits at the bottom of the centre column. You know, the one that has 6-9 items as default (i forget) showing.

 

I'm good enough with PHP that I could probably just take a second look and create this feature in a fairly dirty fashion, but I was wondering if there was a clean, easy, built-in trick to doing this that anyone knows about...

Link to comment
Share on other sites

Use the Admin > Catalog > Specials section to place 6-9 products on special offer. Then go to the Specials page in your browser (/catalog/specials.php). All 6-9 products shouldbe displayed - exactly like the What's New box.

Link to comment
Share on other sites

Hi,

Just a quick question... I'm setting up an osCommerce site for the first time. I'm wondering if there's an easy, simple way to create a "Specials" box in the same format as the default "New Products" box that sits at the bottom of the centre column. You know, the one that has 6-9 items as default (i forget) showing.

 

I'm good enough with PHP that I could probably just take a second look and create this feature in a fairly dirty fashion, but I was wondering if there was a clean, easy, built-in trick to doing this that anyone knows about...

 

well, simply copy the file and its associated language files.

change the language defines and replace the query to select specials instead of new products.

Treasurer MFC

Link to comment
Share on other sites

Wicked great thanks a lot! I knew it had to be something simple... glad I asked here before trying to re-create what was already built-in!

 

 

Use the Admin > Catalog > Specials section to place 6-9 products on special offer. Then go to the Specials page in your browser (/catalog/specials.php). All 6-9 products shouldbe displayed - exactly like the What's New box.
Link to comment
Share on other sites

Yeah on second thought that first response didn't answer my question.

 

 

well, simply copy the file and its associated language files.

change the language defines and replace the query to select specials instead of new products.

 

I know, but it's kind of tricky. The query for the Module is done differently than the queries for the infobox, and it's confusing. This may seem dumb, but I haven't really investigated the way the whole thing's written well enough to really understand the query properly... I guess I'll have to.

Link to comment
Share on other sites

Yeah on second thought that first response didn't answer my question.

I know, but it's kind of tricky. The query for the Module is done differently than the queries for the infobox, and it's confusing. This may seem dumb, but I haven't really investigated the way the whole thing's written well enough to really understand the query properly... I guess I'll have to.

 

If you have not done this before then the best strategy is "one step at a time".

 

1) copy the new products module file to a new file and call it products_specials.php for instance.

2) change the variable names in there to reflect specials instead of new products but basically leave the logic alone.

3) include that new file instead of the new products module and see if it works. It will still show new products but that is next. At least now you know that the new display module works, display-wise and you can always go back to this stage if the next stage causes problems.

4) Now it is time to change the query and the fields you want to display. Look at the query from the specials box. It only selects 1 random special but the conditions for determining what is a valid special are relevant and virtually the same for you as are the retrieved fields as you also want to display random specials just more than 1.

 

So now you replace the new products query with a new query based on that specials query and replace the fields that you want to display and test it.

Treasurer MFC

Link to comment
Share on other sites

Hi guys, just an update on this. I did the below, and it sort of worked, but it doesn't work properly as you get things turning up in the specials section that aren't specials... or I did anyway.

 

I was however correct, there IS a SUPER EASY, BUILT-IN way to do this. There's already a module for it, all you have to do is change the main index.php file to point to the "specials.php" module, instead of the "new_products.php" module (line 122 on mine). You don't have to modify anything else, just change which one it points to. It's THAT easy.

 

 

If you have not done this before then the best strategy is "one step at a time".

 

1) copy the new products module file to a new file and call it products_specials.php for instance.

2) change the variable names in there to reflect specials instead of new products but basically leave the logic alone.

3) include that new file instead of the new products module and see if it works. It will still show new products but that is next. At least now you know that the new display module works, display-wise and you can always go back to this stage if the next stage causes problems.

4) Now it is time to change the query and the fields you want to display. Look at the query from the specials box. It only selects 1 random special but the conditions for determining what is a valid special are relevant and virtually the same for you as are the retrieved fields as you also want to display random specials just more than 1.

 

So now you replace the new products query with a new query based on that specials query and replace the fields that you want to display and test it.

Link to comment
Share on other sites

Hi guys, just an update on this. I did the below, and it sort of worked, but it doesn't work properly as you get things turning up in the specials section that aren't specials... or I did anyway.

 

I was however correct, there IS a SUPER EASY, BUILT-IN way to do this. There's already a module for it, all you have to do is change the main index.php file to point to the "specials.php" module, instead of the "new_products.php" module (line 122 on mine). You don't have to modify anything else, just change which one it points to. It's THAT easy.

 

there is no specials.php module.

there is a specials.php box which shows only 1 random special.

Treasurer MFC

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...