Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

So if I select the slave to be hidden, when a customer adds it to their shopping cart, they can then link through to it. Is there anyway to not have the item as a hyperlink in the shopping cart if it is a hidden slave? or even better, for it to link to its master?

 

Thanks - this is a great contrib! :)

Link to comment
Share on other sites

So if I select the slave to be hidden, when a customer adds it to their shopping cart, they can then link through to it. Is there anyway to not have the item as a hyperlink in the shopping cart if it is a hidden slave? or even better, for it to link to its master?

 

Thanks - this is a great contrib! :)

 

Ok, I've managed to change the code in shopping_cart.php so that the item name and the image (was just the image before) links to it's master. However ideally it would only link to the master if the slave product is hidden. Does anyone know the code for this?

Link to comment
Share on other sites

If you want to add the master product at the same time as you add the slaves, you can do so by adding a tep_draw_hidden_field('Qty_ProdId_' . $product_info['products_id'], 1) prior to the </form> in includes/modules/master_listing.php, around line 213:
 ? ? ? ?<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_hidden_field('Qty_ProdId_' . $product_info['products_id'], 1) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></form></td>

Note: this change will affect all master products and will add the master every time the Add to Cart button is pressed.

 

Hth,

Matt

 

I would like to add this code, but in checking the file you specified, there is no "</form> in the file - maybe modified since this post?

Link to comment
Share on other sites

Does anyone have any idea how to change the code to add the master when you add a slave product to the cart, as described above? Afraid i'm not familiar enough with the coding to figure it out myself, any help would be appreciated.

Link to comment
Share on other sites

Does anyone have any idea how to change the code to add the master when you add a slave product to the cart, as described above? Afraid i'm not familiar enough with the coding to figure it out myself, any help would be appreciated.

 

 

Exactly as above :blink:

 

Matti

Link to comment
Share on other sites

Exactly as above :blink:

 

Matti

 

Matti, thanks for the reply, but the problem is that there is no </form> in the specified file so i'm not sure where/what to add...would the coding be the same, and where would I put it?

Link to comment
Share on other sites

Thank Johnson for the great work, I think this is the most import contribution so far.

 

I have 2 questions for this add-on, if anyone knows, please advice.

 

1. on the slave product list, it only takes 20 produsts, more than 20, will go to the second page, where can I change the max limit of 20 per page?

 

2. Is it possible to click the slave product name and link to the product detail page of the slave product (just like when we click the regular product name on the product listing page then we go the the product info page)?

 

Any help will be greatly appreciated.

 

 

BTW, if I don't have a paypal account, how do I donate to the author of this contribution?

Come on guys, let's all donate something to the author to express our thanks because of his great work and help for our business, $10-20 is not a big deal for anyone, if we all do together, it will be a big encourage for the author for more help to us.

Edited by dzdz
Link to comment
Share on other sites

!. This is set in admin>>configuration>>maximum values>> search results

 

2. In /includes/modules/master_listing.php change:

 

		  case 'MASTER_LIST_NAME':
		$lc_align = '';
		if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
		} else {
		  $lc_text = ' ' . $listing['products_name'] . '</a> ';
		}
		break;

 

to:

 

					  case 'MASTER_LIST_NAME':
		$lc_align = '';
		if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
		} else {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
		}
		break;

 

 

 

Now that his omnipotence has kicked me off the osCommerce Team I should have a new release out in a couple of weeks :)

 

You may contact me privately if you wish to make a donation.

 

Matti

Link to comment
Share on other sites

Hi, Johnson

 

PM has been sent to you, if somehow you don't receive it, please do let me know or PM me back.

 

 

-------------------------------------

 

Again, guys, Johnson deosn't know us, deosn't owe us anything, why he should spend so much time for us for nothing. Let's donate something.

 

To clarify, I have no relationship with him, I don't know him at all, I am not his brother to ask for donation for him, I am from Canada. here is my website:

 

My Webpage

 

Thanks

Edited by dzdz
Link to comment
Share on other sites

Ok, finished reading this thread... maybe I overlooked the answer to my question?

 

I've got this contrib installed and working fine. Basically I use the contrib to group similar products together. I know, I could use a third category level but when I started my shop the master-slave contrib seemed to be a good option. And I'm happy with how it is working. I got only one attribute set to my products (only reason to keep the product title short and still getting the info about the version selected).

 

What I would like to change though is that when you forget to select a quantity on any slave, click on add to cart, it will take you to the shopping cart (as set in admin) but of course nothing is added to the cart. I couldn't figure out where in application_top.php or product_info.php I could add some quantity check which triggers a message box to pop up when the button is clicked without quantity selected.

 

Any help on this is much appreciated.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Link to comment
Share on other sites

You need to do this with javascript - look at how its done in create_account.php :)

 

Matti

 

Hm, I had a look into create_account.php and see how I could add an error message to the message stack but to be honest, I still don't know how to check if at least one slave has a quantity > 0 selected. Which variable stores this information? It must be an array but that's all I figured out right now.

 

Could you give me a hint on this, then I'll try to add the warning stuff myself.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Link to comment
Share on other sites

Greets,

 

And big thanks for this contrib and for all the help I've gained from this forum. I've added the Ezier New Fields contrib that allows me to have the retail price of each slave show up in the table under the Master.

 

I am trying to figure out how to add an option on the Admin side to declare where in the table it is placed. Currently the table catagories are:

 

MODEL / NAME / PRICE / RETAIL / SELECT

 

I'd like to have it read:

MODEL / NAME / RETAIL / PRICE / SELECT

 

Can someone refer me to the correct file to add a "Retail Price" line to the "Slave Products" page in admin?

 

Thanx a bunch

Cheers

Shane

