Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

One for the experts only


241

Recommended Posts

I am trying to use the new products box on the front (index) page to show a max of 15 products, the store will only have a max of 15 main products.

 

The idea is to use the new products box layout, but to somehow get it to only show the products from a specific category.

 

There are only going to be two categories bead special and products, the bead special is to be accessed via a link in the top nav bar.

 

It is the products category that is to be displayed in the new products box.

 

I have allready modified the new products box.

 

The products category is cPath=22

 

The problem at the moment is that any product being added to the bead special category is showing up in the new product box, this is the way it is meant to be normally, however I want to be able to stop this happening so that only the items in category products cPath=22 are shown there.

 

here is a link test site as you can see the test product item is showing up in the new products box area, however this is a bead special item and is not to be shown there.

 

Does anyone know how to limit the category shown in the new product box so as not to show all categories. :blink:

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I have a work around for most of it now and I am busy moding a couple of files for another section.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

There seems to be plenty of views for this one but not even one possible answer.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

This question has been asked a few times in the past....TWICE by me. It always gets a lot of views...but I too, am still waiting for a solution to it.

A lot of my products are seasonal, and are categorized that way. I would like to be able to change some bit of code as each season arrives to show only the products within a given seasonal category.

There is a mod avaialbe called "Featured products" which is SUPPOSED to do this...but I have never been able to get it to work properly.

Would be interested to hear if you ever get a better solution to this problem.

Link to comment
Share on other sites

When you select new products at random from the database and display them, then before displaying the product, you can make a check on the product if it belongs to the category you need to display.

 

Define this category as a constant variable in application_top.php or in database in "Configuration" table.

Link to comment
Share on other sites

There is a mod avaialbe called "Featured products" which is SUPPOSED to do this...but I have never been able to get it to work properly.

 

I have the featured products up and working on a test site that has two modified featured pages to allow for pulling up of seperate categories to different pages.

 

The test site is for someone else so does not have a lot there but the idea is there, I am trying to get product info to be added to the existing set so as not to require the pulling up of the product info page itself.

 

The front index page is using the first mod featured page and the Bead Specials top nav bar link is using another seperate mod file based on featured.

 

They are controlled from admin.

 

The test site is here Click if any of this is any use to you pm me for some info

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

kagg....it's one thing to tell me *what* to do...but quite another thing altogether to expect me to know *HOW* to do it.

You can lead a horse to water, but don't expect him to give you a detailed analysis of its chemical breakdown. :)

 

I am not a programmer, so I need specific and explicit directions, like "Change line xx in XXX.php from <somecomplicatedlineofcode> to <anotherlineofevenmorecomplexcode>."

Link to comment
Share on other sites

  • 1 year later...

Not sure if this is what people were looking for. There does not seem to be a specific contribution to have a random product for one specific category.

 

After some searching I found this article which helped me.

 

http://www.oscommerce.com/forums/index.php?sho...518entry85518

 

Using the Random Product Contrib:

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

 

In the show_random.php from the contrib.

Replace this code:

if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status='1' and products_image IS NOT NULL ")) {

 

with this code that is similar to the Salvo's suggestions.

 

if ($random_product = tep_random_select("select p.products_id, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " pd " . " where p.products_status = '1' and p.products_id = pd.products_id and pd.categories_id = '25' and products_image IS NOT NULL ")) {

 

I only modified to add the new check for no image file that is in the original show_random.php.

 

Change the pd.categories_id to the id of your specific Category ID(currently it is at 25).

 

Hope that helps somebody

Link to comment
Share on other sites

Steve - maybe I am missing the point of what you are trying to do but the code to load a specific category is already in the module/new_products.php file. You just need to give it the category id of the one you want to load. Is that what you are looking for or am I missing the point?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...