Latest News: (loading..)
Johnson

Master Products - MS2

2,441 posts in this topic

Hi Guys,

 

How do I combine 'action=add_product' and 'action=add_slave' into one action so it adds both master and slave to the cart with one click.

 

Is this even possible???

 

Any help is appreciated.

 

Thanks

 

Mark

 

 

Hi Mark,

 

how many items from master and which page on?

 

I think you can add_master parameter into get varables.

Example: $HTTP_GET_VARS['add_master'] and master_products_id

 

Or

You can use hidden field with POST method too in form head section.

 

The slave products evalute from arrays when cart action start and then you can add to cart master products in this action too.

 

 

 

i use master product default value 1 in drop down list so when click on product_info page buy button it will always at least put one master into cart.

 

Regards,

Gergely

Edited by Gergely

Share this post


Link to post
Share on other sites

 

 

Hi Mark,

 

how many items from master and which page on?

 

I think you can add_master parameter into get varables.

Example: $HTTP_GET_VARS['add_master'] and master_products_id

 

Or

You can use hidden field with POST method too in form head section.

 

The slave products evalute from arrays when cart action start and then you can add to cart master products in this action too.

 

 

 

i use master product default value 1 in drop down list so when click on product_info page buy button it will always at least put one master into cart.

 

Regards,

Gergely

 

The actions I need to combine are on the product_info page. Apart from that I am being totally dumb and dont understand blink.png

 

Mark

Share this post


Link to post
Share on other sites

Mark,

 

do you use drop down fields?

if use try this for master products:

tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array, 1)

 

regards,

Gergely

Share this post


Link to post
Share on other sites

i installed mp v2.1 but I think there is missing one file in the packet:

catalog/includes/modules/boxes/bm_best_sellers.php

Edited by univer

Share this post


Link to post
Share on other sites

is it possible to mix this addon of "Master Products" with the addon of "Products Specifications"? (Products Specifications http://addons.oscomm.../info/8096/v,23)

I'm trying in several ways buth I always get stuck with this parts

 

// Start Products Specifications

if (SPECIFICATIONS_BOX_FRAME_STYLE == 'Tabs') {

// Insert the javascript for the tabs

and

 

// Master Products

$master_status_query = tep_db_query("select products_id, products_master_status, products_master from " . TABLE_PRODUCTS . " where products_status = '1' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

$master_check = tep_db_fetch_array($master_status_query);

 

if ($master_check['products_master_status'] > 0) {

echo tep_draw_form('buy_now_', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_slave', 'NONSSL'));

} else {

// this line should be disactivated by PRODUCTS SPECIFICATIONS

echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'));

}

// Master Products EOF

Edited by univer

Share this post


Link to post
Share on other sites

i installed mp v2.1 but I think there is missing one file in the packet:

catalog/includes/modules/boxes/bm_best_sellers.php

 

Thanks for note!

bm_best_sellers.zip

Share this post


Link to post
Share on other sites

i forgot to mention that i'm stucked while merging the file catalog/product_info.php

here are the two files, who can do this?

I'm trying since days without any succes

 

 

Hi,

 

We need to do new module for it. As soon as possible I will do it in extras. The tab page navigation not fix yet.

 

 

Regards

Gergely

Share this post


Link to post
Share on other sites

@Gergely

ok, I already did answer in the other topic

i'll wait for your further info

thanks (also for sending missing file)

Share this post


Link to post
Share on other sites

I am back at trying to get this to work.

 

I am going to take 1 problem at a time.

 

Is there anyway to change the drop down qty box on the master to a qty input box?

Share this post


Link to post
Share on other sites

Let me rephrase the 1st problem I am having.

 

When I go to product_info.php?products_id=xx, I have the text_quantity drop down box and limited to 20. Can I change this drop down box to a input box?

 

Also when I am on the individual product page and enter a number in the drop down box, it will not update the shopping cart. Please help, I really like this contribution.

Share this post


Link to post
Share on other sites

Anyone, please!!!

 

 

Hi,

 

maybe reverse this:

 

To use a checkbox in includes/modules/master_listing.php

 

change

 

$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');

 

to

 

$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '1', false);

 

 

 

but this will not enough. At this moment v2.3.1 version use drop down. Look at Master Products pervious version for osCommerce 2.2 core.

I will do admin switch for it in future.

Edited by Gergely

Share this post


Link to post
Share on other sites

thank you. I don't have a problem if the product is a master or slave. The problem arises when a product that is not assigned as a slave is chosen. The drop down menu limits the customer to only 20. I sell parts for farmers. A few of my products, the customer may order 20, 40 or sometimes as many as 500.

Share this post


Link to post
Share on other sites

I am sure with all the great programmers out there, that someone can step up to the plate and figure out how to change the drop down box to a input box.

 

Please someone. This is a wonderful contribution, and this is all that is needed to make it perfect.

Share this post


Link to post
Share on other sites

I was wondering if anyone else is having the same problem that I am. I have installed Master Products for V2.3 and I can assign a product as a master, but if I need to edit the product, I am not able to save it. I get redirected to the categories page and the changes are not saved. Attached is my categories.php page.

categories.php

Share this post


Link to post
Share on other sites

I was wondering if anyone else is having the same problem that I am. I have installed Master Products for V2.3 and I can assign a product as a master, but if I need to edit the product, I am not able to save it. I get redirected to the categories page and the changes are not saved. Attached is my categories.php page.

 

 

Hi try to close elseif branch:

// BOF: Availability + Warranty
	  if (isset($HTTP_POST_VARS['availability_id_out_of_stock_image']) && tep_not_null($HTTP_POST_VARS['availability_id_out_of_stock_image']) && ($HTTP_POST_VARS['availability_id_out_of_stock_image'] != 'none')) {
	    $sql_data_array['availability_id_out_of_stock_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_out_of_stock_image']);
	  } elseif (isset($HTTP_POST_VARS['availability_id_in_stock_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock_image']) && ($HTTP_POST_VARS['availability_id_in_stock_image'] != 'none')) {
	    $sql_data_array['availability_id_in_stock_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock_image']);
	  } elseif (isset($HTTP_POST_VARS['availability_id_in_stock2_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock2_image']) && ($HTTP_POST_VARS['availability_id_in_stock2_image'] != 'none')) {
	    $sql_data_array['availability_id_in_stock2_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock2_image']);
	  } elseif (isset($HTTP_POST_VARS['availability_id_in_stock3_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock3_image']) && ($HTTP_POST_VARS['availability_id_in_stock3_image'] != 'none')) {
	    $sql_data_array['availability_id_in_stock3_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock3_image']);
	  } elseif (isset($HTTP_POST_VARS['availability_id_in_stock_special_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock_special_image']) && ($HTTP_POST_VARS['availability_id_in_stock_special_image'] != 'none')) {
	    $sql_data_array['availability_id_in_stock_special_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock_special_image']);
