Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products Fields Groups


thejudge99

Recommended Posts

Hi,

 

I'm not sure if this is the addon I need, so I will explain my problem and maybe someone can come up with an answer...

 

My OSCommerce site is racingpiping.com, and I am having products uploaded to it. I'm noticing that some categories have hundreds of products (and I have yet to find how they are sorted) which makes it hard to find what you're looking for. The person is adding every single product as a unique product, when actually, in have products of identical attributes that i'd like to have regrouped; example:

 

Silicone couplers come in lenght, color, diameter, with Master products being straight/45/90/reducer/90-reducer.

 

I'd like the "straight couplers" to show as the master product name. Once that master product is selected, a list of attributes is showed, one selection per attribute must be made:

Option 1: lenght with choices between 3" and 36" inch for that specific master product

option 2: diameter (1 / 1.5 / 2 / 2.25" / 2.5" / etc)

Option 3: Color

Quantity:

Add to cart

 

What would be added to the cat would be the unique item number of that given combination of attributes.

 

What are your thoughts?

 

Thanks,

 

Frank

Link to comment
Share on other sites

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Hi Probegtze ,

this addon doesnt effect the attributes part and how they currently work - what it does is make an extra use of them to create extra fields.

You could in theory use this to create unique groups for each unique combination - not sure how many you have .

 

eg.

 

lets say you want to group colours ( assuming for example you have the colors red + black).

you could create groups called

 

group_red - would contain length , diameter , color

group_black - would contain again length , diameter , color.

 

Attaching all products that are red to group_red

Attaching all that are black to group_black.

 

Now attach color to the Listing sort for each group.

 

And your product listings will be grouped together by color - showing the color in the listing.

 

Lets say instead with Length

 

Group_length3-6 would contain again length , diameter , color.

Group_length9-12 would contain again length , diameter , color.

 

attach all products that have length 3-6 inches to Group_length3-6

attach all products that have length 9-12 inches to Group_length9-12

 

attach length for both these groups to the L.sort - and voila the listings are grouped by length showing length in the listing view.

 

This can be further customized how you see fit

Edited by thejudge99
Link to comment
Share on other sites

Hi Lachrize - its really easy to add more custom tabs - both using ajax or have the content already on the page embedded.

 

in catalog/product_info.php

 

<!---Generate the tabs-->
		 <ul>
 <?
				while($results_tms_count_query = tep_db_fetch_array($groups_tms_count_query)){ ?>
				<li><a href="#tabs-<? echo $tms_count; ?>" ><? echo $results_tms_count_query['products_options_name']?></a></li> <?
				 $tms_count++;
				 }

  ?>
	<li><a href="/product_reviews_pfg.php?Tc=<? echo (int)$groups_tms_count?>&products_id=<? echo (int)$HTTP_GET_VARS['products_id']?>" title="<? echo IMAGE_BUTTON_REVIEWS ;?>" ><? echo IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : '') ;?></a></li>

			</ul>
		<!--- End Generate the tabs-->

 

 

and after this line of code

<li><a href="/product_reviews_pfg.php?Tc=<? echo (int)$groups_tms_count?>&products_id=<? echo (int)$HTTP_GET_VARS['products_id']?>" title="<? echo IMAGE_BUTTON_REVIEWS ;?>" ><? echo IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : '') ;?></a></li>

 

you could insert another <li></li> containing the the link to the new content. ie

<li><a href="/custom_content.php" title="my new content" >TAB_NAME</a></li>

 

This would automatically load custom_content.php via ajax when the tab is clicked.

 

or if you want the content already on the page embedded - so google has its contents to scan without following links.

 

<li><a href="#my-new-content" >TAB_NAME</a></li>

 

then after

<div id="<? echo IMAGE_BUTTON_REVIEWS ;?>"></div>

 

insert

<div id="my-new-content">here is my content that i want to show in my new tab</div>

 

Jules

Edited by thejudge99
Link to comment
Share on other sites

Here is a small database update that fixes a product listing bug which showed a double column effect for products not yet attached ( or unattached) to a group.

 

BACKUP your products database before running

update products set products_fields_group_id = 0 where products_fields_group_id is NULL;

ALTER TABLE products CHANGE products_fields_group_id products_fields_group_id INT( 11)NULL DEFAULT'0';

 

it basically replaces all groups set as NULL to 0

 

Jules

Edited by thejudge99
Link to comment
Share on other sites

  • 4 weeks later...

