Jump to content



Latest News: (loading..)

- - - - -

Master Products - MS2


  • Please log in to reply
2401 replies to this topic

#2341   Geotex

Geotex
  • Members
  • 628 posts
  • Real Name:George Snell
  • Gender:Male
  • Location:Houston, TX USA

Posted 19 July 2011 - 04:34 PM

View Postdspeak, on 19 July 2011 - 04:08 PM, said:

I have the contribution installed and have been playing with it some.  I have a parts store that sells engine parts, clutch parts, etc.

What I would like to be able to do is have the slave products show up as slaves under the master, but also to remain as a individual product.

Is there anyway to do this?

V2.2 RC2 of osCommerce.

You can have products under different categories and under multiple masters. The very nature of having a master product is to round up all the associated (slave) products and display them together in one list. If you need more information about a product to display, I did a pop-up window add-on for Master Slave some time back that works very well and is a relatively easy install. This will allow your customer to click on the product and have a pop-up window that will actually display info as though the product were a separate listing. They then close the window to order from your slave list.

It is listed under the Master/slave contribution if you are interested. It will work with PHP 4.x - 5.3.x, register-globals on or off.

George
GEOTEX from Houston, TX

(George)

#2342   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 03 August 2011 - 03:26 PM

Hi Guys,

I have scanned the thread and can not seem to find the answer to my problem.

In this piece of code:

	if ($master_check['products_master_status'] > 0 || $master_check['products_master'] == 0 || $master_check['products_restricted_status'] = 0) {

	  echo tep_draw_form('buy_now_', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_slave'));

	} else {

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

	}

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

#2343   mraeryceos

mraeryceos
  • Members
  • 11 posts
  • Real Name:your real name

Posted 08 August 2011 - 05:50 PM

I installed master products the best I could, and I am having some problems.  I created a master and assigned some slaves.  However, when I browse products, I see the master and slaves listed together, when I should only see the master.  When I click on any of these, I get the description that the master product has, but I don't get any option to select a slave for checkout.

I don't even know where to start.  What files need fixing?

ps. I gave up on altering new_products.php, as there were too many conflicts and I don't even use the new_products feature anyway.

Edited by mraeryceos, 08 August 2011 - 05:53 PM.


#2344   Geotex

Geotex
  • Members
  • 628 posts
  • Real Name:George Snell
  • Gender:Male
  • Location:Houston, TX USA

Posted 08 August 2011 - 11:45 PM

View Postmraeryceos, on 08 August 2011 - 05:50 PM, said:

I installed master products the best I could, and I am having some problems.  I created a master and assigned some slaves.  However, when I browse products, I see the master and slaves listed together, when I should only see the master.  When I click on any of these, I get the description that the master product has, but I don't get any option to select a slave for checkout.

I don't even know where to start.  What files need fixing?

ps. I gave up on altering new_products.php, as there were too many conflicts and I don't even use the new_products feature anyway.

I need a little more info to see if I can help. What version of osCommerce are you using, and what version of the M/S contribution did you install?

George
GEOTEX from Houston, TX

(George)

#2345   mraeryceos

mraeryceos
  • Members
  • 11 posts
  • Real Name:your real name

Posted 09 August 2011 - 10:36 PM

View PostGeotex, on 08 August 2011 - 11:45 PM, said:

I need a little more info to see if I can help. What version of osCommerce are you using, and what version of the M/S contribution did you install?

George, it is MP MS2 1.25, on top of osCmax 2.0.25.  I have someone that is a better programmer working on it, and I'm sure they don't need help.  I appreciate your prompt reply.

#2346   anarcho

anarcho
  • Members
  • 2 posts
  • Real Name:Bernd Jakoby

Posted 26 August 2011 - 05:01 PM

Hi,

thanks for your great work.

I got this Version: osCommerce Online Merchant v2.3.1 and installed Master Products and Magic Variants for OSCOM V2.3x
Version 2.0.

The problem is, that when I) add the "normal" product attributes ("Send product as a gift" - yes/no as radio buttons), the "buy now" - Button doesnt work anymore,
redirects me to the product instead of to the shopping cart.

