Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Products Fields Groups


50 replies to this topic

#1 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 26 November 2011, 14:33

Hi ,
ive just finished a new contribution which gives another way to create highly customizable new fields by making use of the Products Atrributes section.

The link is here

http://addons.oscommerce.com/info/8247

This contribution gives the administrator(s) the abilty to create extra field "Groups". These groups will be made up of attributes ( from the product options section) where each attribute will effectively be a new input field for any product linked to it.
There is no limit to how many attributes can be "attached" to a group - its basic functionality is the same as product attributes.
The bonus in using "Groups" is the way we can show Products in both the Listing and the Single view.
In the LIST view all products with the same Group will be shown together - this allows one to pick which of these attributes to show as column headers along with the standard headers ( Price , product name , image etc) , as well as its position ( through sorting, fully interacting with the Product Listing sorting)
This LISTing remains the same - whether viewing by Category , manufacturer , some filter or any search.

In the Single View all of these extra attributes/ fields ( if populated) in our attached group will be shown either Horizontally or Vertically ( configurable) in any order we choose ( using different sort order than the list view)
  • Fully Multi language compatible
  • Each new field is fully searchable (configurable)
  • Products of the same Group type will be shown together in category view , manufacturer view , a filter or any search.
  • Products not attached to a group will be shown like they do now.
  • Using Groups as a way to create new fields means not all products get the same fields - ie no meaningless / inappropriate fields on ALL products.
An example of the Listing view can be seen here ( last 2 DVDs have languages + audio in the columns)

http://ocraw.conzept....php?cPath=3_10

An example of the Single view can be seen here ( vertical mode)
http://ocraw.conzept...&products_id=10

Any suggestions , bug reporting , possible optimization / improvements would be grately appreciated.

Jules

ps. hope ive posted this in the right place

Edited by thejudge99, 26 November 2011, 14:37.


#2 LuSong

  • Community Member
  • 1 posts

Posted 29 December 2011, 14:43

Hello, Thanks for this contributions

In admin
When I duplicate product "product field list" don't copy with it.
What I do to fix it?

Luke

#3 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 30 December 2011, 13:02

Hi Thanks for the feedback.

This is an oversight on my part. I will add the missing code asap - could take a few days though with it being so close to New Year.

#4 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 02 January 2012, 15:20

Sorry for the delay but heres the upgrade for this Contribution

http://addons.oscommerce.com/info/8247

The update will copy any Groups attached to a product as well as all populated fields ( during a COPY TO as Duplicate).

It also contains a small bug fix - a line of code that i accidentally deleted which throws an SQL error during an attempt to delete an Attribute Option.

Jules

#5 crashtest

  • Community Member
  • 1 posts
  • Real Name:conozof
  • Gender:Male

Posted 04 January 2012, 16:40

Can I use it with oscommerce 2.3.1 ?

#6 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 05 January 2012, 10:35

yes its been specifically made for 2.3.1

#7 ShaGGy

  • Community Member
  • 59 posts
  • Real Name:Les

Posted 13 January 2012, 23:54

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id, ptdc.discount_categories_id, dc.discount_categories_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id left join " . TABLE_DISCOUNT_CATEGORIES . " dc using(discount_categories_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");


trying to merge this code (below) into the above code but keep getting sql syntax errors.


" . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCT_FIELDS_GROUPS_NAMES . " pfgn on p.products_fields_group_id = pfgn.products_fields_group_id and pfgn.language_id = '" . (int)$languages_id . "' where

Edited by ShaGGy, 13 January 2012, 23:55.


#8 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 14 January 2012, 10:48

question

are you trying to merge an already modified admin/categories.php ?

instruction 6H ( from within the supllied install.htm)

find

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
    } else {
      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

and relace with

//   start Product Fields groups
      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id, p.products_fields_group_id , pfgn.products_fields_group_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c , " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCT_FIELDS_GROUPS_NAMES . " pfgn on p.products_fields_group_id = pfgn.products_fields_group_id and pfgn.language_id = '" . (int)$languages_id . "' where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
    } else {
      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status ,p.products_fields_group_id , pfgn.products_fields_group_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c , " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCT_FIELDS_GROUPS_NAMES . " pfgn on p.products_fields_group_id = pfgn.products_fields_group_id and pfgn.language_id = '" . (int)$languages_id . "' where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
//   end Product Fields groups

your posted line you are trying to merge appears twice 1 above and 1 below the } else { are you changing both?

#9 ShaGGy

  • Community Member
  • 59 posts
  • Real Name:Les

Posted 18 January 2012, 00:44

Managed to do it in the end i was omitting the left join as the line already had one but after a bit of asking around it turned out i needed to insert the left join as instructed even though there was one already in the query.

But I end up with a weird bug whereas if i add the attibs to ONE product it works fine but when i then add to a second item none of them show?

#10 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 20 January 2012, 08:56

where do they not show ? in the backend where the fields are populated .. or in the frontend?

#11 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 25 January 2012, 09:50

Just finished another update ( still working on the install instructions - will be uploaded asap) - Now includes an extra column of SORTS to be used as TABS .

Demo can be seen here ( together with vertical view)

http://ocraw.conzept.de/product_info.php?cPath=1_4&products_id=2

I originally asked PRONUX for permission to include the TMS contribution to which he said yes ( thanks for that) but with the hard coded widths / calculations it wasnt dynamic enough ( we dont know the widths of fields - they change dynamically based on field / language ) , so i decided to use the TABS based on jquery ( the files / css is already built into oscommerce ) - styling is based on the current Themeroller theme if you changed it.

Install files will follow - probably sometime later today

Edited by thejudge99, 25 January 2012, 09:57.


#12 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 25 January 2012, 13:09

as promised the upgrade is ready.

http://addons.oscommerce.com/info/8247

Jules

#13 vmjarala

  • Community Member
  • 123 posts
  • Real Name:Veronica Polston

Posted 27 January 2012, 14:37

Hi Jules!
Thanks for a great contribution! It's exactly what I need.
I am trying to install, but I get an error when I try to download 1.1. I tried several times.
Any ideas of why that could be?
Thanks!
VerĂ³nica

#14 vmjarala

  • Community Member
  • 123 posts
  • Real Name:Veronica Polston

Posted 27 January 2012, 16:17

Error's as follows:
"Cannot open file: it does not appear to be a valid archive. If you downloaded this file, try downloading the file again."
And then I get an empty Zip folder.

Thanks!

#15 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 27 January 2012, 21:15

oh - sorry i didnt try to open it myself yet - i will retry it and reup it if need be

#16 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 27 January 2012, 21:18

it works fine for me - the zip was created with 7zip - maybe try that or update your current zip program.


opens fine with winrar too

Edited by thejudge99, 27 January 2012, 21:19.


#17 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 28 January 2012, 09:31

Could someone else please try the zip - if noone else can open it then i will reup it

#18 vmjarala

  • Community Member
  • 123 posts
  • Real Name:Veronica Polston

Posted 28 January 2012, 20:21

Thanks! I have WinZip and it's fairly new. I try 7zip or winrar... THANKS!

#19 vmjarala

  • Community Member
  • 123 posts
  • Real Name:Veronica Polston

Posted 28 January 2012, 20:23

OR... do you think it's ok to email it to me? I can send you my email address via pm. Or are there lots of files?

#20 thejudge99

  • Community Member
  • 30 posts
  • Real Name:Julian

Posted 29 January 2012, 12:33

Ive made another ZIP file and reup'd it just incase anyone else had any probs.

http://addons.oscommerce.com/info/8247