Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

Thanks for your help Matti (and Trogette). Unfortunately for me I now have this error:

 

Fatal error: Call to undefined function: tep_get_products_master_status() in /home/mpmorg/public_html/shop/includes/application_top.php on line 399

Edited by mpm
Link to comment
Share on other sites

Do you have any stock figures for the normal products?

 

Any ideas why only slave products (and not normal products as well) will add to my cart?
Link to comment
Share on other sites

Thanks for your help Matti (and Trogette). Unfortunately for me I now have this error:

 

Fatal error: Call to undefined function: tep_get_products_master_status() in /home/mpmorg/public_html/shop/includes/application_top.php on line 399

 

Ahh... I think that function is only in admin in the current version - I have it in the catalog in my development version - put this in /includes/functions/general.php:

 

 

//Get products master status 
function tep_get_products_master_status($product_id) {

  $product_query = tep_db_query("select products_master_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
  $product = tep_db_fetch_array($product_query);

  return $product['products_master_status'];
}

Edited by Johnson
Link to comment
Share on other sites

Thanks Matti.

 

I think I've worked out how to fix the empty shopping cart - all I need to know is how to force the drop down quantity box on normal products to default to '1' product selected - or - somehow remove this from the normal products altogether (haha!)

Link to comment
Share on other sites

Thanks Matti.

 

I think I've worked out how to fix the empty shopping cart - all I need to know is how to force the drop down quantity box on normal products to default to '1' product selected - or - somehow remove this from the normal products altogether (haha!)

 

I sent a PM about this but I'm not sure it got through, so I'll post the code here:

 

<?php
if ($product_info['products_price']>0) {
/*  Master Products changed for hidden field instead of drop-down for quantity		 
$qty_array = array();
for ($i=0; $n2 = (($product_info['products_quantity'] < 20) ? $product_info['products_quantity'] : 20), $i <= $n2; $i++) {
$qty_array[] = array('id' => $i, 'text' => $i); 	 
}	  
	*/

?>
  <tr>
	<td colspan="2" align="right" class="main"><?php if ($product_info['products_quantity'] > 0) {
  echo tep_draw_hidden_field('Qty_ProdId_' . $product_info['products_id'], $value = (int)1); 
	} elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) {
/*  Master Products changed for hidden field instead of drop-down for quantity 
	  $qty_array = array();
	for ($i=0; $ns = 20, $i <= $ns; $i++) {
	$qty_array[] = array('id' => $i, 'text' => $i);
	} 	   */


  echo tep_draw_hidden_field('Qty_ProdId_' . $product_info['products_id'], $value = (int)1);
  } else {
  echo TEXT_STOCK;
}
echo tep_draw_separator('pixel_trans.gif', '30', '10');
?>

 

If it doesn't add to basket properly I'll look at my add_slave case stuff in application_top but that's been hacked to fit with qtpro...

 

Now for my latest (and hopefully last for a while! I need to sort my own contribution out!) issue... The Options in the master listing isn't showing up. Any ideas what's going on there? It's in the Slave Listing section in admin, afaict the syntax is right (matching titles to database entries and stuff) just not there in the master listing in product_info.php. Not showing up in the 'view source' html code at all. Doesn't seem to make sense for it to show up in admin but not on the catalogue pages. Help anyone?

Link to comment
Share on other sites

That's what I did. I could have tinkered with the stuff in master_listing.php but it would have taken more brain-ache than I can face atm :lol:

 

or (duh! just sussed this out!) the MASTER_LIST_IMAGES $lc_text line could look like this:

 

$lc_text = '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>';

 

It still doesn't resize and I have multiple images for some files but I got round that by adding the links to them to the description on this page

 

But if the javascript for the pop-up could be worked into the list somehow, that would be cooler.

Link to comment
Share on other sites

Now for my latest (and hopefully last for a while! I need to sort my own contribution out!) issue... The Options in the master listing isn't showing up. Any ideas what's going on there? It's in the Slave Listing section in admin, afaict the syntax is right (matching titles to database entries and stuff) just not there in the master listing in product_info.php. Not showing up in the 'view source' html code at all. Doesn't seem to make sense for it to show up in admin but not on the catalogue pages. Help anyone?

 

*cough* never mind, found it...

Link to comment
Share on other sites

but is there a way of only showing the options column when there are options? :huh:

 

 

Anything can be accomplished with a little imagination: my latest work using Master Products logic :) (this is not yet optimised for opera)

 

Conditional clauses will do what you want:

 

   if($this == true) {
 $mything = $first_thing;
 } else {
 $mything = $second_thing;
 }

 

Matti

Edited by Johnson
Link to comment
Share on other sites

mmm... it's a question of where to put it and what to put in it... how to remove the options case from the column array *sctratches head* though I really want to get on with my stock-based status switch thing! (not to mention the non-oscommerce stuff and new product listings!) Want this working right first cos it has to go on top.

 

v pretty record shop ;)

Link to comment
Share on other sites

Hey there...

 

I have installed MP and it works - but if I add additional masters, the slave does not appear under any of the master product pages. I installed the updates that appear to allow this, and I am able to easily input multiple masters, and it saves them, but once there is more than one master - the slave doesn't work for any of the masters. Is there another update I am not aware of? Or do you have an idea what may cause this?

 

Thank you!!!

Link to comment
Share on other sites

Wow, what a read! I've been going through this topic all day. It paid off. I got it working the first time.

 

I've got a situation that I'm hoping you can help with.

 