This piece of code in application_top does the redirect if there are attributes:
	  // performed by the 'buy now' button in product listings and review page
	  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {

								if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
								  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
								} else {
								  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
								}
							  }
							  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
							  break;

Why does it redirect if a master has attributes ???

I tried this, but it doesnt add a product, just shows an empty cart:
	  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {

								$cart->add_cart($HTTP_GET_VARS['products_id'], 1);
							  }
							  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
							  break;

What code do I have to change to make it work ?

best wishes from Germany

Bernd

#2347   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 28 August 2011 - 11:58 AM

View PostPupStar, on 03 August 2011 - 03:26 PM, said:

Hi Guys,

I have scanned the thread and can not seem to find the answer to my problem.

In this piece of code:

	if ($master_check['products_master_status'] > 0 || $master_check['products_master'] == 0 || $master_check['products_restricted_status'] = 0) {

	  echo tep_draw_form('buy_now_', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_slave'));

	} else {

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

	}

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
Off the top of my head maybe modify the code to create another "action", call it "action=add_both".

Then in application_top create another "case" like this:

	  case 'add_both' :
Then under it consolidate the code for 'add_slave' and 'add_product' into a single event.

Make sense to you?
:unsure:
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#2348   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 28 August 2011 - 12:19 PM

View Postgerm, on 28 August 2011 - 11:58 AM, said:

Off the top of my head maybe modify the code to create another "action", call it "action=add_both".

Then in application_top create another "case" like this:

	  case 'add_both' :
Then under it consolidate the code for 'add_slave' and 'add_product' into a single event.

Make sense to you?
:unsure:

cheers Jim, yes it makes sense although technical capability may come into it lol

I will give it a go  :thumbsup:

Thanks

Mark

#2349   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 29 August 2011 - 08:13 AM

View PostPupStar, on 28 August 2011 - 12:19 PM, said:

cheers Jim, yes it makes sense although technical capability may come into it lol

I will give it a go  :thumbsup:

Thanks

Mark

ok I must admit after hours of fiddling and staring at code I am a little stumped at combining these 2 sets of code to create 1 action

if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
									  $attributes=array();
									  if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) {
										$attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
										foreach ($attrlist as $attr) {
										  list($oid, $oval)=explode('-',$attr);
										  if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
											$attributes[$oid]=$oval;
										}
									  }
									  if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {
										foreach ($HTTP_POST_VARS['id'] as $key=>$val) {
										  if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
											$attributes=$attributes + $HTTP_POST_VARS['id'];
										}
									  }
							  }

and

								while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {
								if (substr($key,0,11) == "Qty_ProdId_" && ($val !== 0)) {
								$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 {
										if (isset($HTTP_POST_VARS["products_id"]) && isset($HTTP_POST_VARS['id'])) {
										// We have attributes with normal product only
										if ($prodId == $HTTP_POST_VARS['products_id']) {
										$attributes = $HTTP_POST_VARS['id'];
										} else {
										$attributes = $HTTP_POST_VARS["id_$prodId"];
										}
										$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $attributes))+$qty, $attributes);
										} else {
										// No attributes and normal products
										$cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);
										}
								}
								}
								}

Any knight in shining armour out there to rescue me on a chilly bank holiday monday  :thumbsup:

Mark

#2350   Geotex

Geotex
  • Members
  • 628 posts
  • Real Name:George Snell
  • Gender:Male
  • Location:Houston, TX USA

Posted 31 August 2011 - 12:20 AM

View Postanarcho, on 26 August 2011 - 05:01 PM, said:

Hi,

thanks for your great work.

I got this Version: osCommerce Online Merchant v2.3.1 and installed Master Products and Magic Variants for OSCOM V2.3x
Version 2.0.

The problem is, that when I) add the "normal" product attributes ("Send product as a gift" - yes/no as radio buttons), the "buy now" - Button doesnt work anymore,
redirects me to the product instead of to the shopping cart.

