Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

to get the attribute sorted you should be able to do this:

In master listing change the line:

$products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");

to

$products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.products_options_name");

That will sort them alphabetically.

 

If you want them sorted in another order, just add a new field "sortorder" to the products_options table and in phpmyadmin, assign a value for each one (lowest will go first) then use the code:

$products_options_name = tep_db_query("select distinct popt.products_options_id, popt.sortorder, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.sortorder");

 

And of course if you don't know this all goes under case 'MASTER_LIST_OPTIONS': in master_listing.php

 

Backup first, since I havn't tested this at all.

 

Ryan

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Ryan that is great thx for the help, the first change has not made any diff, I will try the second when my head is clearer, many thx for the help even if they do not change anything.

Link to comment
Share on other sites

Hi, I've installed the last update for this contrib, but I've 2 problem ;)

 

1st problem:

 

In application_top.php (catalog side)

 

the old code

    case 'add_slave' :    
                           foreach ($HTTP_POST_VARS as $keyA => $valueA) {
                               if (substr($keyA,0,11) == "Qty_ProdId_") { 
                               $prodId = substr($keyA,11); 
                               if ($valueA <= 0 ) continue; 
                               $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($valueA), $HTTP_POST_VARS['id']);
                             } 
                           }
                           tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                           break;

Works fine, but if I use the new code

 

      case 'add_slave' :    

                             while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) { 
                                if (substr($key,0,11) == "Qty_ProdId_") { 
                                $prodId = substr($key,11); 
                                $qty = $val; 
                                if ($qty <= 0 ) continue; 
                                $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($qty), $HTTP_POST_VARS['id']);
                               } 
                             } 
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;

 

when I add a product in the basket through the product_info page no article has added.

 

2nd problem:

 

I've merged and controlled many times the code for the attribute to the slave product, but it don't work (for me :rolleyes: ), when I select a master product, I see the slave product but it don't have any visible attributes.

Ps. The slave produt have a attributes :D

 

Any idea?

 

Thanks and compliment for this contrib.

 

Jo.

Link to comment
Share on other sites

Hi, i really need help as mentioned before..

 

I am setting the buy now setting to non-zero and still get no buy now button... can anyone help?

 

thanks

Link to comment
Share on other sites

Anyone have a clean version of the contribution up to latest update. If not I may package one up myself after installing everything. I've made a couple of errors and I'm not sure what the issue is.

 

Thanks,

 

David

Link to comment
Share on other sites

I want to add thsi contribution to a ctore. What do i need to downlaod. all the fiels on the contribution page confuse me. Should i install 1.15 then the attributes?

 

 

Ahhhhhh i am so lost.

 

Thanks,

Danny

 

does anyoen have any screen schots i would like to see it.

Link to comment
Share on other sites

I want to add thsi contribution to a ctore. What do i need to downlaod. all the fiels on the contribution page confuse me. Should i install 1.15 then the attributes?

 

 

Ahhhhhh i am so lost.

 

Thanks,

Danny

 

does anyoen have any screen schots i would like to see it.

Currently yes.

 

phobos

It looks like you have 1.1.5 installed, but haven't added the slave attributes mods over it. Get the lastest download. This contains instructions on how to do this.

 

Brian.

Link to comment
Share on other sites

In case anyone is still wondering about attributes sorting, I finally answered a private message about it and decided I would post a copy here as well in case it helps someone.

 

File: includes/modules/master_listing.php

$products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$listing['products_id'] . "' and pa.options_id = '" . (int)$products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' ORDER BY pa.options_values_price ASC, pov.products_options_values_name ASC");

 

If you compare that line to your own code, you'll note the end of the SQL command is different. In the code above, I'm sorting:

  • First by the product's price (referenced by pa.options_values_price [where pa refers to the products attributes table]), in ASCending order... so lowest priced attributes appear first
  • Secondly by the name of the attribute (refenced by pov.products_options_values [where pov is the product options values table], in ASCending, alphabetical order

To change the sort priority, just rearrange the order of the ORDER BY attributes and/or use DESCending order instead of ASCending, etc.

 

Any questions, just ask B)

 

 

...Dono

http://quotacious.com

Link to comment
Share on other sites

PS: Note that the previous message does not give you the flexibility to do anything non-standard, you can just sort from smaller to greater or greater to smaller, not a customized arrangement, as this is the easiest to implement. To make it work, just choose names that will sort the way you want or deal with it :) As an example, in my store it sorts size in the order of Large, Medium, Small, XLarge, XXLarge.... to me this is fine, it almost seems to be deliberate on my part.

 

PPS: I haven't added slaves to all the products in my non-live store yet, I'm working on an Admin modification to Copy-To to add slaves to masters automatically and to add the attributes as well. The only product that is fully setup can be found at here.

