Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

That query will you get you a count of how many reviews there are for the $HTTP_GET_VARS['products_id']

 

You might try something along the lines of:

 

$reviews_query = tep_db_query("select r.products_id, p.products_master from " . TABLE_REVIEWS . " r LEFT JOIN " . TABLE_PRODUCTS . " p USING(products_id) where p.products_master = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

 

Not sure if that will get you exactly what you want - but I believe the product_id that is passed through the GET_VARS is the products_master number - so you need to pull products_id where the products_master is = to the GET_VARS. (I think) :blush:

 

I have a few products I've converted to slaves and their reviews are now not showing on the master product's page.

 

Has anyone had any luck getting former slaves' reviews to show up on the master's page? I was thinking of some sort of join on the line:

 

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

 

in product_info.php.

 

Also, anybody have any luck with the recently purchased module misbehaving in this same way?

~Tracy
 

Link to comment
Share on other sites

  • 2 weeks later...

Okay... this one is beyond my expertise so hopefully one of you will be able to help!?

 

I've got model numbers that look like this:

 

18475630A

94847555A

etc...

 

I've already changed the slave products so they sort by p.products_model and descending, but what I'd like to do is have the products be numbered and sort numerically by the first 2 characters.

 

Example:

 

1 18475630A

2 94847555A

3 85646739A

4 89734987A

 

Where I'm at now they are just sorted by the first character so once the numbers get past 9 they are no longer in numerical order.

 

Here is what I currently have...

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'MASTER_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $master_sql .= " order by p.products_model" . ($sort_order == 'd' ? 'desc' : '');
	  break;
	}
  }
}

Edited by desmoworks
Link to comment
Share on other sites

Your sort has a problem. What if two or more of your model numbers start with the same 2 numbers? There is a contribution that is easy to add that will allow you to order your products any way you want.

 

http://www.oscommerce.com/community/contri...ucts+sort+order

 

Okay... this one is beyond my expertise so hopefully one of you will be able to help!?

 

I've got model numbers that look like this:

 

18475630A

94847555A

etc...

 

I've already changed the slave products so they sort by p.products_model and descending, but what I'd like to do is have the products be numbered and sort numerically by the first 2 characters.

 

Example:

 

1 18475630A

2 94847555A

3 85646739A

4 89734987A

 

Where I'm at now they are just sorted by the first character so once the numbers get past 9 they are no longer in numerical order.

 

Here is what I currently have...

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'MASTER_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $master_sql .= " order by p.products_model" . ($sort_order == 'd' ? 'desc' : '');
	  break;
	}
  }
}

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Your sort has a problem. What if two or more of your model numbers start with the same 2 numbers? There is a contribution that is easy to add that will allow you to order your products any way you want.

 

http://www.oscommerce.com/community/contri...ucts+sort+order

 

Ideally it would sort through the part numbers and put the entire number in order after ordering the first 2. I've made some progress, but it isn't totally correct yet.

 

I'll look at that contribution. Thanks.

Link to comment
Share on other sites

Oh and the reason I have to add a 1, 2, 3, etc... in front of the part numbers is because they line up with numbers on a schematic - so they have to be there so the people know which product goes with which number on the schematic.

Link to comment
Share on other sites

Oh and the reason I have to add a 1, 2, 3, etc... in front of the part numbers is because they line up with numbers on a schematic - so they have to be there so the people know which product goes with which number on the schematic.

 

Even more reason to consider the contribution I suggested. We use it with an "and" statement; "order by p.products_sort_order, pd.products_name" or in your case, "order by p.products_sort_order, p.products_model"

 

This allows us to set a minor "group" without any special coding. For example, list products by sort-order, then alphabetically within that sort order. Sort 1-a, 1-b, 1-c then 2-a, 2-b, 2-c, etc.

 

HTH

George

Edited by Geotex

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

I tried that contribution, but I couldn't get it to do exactly what I wanted as Easy Populate doesn't pull from the configuration table of the database which is what that contribution uses. I didn't want to take the time to make it work so I uninstalled it and went back to work on the php. I have it working correctly now.

 

Here is a test page (on my live site) so anyone interested can see what I was trying to achieve. I can post the code too if anybody wants it.

 

I'm still working on the layout of master products for my purposes so ignore the look of it right now. I'm going to attempt to make it so when there is a master product the add to cart button is moved to the bottom of the page and the review button goes away totally. Also since there is no price for the master I'd like to get rid of the dotted lines inclosing where I usually have the prices.

 

http://www.store.commoto.com/2008-ducati-h...box-p-1903.html

Edited by desmoworks
Link to comment
Share on other sites

Nice site. Very well done.

 

I tried that contribution, but I couldn't get it to do exactly what I wanted as Easy Populate doesn't pull from the configuration table of the database which is what that contribution uses. I didn't want to take the time to make it work so I uninstalled it and went back to work on the php. I have it working correctly now.

 

Here is a test page (on my live site) so anyone interested can see what I was trying to achieve. I can post the code too if anybody wants it.

 

I'm still working on the layout of master products for my purposes so ignore the look of it right now. I'm going to attempt to make it so when there is a master product the add to cart button is moved to the bottom of the page and the review button goes away totally. Also since there is no price for the master I'd like to get rid of the dotted lines inclosing where I usually have the prices.

 

http://www.store.commoto.com/2008-ducati-h...box-p-1903.html