Hi Julian

 

Your screen shots look just what I need! I am 90% done, but hit a glitch. No idea if you can help or if I am busted ...

 

I have a template installed and the 16th Step in 1.00 release I cannot do as the produst listing module has been completely re-written by the template. The new (additional) file is a product listing with the template prefix. I am not going to ask you to look at it, that would be unfair, but can you tell me if the steps in 16 are 100% essential or not?

 

What I will do over the weekend is try a fresh install, add in your code changes and then add the template (so the other way around to what I have so far) ... worth a try.

 

Will keep you posted. If you can advise on 16 and 14b (that code also missing, athough the fragment still fitted in to what was missing).

 

Cheers.

John.

Link to comment
Share on other sites

Hi ja1nsa

 

The product listing changes ( 16) are not needed , but i it could be that any SQL modifications done ( search , manufacturer listing etc) might also need to be left out - i cannot say right this second if that is the case.

 

The additions to product_info.php (14) are pretty flexible - the tabs - the extra fields. These can be placed pretty much anywhere - the wrapping HTML can also easily be changed to fit whatever layout you use.

 

Jules

Link to comment
Share on other sites

Ive tested by simply uploading the original product_listing.php - overwriting my modified version - and it works fine - no SQL errors ( my only concern) - the modified version simply shows all groups with the same " Group" together - the original will work fine too - although i dont think my changes will be too hard to implent with other layouts.

 

Jules

Link to comment
Share on other sites

Hi Jules,

 

Sorry, I haven't replied to your last answer, did some other thing in between. Thanks for your reply, the error appeared to be a left out closing </a> in this line <li><a href="#tabs-1" >Product details</a></li> (source view).

 

Everything is working fine now except for one thing.

 

The tab "Reviews" shows the number of reviews in the tab (Reviews (3) but doesn't show the reviews. It shows the messages "Error loading content".

 

Any idea why the content isn't loaded?

 

Your help is much appreciated.

 

Thanks

 

Gerhard

Edited by srirahandcraft

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

Hi srira

 

Look at your own source code - the reviews tab should look something like this

 

<li><a href="/product_reviews_pfg.php?Tc=3&products_id=19" title="Reviews" >Reviews (14)</a></li>

 

where /product_reviews_pfg.php?Tc=3&products_id=19 is being loaded by ajax - what you can then try is

 

www.MYDOMAIN.COM/product_reviews_pfg.php?Tc=3&products_id=19 which should show nothing else but the 1st page of reviews ( Tc= the no of tabs minus reviews.) the url at the end should be what you see in your own source.

If you get a 404 error then make sure you have uploaded product_reviews_pfg.php

 

 

my test site looks like this

 

http://ocraw.conzept.de/product_reviews_pfg.php?Tc=3&products_id=19 ( <- click)

 

Jules

Edited by thejudge99
Link to comment
Share on other sites

Hi Jules,

 

Thanks for the help.

Problem solved, I just had to take out the slash before "product_reviews_pfg.php.

 

It's working now.

 

Regards,

 

gerhard

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

Jules

 

Thanks for the reply. I am still non the wiser, however I have come across a rather interesting scenario. If you download the sample template from monster templates (the one for OScommerce), it now comes the a whole host of additional options including NIVO slider (configurable) and a pile of extra configuration stuff. I beleive it would be well worth OScommerce integraing this and making it 2.3.2 as an upgrade. I don't see where we could hit problems in terms of licensing as it was in a free download. It is also easily changed. Please pass onto the powers that be, maybe nobody has seen these improvements as they are either too advanced and focusing on dev OR too new and not sure what they mean. Really, the additional admin is just great!

 

Anyway, still not figured out my product setup yet, if you have time to assist I bascially have this scenario. Category (brand e.g. Samsung, Nokia), Product (Phone e.g. Galaxy S2). Now when a customer selects the phone I need to give opions i.e. the package. This could be Talk 100, 200, 500 on Network X, Chat 200,300,800 on Network Y. So ideally I would have 2 drop down boxes. One would allow customer to select Network (5 options), other would allow customer to select Tariff (say 20 options). The tariff would ideally be based on what is selected in the network drop down, though I can live with just 1 long list if needs.

 

Cheers.

J.

Edited by ja1nsa
Link to comment
Share on other sites

Hi ja1nsa

 

im not 100% sure what u are asking - but it looks like you need some modifications to the options part - whcih my addon does not do - it simply makes use of the options as a means to create extra fields.

 

Assuming you have the backend part working - ie you are able to create/ add extra fields to products then you can show these extra fields in a variety of ways that are included in the contribution - with a little knowlede of php / html the added code within product_info.php could be changed to fit / meet personal needs based on layout.

Link to comment
Share on other sites

Hi Julian,

 

Great contribution!

 

Do you have any idea why my pfg will not save to the database? Clicking the "save groups" button does not update the groups. I can see the groups in the dropdown menu. I'm guessing I must have missed something in the following code in admin/categories.php:

 

//start Product Fields groups 1.3

if($products_count > 0 ){

if($HTTP_GET_VARS['action'] !="pfg_change"){

?>

 

<tr>

<td></td>

<td align="left" style="padding-top:6px;"><? echo tep_draw_button(TEXT_PRODUCTS_FIELDS_GROUPS_CHANGE, 'disk', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=pfg_change', 'NONSSL'))?></td>

<td></td>

<td></td>

</tr>

<?

}else{

?>

 

<tr>

<td align="right" style="padding-top:6px;"><? echo tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : ''))) ?></td>

<td align="left" valign="bottom"><? echo tep_draw_button(TEXT_PRODUCTS_FIELDS_GROUPS_SAVE, 'disk', null, 'secondary')?></td>

<td></td>

<td></td>

</tr>

 

<?

echo "</form>";

}

}

 