Link to comment
Share on other sites

I have a question... is there a way to code Master Products so that any masters that have slaves will not display a quantity box in the generic "product listing place"? I don't know how to word it really but look here...

 

 

HERE

 

and then go to CUSTOM STUFF then you can basically pick any of those items. I want to make it so that that generic "Select quantity: " field isn't their. and If I can make it so it's only gone when a master has a slave.

 

Thanks...

Trevor

 

and I tried searching for information on this concept but is it just me or is the search feature in this forum horrible?

 

Thanks Again

Link to comment
Share on other sites

I have a question... is there a way to code Master Products so that any masters that have slaves will not display a quantity box in the generic "product listing place"?  I don't  know how to word it really but look here...

 

 

HERE

 

and then go to CUSTOM STUFF then you can basically pick any of those items. I want to make it so that that generic "Select quantity:  " field isn't their. and If I can make it so it's only gone when a master has a slave.

 

Thanks...

Trevor

 

and I tried searching for information on this concept but is it just me or is the search feature in this forum horrible?

 

Thanks Again

The 'generic' product listing page does not have a quantity box :)

 

The way to do this is quite simple:-

 

 ? ? ?if (products_master_status == 1) {
? ? ?output_this;
? ? } else {
? ? ?output_this_other;
? ? }

 

Matti

Edited by Johnson
Link to comment
Share on other sites

Does anyone have or know of any instructions to install master products on an existing oscommerce snapshot? Also, has anyone had success doing it?

Edited by computerwiz5
Link to comment
Share on other sites

Does anyone have or know of any instructions to install master products on an existing oscommerce snapshot? Also, has anyone had success doing it?

I don't see the point in doing this - the snapshot is undergoing major changes prior to the release of MS3 :P

 

Matti

Link to comment
Share on other sites

I don't see the point in doing this - the snapshot is undergoing major changes prior to the release of MS3 :P

 

Matti

When is MS3 comming out? Will it be hard to upgrade from it.

 

So no one has done it with out a copy and paste installation?

Link to comment
Share on other sites

When is MS3 comming out?

 

When its ready :)

 

Will it be hard to upgrade from it.

 

It will require a rewrite of the contribution :lol:

 

So no one has done it with out a copy and paste installation?

 

 

There is nothing in contributions for snapshots :blink:

Edited by Johnson
Link to comment
Share on other sites

I thought it would be easy enough to change the product_info.php so that if the item was a master the "select quantity" and drop down box would not appear. However I cannot get it to work. Help anyone? Also TEXT_MASTER is just a variable with '' for the value I added in the includes/english/product_info.php...

 

 

Lines Roughly 185-195 to 200-210

        <td align="right" class="main"><?php
if (products_master_status == 1) {
         echo $TEXT_MASTER;
   } elseif 
($product_info['products_quantity'] > 0) {
     echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); 
     } elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) {
    	 $qty_array = array();
           for ($i=0; $ns = 20, $i <= $ns; $i++) {
           $qty_array[] = array('id' => $i, 'text' => $i); 
       }     
     echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array);
     } else {
     echo TEXT_STOCK;
}
echo tep_draw_separator('pixel_trans.gif', '30', '10');
?>
       </td>
     </tr>
<?php

Link to comment
Share on other sites

 ? ? ? <td align="right" class="main"><?php
? ? ?$qty_array = array();
? ? ? ? ? for ($i=0; $ns = 20, $i <= $ns; $i++) {
? ? ? ? ? $qty_array[] = array('id' => $i, 'text' => $i); 
? ? ? } ? ? ? 
if ($product_info['products_master_status'] == 1) {
? ? ? ? echo TEXT_MASTER;
? } elseif 
($product_info['products_quantity'] > 0) {
? ? echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); 
? ? } elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) {
? ? 
? ? echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array);
? ? } else {
? ? echo TEXT_STOCK;
}
echo tep_draw_separator('pixel_trans.gif', '30', '10');
?>
? ? ? </td>
? ? </tr>

 

 

Dunno why you wish to do this - if you give the Master a zero dollar value they will not appear anyway. If you need to display a price, put it in the products_description :)

 

Matti

Edited by Johnson
Link to comment
Share on other sites

Hi, i am so sorry if i am disturbing the flow of this forum... but i really need to fix this... as i mentioned before..

 

If the answer is it cant be done, just tell me, or if its back on the forum c an anyone please point me to it ?

 

I dont know if i did something wrong while installing it or not, but what i need to do, is to have the slave products display the Buy Now, or Add to cart, on front of each slave item, and a input text instead of a drop down.

Can anyone help me with this please? Thanks.

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