Jump to content
Johnson

Master Products - MS2

Recommended Posts

But if a button says 'buy now' but then redirects instead of adding to cart that's irritating. Mebbe it's cultural ;) I'll go look at the attributes add-on, will prolly have to tinker for qtpro purposes :)

Share this post


Link to post
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

Edited by mpm

For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

Any ideas why only slave products (and not normal products as well) will add to my cart?


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

If you mean have I set the quantity through the admin interface then yes. If you don't mean that - what do you mean?


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
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

Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
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!)


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites
*cough* never mind, found it...

 

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

Share this post


Link to post
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

Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
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 ;)

Share this post


Link to post
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!!!

Share this post


Link to post
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

Share this post


Link to post
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


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
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

Share this post


Link to post
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.


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×