// EOF: Availability

 

add after

 

{

Share this post


Link to post
Share on other sites

Thank you for the reply. I uninstalled Master Products and Reinstalled it and now it works perfect.

Share this post


Link to post
Share on other sites

Does anyone know where the code is that controls the qty drop down box for the master product and for product_info. I am going to try and change this so it is a text input box.

Share this post


Link to post
Share on other sites

try a simple html php mixed code.

 

 <input name="Qty_ProdId_<?php echo $product_info['products_id']; ?>" type="text" size="30" maxlength="30">

 

its all.

Share this post


Link to post
Share on other sites

Posted 17 February 2004, 17:38

 

In catalog/advanced_search_result.php change:

 

$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 

to:

 

$where_str = " where p.products_status = '1' and p.products_master = '0' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 

This only works if the Master has the search term - a better solution is to have the result return the Master if the search term is found within the Slave - something I shall get around to I am sure.

 

Matti Ressler

-----

 

 

I need to modify the $where_str code so that so that it searches all the slaves products_id and displays the master. Currently is either all slaves or only the masters (p.products_master = 0). Perhaps:

 

$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 

if (isset($HTTP_GET_VARS['products_master_status'] == 0) && (isset($HTTP_GET_VARS ['products_master'] != 0))) {

$where_str .= " or p.products_master = '" . (int)$HTTP_GET_VARS['products_id'] . "'";

}

 

Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')'

 

I would greatly appreciate your assistance – struggling for a couple of years with this issue.

Share this post


Link to post
Share on other sites

I would greatly appreciate your assistance – struggling for a couple of years with this issue.

 

Hi,

 

Could you put here the full query string? (try to use database logging and select the main query string)

Share this post


Link to post
Share on other sites

Thank you so much for your reply.

 

$Id: advanced_search_result.php,v 1.72 2003/06/23

 

Advanced_search_results.php is such an odd document. The $select, $from and $where_str statements are separated in portions. I know that the issue lies solely in:

 

$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 

The above displays all slaves – which sometimes are over 20 slaves per master. See Scientiis.com

 

$where_str = " where p.products_status = '1' and p.products_master = '0' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 

The above displays the master, but does not search the slaves. Searching for a slave model gives " There is no product that matches the search criteria."

 

Maybe if I could adapt somehow the following:

 

// Master Products

$master_prod = tep_db_query("select products_master, products_master_status

from " . TABLE_PRODUCTS . "

where products_id = '" . $products_master['products_id'] . "'");

$master_prod_values = tep_db_fetch_array($master_prod);

 

if (($master_prod_values['products_master_status'] == 0) && ($master_prod_values['products_master'] != 0)) {

$str_selected_values = $master_prod_values['products_master'];

} else {

$str_selected_values = $products_master['products_id'];

}

 

Tried adapting the following, but received errors

 

if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {

$where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

}

 

There is also this function in /includes/functions/general.php

 

// Master Products

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'];

}

// Master Products EOF

 

By the way, I'm not a programmer.

 

Thank you again.

Share this post


Link to post
Share on other sites

Hi,

 

if I understand the question is that search all master products which has slave product with search key. The results contain master products or single products only. The slaves are not listing.

 

 

This process need subqueries.

 

Here is a simple sql code where searching for price in osCommerce v2.3.1 core:

 

SELECT * FROM `products` WHERE products_master_status = '1' and products_id in(SELECT replace(replace(replace(products_master, "_ ", ""), " ", ", "), "_", "") FROM `products` WHERE products_price = '824' and products_master_status = '0')

 

The results give only masters.

 

 

At this model searching for single master products. The master products only single (_ xxxx _) and not multiply (like _ xxxx yyyy fff _)

 

 

The problem is that how can search masters but there are a lot of events.

Share this post


Link to post
Share on other sites

try a simple html php mixed code.

 

 <input name="Qty_ProdId_<?php echo $product_info['products_id']; ?>" type="text" size="30" maxlength="30">

 

its all.

I assume this would be in the product_info.php file. Would you suggest I add this in addition to code that is there or replace the dropdown code with this. Sorry to be such a bother.

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