Edited by Geotex

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

When it comes to organizing products in categories, a "master" product is just like any other product. It is just used to round up the "slave" products, no matter where in your catalog they may be located. When organizing "slave" products, they are organized just like any other products. They just have a designator forcing them to display under a "master" product.

 

I think I understand what you mean. You can put the Master in a category and put the slaves in subcategories under the category the master is listed in. This would have an advantage if you really do not care to show the products individually, or if you have a great number of slaves and need to build a tabbed display using JavaScript or AJAX for display.

 

HTH

 

Hello, im using this contrib, works perfectly, but is it possible to create categories for slave products inside master product and then add slaves to specific category.

Thank you

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

When it comes to organizing products in categories, a "master" product is just like any other product. It is just used to round up the "slave" products, no matter where in your catalog they may be located. When organizing "slave" products, they are organized just like any other products. They just have a designator forcing them to display under a "master" product.

 

I think I understand what you mean. You can put the Master in a category and put the slaves in subcategories under the category the master is listed in. This would have an advantage if you really do not care to show the products individually, or if you have a great number of slaves and need to build a tabbed display using JavaScript or AJAX for display.

 

HTH

 

 

And may be you know the way how to add categories inside master product in product_info.php

so we will have not only list of slaves but

- category1

---- slave1

---- slave2

---- slaven

- category2

---

and so on

 

I tried to create master product in "cat1" and then create slave products for master in subcat1 of cat1 and i see nothing happened - the same list of slaves and only new subcategory appears in the box categories.php

Link to comment
Share on other sites

And may be you know the way how to add categories inside master product in product_info.php

so we will have not only list of slaves but

- category1

---- slave1

---- slave2

---- slaven

- category2

---

and so on

 

I tried to create master product in "cat1" and then create slave products for master in subcat1 of cat1 and i see nothing happened - the same list of slaves and only new subcategory appears in the box categories.php

 

As a matter of fact, I do. But you don't use subcategories. you use tabs. If you know AJAX, you can figure it out. I am still under an agreement so won't release the code yet.

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

  • 4 weeks later...

The simplest things with Master Products and an already heavily modified store are:

 

  1. In admin create a categories2.php file rather than trying to merge with other mods
  2. On the products page use conditional clauses to separate output from different mods
  3. For slaves with multiple masters use a comma separated list of products_master in the database and FIND_IN_SET in the front end query

 

My understanding is that Master Products was released to "show the way" with solving particular problems rather than an out and out solution. Its interesting to note that this kind of logic is now being included in osC3: http://www.oscommerce.com/forums/index.php?showtopic=275420

 

With a bit of creativity it can be used in many different ways. Here are a couple of sites by its original creator to show this:

 

http://totallyunderwear.co.uk - here it is used for clothing sizes (stock control)

 

http://www.twisteddownloads.com - here it is used for music albums/tracks (you can buy either full albums or individual tracks). There is even an option to view tracks (slaves) while browsing the catalog.

 

 

Bill

Link to comment
Share on other sites

Hi

 

I've looked thorugh this forum and failed to find an answer - please can someone help!!!

 

All i want to do is change the quantity text box to a dropdown and for the default values in each box to be zero?

 

I've experimented myself and have so far failed to find the answer

 

Really appreciate any help

 

Thanks

Link to comment
Share on other sites

Last question...

 

I downloaded version "v 1.2 assembled" by "Kit"

 

Is that a good install or is there a better one?

 

Thanks again

 

Ricardo

 

I think that is the version I'm using if I'm not mistaken.

Link to comment
Share on other sites

Hello , I have installed your contribution in my store for selling music. any products that are slave products are not available for download. I think this has something to do with the attributes not working on the slave products( i read on the download page that this was coming soon). I was hoping if you had a fix that would allow me to configure this functionality before the next release.

 

Thank you, Ade'

Link to comment
Share on other sites

Hello , I have installed your contribution in my store for selling music. any products that are slave products are not available for download. I think this has something to do with the attributes not working on the slave products( i read on the download page that this was coming soon). I was hoping if you had a fix that would allow me to configure this functionality before the next release.

 

Thank you, Ade'

 

The author of the contribution is long gone. Only "help" is self-help or possibly some assistance from a few of us using the contribution, who may be able to help if we have already solved a similar problem.

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

The author of the contribution is long gone. Only "help" is self-help or possibly some assistance from a few of us using the contribution, who may be able to help if we have already solved a similar problem.

 

George

 

Rats! do you know anyone that can configure the slaves to read the download attributes

Link to comment
Share on other sites

Im not sure if you saw my response George. have you seen anything about product attributes in slave products?

 

I get notified, but can't always respond right away. Normal attributes should work okay. I don't know about download attributes, because the only thing I have seen specifying download attributes are a couple of contributions that I am having a real problem getting to work with this contribution. Don't know how much is Master-Slave, and how much is other required contributions I have installed.

 

I also am having problems getting Downloads Controller v5.3.2b for Online Merchant v2.2 Release Candidate 2a (v5.3.2c) to work on a bare RC2a. Once I solve that, meaning did I miss something or is there something in my set up causing the problem, I may have a solution for you. (On my test bench, I have WinXP Pro running Apache 2 and use PHP 5.2.x and mySQL 5.0.x, but have to have Register Globals on due to old contributions that have not been properly updated)

 

George

GEOTEX from Houston, TX

 

(George)

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