//end Product Fields groups 1.3

 

$cPath_back = '';

if (sizeof($cPath_array) > 0) {

for ($i=0, $n=sizeof($cPath_array)-1; $i<$n; $i++) {

if (empty($cPath_back)) {

$cPath_back .= $cPath_array[$i];

} else {

$cPath_back .= '_' . $cPath_array[$i];

}

}

}

 

$cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : '';

//start Product Fields groups 1.3

if($HTTP_GET_VARS['action'] !="pfg_change"){

//end Product Fields groups 1.3

?>

<tr>

<td colspan="4"><table border="1" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo TEXT_CATEGORIES . ' ' . $categories_count . '<br />' . TEXT_PRODUCTS . ' ' . $products_count; ?></td>

<td align="right" class="smallText"><?php if (sizeof($cPath_array) > 0) echo tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_CATEGORIES, $cPath_back . 'cID=' . $current_category_id)); if (!isset($HTTP_GET_VARS['search'])) echo tep_draw_button(IMAGE_NEW_CATEGORY, 'plus', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_category')) . tep_draw_button(IMAGE_NEW_PRODUCT, 'plus', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_product')); ?> </td>

</tr>

</table></td>

</tr>

<?

//start Product Fields groups 1.3

}

//end Product Fields groups 1.3

?>

</table></td>

 

 

Any help is greatly appreciated.

Edited by cortezwa
Link to comment
Share on other sites

Hi cortezwa,

 

nice catch - seems i missed a step from my 1.3 install instruction - namely the opening form tag

 

I will update the addon tomorrow but for now.

 

in admin/categories.php

 

find

 

 
$categories_count = 0;
   $rows = 0;
   if (isset($HTTP_GET_VARS['search'])) {

 

insert ABOVE

 

 
//start Product Fields groups 1.3
if($HTTP_GET_VARS['action'] =="pfg_change"){
echo tep_draw_form('products_fields_groups_update', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=pfg_update', 'post', 'enctype="multipart/form-data"');
}
//end Product Fields groups 1.3

 

pls let me know if the batch update now works

 

Jules

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for share this addon

I installed last verison but i have problem that my first page and product page give me blank page.

Error of page in source web page is:

<link rel="[url=""]stylesheet[/url]" type="[url=""]text/css[/url]" href="[url=""]<br />
<b>Fatal error</b>:  Call to undefined function tep_catalog_href_link() in <b>/home/sudmand/public_html/includes/template_top.php</b> on line <b>30</b><br />[/url]

 

includes/template_top.php at line 30 is:

<!--	start Product Fields group tab  -->
		<link rel="stylesheet" type="text/css" href="<?php echo tep_catalog_href_link('ext/jquery/ui/redmond/jquery-ui-1.8.19.custom.css'); ?>">
	<!--	end Product Fields group tab  -->

file "jquery-ui-1.8.19.custom.css" is aviable at same folder.

 

please help me.

Edited by ilyadgonbad
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...