This piece of code in application_top does the redirect if there are attributes:
	  // performed by the 'buy now' button in product listings and review page
	  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
 
								if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
								  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
								} else {
								  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
								}
							  }
							  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
							  break;

Why does it redirect if a master has attributes ???

I tried this, but it doesnt add a product, just shows an empty cart:
	  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
 
								$cart->add_cart($HTTP_GET_VARS['products_id'], 1);
						  	}
							  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
							  break;

What code do I have to change to make it work ?

best wishes from Germany

Bernd
Hi

I understand why you are having problems creating new features for a Master item.

A Master Product is a "dummy" product that is used to round up items that could make up a set of items that are many times purchased together even though they could be listed in different categories. To a point, they could be almost considered a "mini" subcategory.

A master product is an enhancement that can either add information to a group of products that you do not want in a separate category, or could be used to create a great sales pitch for a group of products when you do not want to add a contribution that allows category descriptions. (A very useful contribution. If you are not using it, you should check one out.) Making a Master product for sale or giving it attributes is really at cross purposes with the intention of the contribution, regardless of the version of osCommerce you are using. Making the Master items (and some will disagree, I know) for sale is not good practice. If you need to have sales and attributes for Master items, you probably need to consider another contribution.

Please carefully consider what it is you are trying to accomplish here. If you need to sell a set, set up a product code offering the set as a whole purchase, maybe with a small discount compared to buying each item. You can set it as a slave to show under your master listing. That might be less confusing to your customers than trying to buy an item, a master set, and so on.

By the way, the original author is long gone, and it appears that those who have so graciously added updated versions have left also, leaving this as a totally user supported contribution. I can attempt to help, but have so many contributions, changes and updates added to my code that my help will necessarily be somewhat general. Also, I use a heavily modified osCommerce roughly equivilant to RC2a, and have zero familiarity with the update for osCommerce 2.3.x versions as I do not wish to totally obscure the code with java scripts. So I will probably not be able to offer any intelligent comments on that version.

HTH
George
GEOTEX from Houston, TX

(George)

#2351   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 04 September 2011 - 03:09 PM

View PostPupStar, on 03 August 2011 - 03:26 PM, said:

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, 04 September 2011 - 03:20 PM.

Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2352   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 04 September 2011 - 03:22 PM

View PostGergely, on 04 September 2011 - 03:09 PM, said:



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 [img]http://forums.oscommerce.com//public/style_emoticons/default/blink.png[/img]

Mark

#2353   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 04 September 2011 - 05:19 PM

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
Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2354   univer

univer
  • Members
  • 21 posts
  • Real Name:De Ridder Patrick
  • Gender:Male
  • Location:Belgium

Posted 17 September 2011 - 08:01 PM

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, 17 September 2011 - 08:01 PM.


#2355   univer

univer
  • Members
  • 21 posts
  • Real Name:De Ridder Patrick
  • Gender:Male
  • Location:Belgium

Posted 24 September 2011 - 08:50 PM

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, 24 September 2011 - 08:55 PM.


#2356   univer

univer
  • Members
  • 21 posts
  • Real Name:De Ridder Patrick
  • Gender:Male
  • Location:Belgium

Posted 24 September 2011 - 09:34 PM

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

Attached Files



#2357   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 25 September 2011 - 09:27 AM

View Postuniver, on 17 September 2011 - 08:01 PM, said:

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!
Attached File  bm_best_sellers.zip   3.78K   8 downloads
Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2358   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 25 September 2011 - 09:34 AM

View Postuniver, on 24 September 2011 - 09:34 PM, said:

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
Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2359   univer

univer
  • Members
  • 21 posts
  • Real Name:De Ridder Patrick
  • Gender:Male
  • Location:Belgium

Posted 26 September 2011 - 09:41 AM

@Gergely
ok, I already did answer in the other topic
i'll wait for your further info
thanks (also for sending missing file)

#2360   dspeak

dspeak
  • Members
  • 86 posts
  • Real Name:Danny

Posted 14 October 2011 - 05:36 PM

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?