I've got a product list of over 18,000 products and most of them are set up as a master/slave relationship.

 

I need to figure out how to add new fields for the slave products.

 

Can this be done and/or are there other contributions that would help get this done?

 

An example of what I'm talking about is below. The top section is the Master, the middle would be the slaves and the bottom would be options.

 

Thanks

 

Bob

 

sample.jpg

Edited by bishop
Link to comment
Share on other sites

You would need to add the fields yourself - choose a field like you want and copy an existing occurence of it thru the code using a different name - add the new field to your database PRODUCTS table and CONFIGURATION table - about 30 minutes work with a good text editor :)

 

Matti

Link to comment
Share on other sites

You would need to add the fields yourself - choose a field like you want and copy an existing occurence of it thru the code using a different name - add the new field to your database PRODUCTS table and CONFIGURATION table - about 30 minutes work with a good text editor :)

 

Matti

 

 

Thanks for the quick response.

 

I'm hoping that "Products Extra Fields" contrib will help expedite things.

 

Any thoughts on this?

 

Thanks

Bob

Link to comment
Share on other sites

Thanks for the quick response.

 

I'm hoping that "Products Extra Fields" contrib will help expedite things.

 

Any thoughts on this?

 

Thanks

Bob

 

Thats a good contribution, i am using it works like a charm. Be carefull when installing because the instructions dosn't cover Master Product contribution. Mainly in admin->categories.php. In there you would have to edit for all the instructions twice.

Link to comment
Share on other sites

Hey Matti,

 

thanks for the great contrib. I've got it working almost exactly like I want it. Where should I send the donation. ;)

 

Here's where i'm at. If you purchase a slave product (one track individually) the download works, but if you purchase the master you don't get a download link. Unless i'm missing something, I think this has more to do with downloads controller than with master products. I'm thinking that downloads.php has got to be edited to make this work. there is no file associated with the master, so downloads.php doesn't see a file to present. it needs to find the files associated with the slaves when you purchase the master, and present those files for download. I'm just not sure exactly how to make that happen.

 

I've read in other threads that there may be a soon to come update for master products that will deal with this issue. any time frame for that release? let me know if you need a beta tester. :D

 

I checked out the Hi-Bias website you just completed recently and it looks like you've got it working on that site.

 

http://www.hibias.ca/store/catalog/product...products_id=416

 

am I on the right track thinking I need to modify the downloads.php file?

Link to comment
Share on other sites

Hey Matti,

 

thanks for the great contrib. I've got it working almost exactly like I want it. Where should I send the donation. ;)

 

 

 

I checked out the Hi-Bias website you just completed recently and it looks like you've got it working on that site.

 

http://www.hibias.ca/store/catalog/product...products_id=416

 

am I on the right track thinking I need to modify the downloads.php file?

 

 

Wow! Somebody who realises I gotta eat! :P I have a donation link on the Team Page or you can message me.

 

The link to Hibias was to show that anything is possible - the current development version does not have extra download functionality - music sites are my bread and butter :)

 

To accomplish what you want you need to edit both downloads.php and checkout_process.php (they are the main two).

 

Matti

Link to comment
Share on other sites

I want the Master Description to be displayed in the Slave product_info page below the slave description, as my slave description is actually the slave product attributes and is only 1-2 lines. To achieve this with very limited knowledge of php and sql

below this code in product_info

<?php echo stripslashes($product_info['products_description']); ?>
</td></tr>

 

I included

<tr><td>
<?php
$master_desc_query = tep_db_query("select pds.products_description from " . TABLE_PRODUCTS . " pr, " . TABLE_PRODUCTS_DESCRIPTION . " pds where pr.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . " ' and pr.products_master  = pds.products_id ");
$master_desc_results = tep_db_fetch_array($master_desc_query);
if ($master_desc_results['products_description'] != null) { ?>

<?php echo stripslashes($master_desc_results['products_description']); ?>
			</td></tr>
<?php
} 	
?>

 

It seems to work fine in my store. I just want to know is there any better and more efficient to achieve this or if this code is correct and will not break anything else.

 

Thanks

Asif

Link to comment
Share on other sites

If anyone wants to use Master Products with STS (I'm using 3.0 or thereabouts) but is getting an empty shopping cart from normal products and an unwanted quantity box you can do this:

 

force quantity to 1 (you can do this in product_info by changing both instances of $i=0; to $i=1;

 

open sts_user_code and replace

 

$sts_block_name = 'masterproducts';
   require(STS_START_CAPTURE);
   echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' .

with

$sts_block_name = 'masterproducts';
   require(STS_START_CAPTURE);
   echo tep_draw_hidden_field('Qty_ProdId_' . $product_info['products_id'], $value = (int)1);

 

If anyone wants to make the customer buy a certain number of slaves before they can checkout - the following 2 contributions seem to work well with Master Products

 

1. enable/disable categories.

2. category tree minimum order.

 

What I do is place my slaves in hidden subcategories (using conrib. 1) then using contrib 2 I make those subcategories have a minimum order of 5.

 

So far works a treat!

 

When my shop is live I'll post a link.

Link to comment
Share on other sites

What code could be used to display price of the highest priced slave when the master product price is zero ( on product_listing.php) Any help will be greatly appreciated.

 

Thanks!

Link to comment
Share on other sites

What code could be used to display price of the highest priced slave when the master product price is zero ( on product_listing.php) Any help will be greatly appreciated.

 

Thanks!

 

correction display the lowest priced slave price

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