Link to comment
Share on other sites

What I would like to change though is that when you forget to select a quantity on any slave, click on add to cart, it will take you to the shopping cart (as set in admin) but of course nothing is added to the cart. I couldn't figure out where in application_top.php or product_info.php I could add some quantity check which triggers a message box to pop up when the button is clicked without quantity selected.

abra

 

After a good night's sleep and a bit of thinking and experimenting I finally came up with a solution to this problem. I just thought I might post it here as I saw some others asked about this before and it was not answered (or I just didn't find it). No guarantee that it works for you, I'll just describe how I did it (based on v 1.1.5 with attributes add-on):

 

1. in /catalog/includes/application_top.php find:

// infobox
 require(DIR_WS_CLASSES . 'boxes.php');

and

// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

 

and move both up directly above:

// Shopping cart actions
 if (isset($HTTP_GET_VARS['action'])) {

 

2. in /catalog/includes/application_top.php find:

//Master Products
 // customer adds multiple products from the master_listing page
 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(isset($HTTP_POST_VARS["id_$prodId"]) && is_array($HTTP_POST_VARS["id_$prodId"])) {
							   // We have attributes
							   $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$HTTP_POST_VARS["id_$prodId"]))+$qty, $HTTP_POST_VARS["id_$prodId"]);
							 } else {
							   // No attributes
							   $cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);
							 }
						   }
						 }
						 tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						 break;
 //Master Products EOF

and replace with:

	 //Master Products
 // customer adds multiple products from the master_listing page
 case 'add_slave' :
						 reset($HTTP_POST_VARS);
						 // BOF prevent redirect if zero quantity
						 $error = false;
						 $count_nonzero_products = '0';
						 // EOF prevent redirect if zero quantity

						 while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {
						   if (substr($key,0,11) == "Qty_ProdId_") {
							 $prodId = substr($key,11);
							 $qty = $val;

						 // BOF prevent redirect if zero quantity
							if ($qty > '0'){
							$count_nonzero_products = $count_nonzero_products + 1;  
						 // EOF prevent redirect if zero quantity						

							 if(isset($HTTP_POST_VARS["id_$prodId"]) && is_array($HTTP_POST_VARS["id_$prodId"])) {								
							   // We have attributes
							   $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$HTTP_POST_VARS["id_$prodId"]))+$qty, $HTTP_POST_VARS["id_$prodId"]);
							 } else {
							   // No attributes
							   $cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);
							 }
						   }
						  }						 
						 }

						 // BOF prevent redirect if zero quantity
						 if ($count_nonzero_products == '0'){
						   $error = true;
						   $messageStack->add('quantity', NO_QUANTITY_SELECTED);  
						 } else {
						 tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						 }
						 break;
 //Master Products EOF

 

3. in /catalog/includes/languages/english.php (an other languages analogue) add before closing ?>:

define('NO_QUANTITY_SELECTED', 'Please select the quantity you wish to purchase!');

 

4. in /catalog/includes/product_info.php find:

<!-- Master Products //-->
<td width="100%" valign="top"><?php  echo '<form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_slave', 'NONSSL') . '">'; ?><table border="0" width="100%" cellspacing="0" cellpadding="0">	
<?php

and add directly after:

<?php // BOF prevent redirect if zero quantity ?>
<?php
 if ($messageStack->size('quantity') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('quantity'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php } ?>  
<?php // EOF prevent redirect if zero quantity ?>

 

And that's it. Now an error message appears if no quantity is selected on any slave product.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Link to comment
Share on other sites

Ok, I've managed to change the code in shopping_cart.php so that the item name and the image (was just the image before) links to it's master.

 

It still links to the slave product from the shopping cart box - any suggestion of where to change this?

Link to comment
Share on other sites

i have just added the MP contribution, but i think something ISN'T RIGHT please see screen shot below:

 

 

masterandslavescreens.jpg

 

 

 

First issue: there is a TEXT_QUANTITY + Qty drop down box next to it --> how to remove these as i want Master product that have Slave attached, ONLY slave product allow to have Qty drop down box where customer able to select Qty eg, Slave 1, Slave 2, Slave 3 etc and at the end all they need to do is hit ADD TO CART button!

 

similar to screen shot below:

 

 

 

mastermultislave.jpg

 

 

 

Second issue: When customer view cart. is there a way for the shopping cart to show:

 

- MASTER 1

- slave a

- slave b

- slave c...

 

- Master 2

- slave d

- slave e

- slave f ...

 

currently when customer hit VIEW CART --> all slave products SHOW UP and customer do not know which slave belong to which master!

 

Thanks in advance

Link to comment
Share on other sites

figure it out: just comment out the SELECT_QUANTITY to remove the unwanted quantity box!

 

just check the admin section and something missing when installignt MP?

 

1. click add master product: THERE IS A 'Product Quantity:' box where you can add quantity to the cart

 

BUT

 

2. when click on add new product button: there are no 'Product Quantity' any where when search in each of the panel namely (Name/Price/Description/Images)

 

HAVE I MISSED SOME THING?

 

CAN SOMEONE HELP ME WITH A SCREEN SHOT ON THIS PAGE!

 

cheers

Link to comment
Share on other sites

Could some kind soul (who has Master Products installed with More Pics 6) PM me or post in this here thread their admin/categories.php file

Link to comment
Share on other sites

Could some kind soul (who has Master Products installed with More Pics 6) PM me or post in this here thread their admin/categories.php file

 

Think *minimalist* >> what is really needed to get this working? All that is needed to have Master products working with this file is the ability to set:

 

Master

Master Status

Listing Status

 

Three settings.

 

Matti

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.
Note: Your post will require moderator approval before it will be visible.

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