Jump to content
Latest News: (loading..)

Recommended Posts

Below is a zip attached for testing product variants (in admin only).

 

Due to importance i make a open request for testing the current workspace.

 

Test it live and or local, and report any issues/bugs in this post please. (no design issues please)

 

The initial goal for this, is to get it in osC's core for a replacement of the attributes system.

 

I'll add a older youtube video to this post, so you can see/understand a bit what it is about.

Also carefully read the readme.txt, so you not have to ask questions already declared.

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Henry...I'm a bit confused and I need to declare that didn't download or install the zip...I just looked at the video but don't we need to set up things like color, size etc for the attribute options...maybe it does that and just isn't shown in the video.

 

Dan 

Share this post


Link to post
Share on other sites

@@Dan Cole  Looking at the sql for the test, it looks like that's part of it.  Here's a snippet....

 

INSERT INTO `osc_products_variants_groups` (`id`, `languages_id`, `title`, `sort_order`, `module`) VALUES
(1, 1, 'Size', 10, 'pull_down_menu'),
(2, 1, 'Colour', 100, 'pull_down_menu'),
(3, 1, 'Material', 30, 'pull_down_menu'),
(4, 1, 'Text', 40, 'text_field'),
(5, 1, 'wootwoot', 60, 'text_field');
 
@@wHiTeHaT I'll be testing over the next few days.  Thanks

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

 

Also carefully read the readme.txt, so you not have to ask questions already declared.

 

.... or getting confused.

this is the preparement for it.

When this test succeeds for your all, i can continue.

I need to know if i am on the right track for you're all.

 

The code will become bigger when color/size/ etc etc go be introduced.

Like how i proceed, it helps me to keep overview on everything.

Share this post


Link to post
Share on other sites

This is going totally wrong.... this post must go be moderated.... i uploaded a new variants.zip, but the extra text i wrote with it was not accepted, as i did have no permissions.

 

I go ask if @@burt deletes THIS post + the second attachment link.... and put THAT link into the first post....

Share this post


Link to post
Share on other sites

Hi Withehat

 

There my first observations when I am looking the code (don't test):

If you want to be compatible with the next release it's better to change these elements.

 

 (int)$languages_id  by $_SESSION['language_id'] 

 

" . TABLE_MANUFACTURERS . " by table_manufacturers

 

For moment, the sql request are not the same, I think it's important to have the same standard in all code or the same standard than osc code.

 

$tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
 
or (I prefer this approach)
 
$tax_class_query = tep_db_query("select tax_class_id,
                                        tax_class_title
                                 from tax_class
                                 order by tax_class_title");
$HTTP_POST_VARS change  in $_POST ==> for moment you use one, for moment another
$HTTP_GET_VARS change  in $_GET ==> for moment you use one, for moment another
 
Also I think it's better to write directly bootstrap
 
 
 
 
 
 
 
Edited by Gyakutsuki

Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

Tuto for 2.4 :
- How to Display a new page with app
- How to make Header Tags under app APP
- How to make a
boostrap modal with external element

Share this post


Link to post
Share on other sites

@@Gyakutsuki

 

yes thank you for your input, it is mostly because it is a mixture of "old" existing code + new code.

 

For bootstrap... i cannot make this yet in bootstrap as there is no adopted admin version for it yet, so it is pointless making it in bs for now.

 

$_SESSION['language_id'] is not (fully) covered in the osc bootstrap version, as that where these product variants are made for.

 

As a side note: This is just a TEST

Edited by wHiTeHaT

Share this post


Link to post
Share on other sites

@@wHiTeHaT

 

Henry...here are the notes I made from my first test...

 

1. Ran the sql...no problems at all.

2. Added/replaced files. No issues.

3. view all groups etc.
   1. Should add delete confirmation to delete function.
   2. When you first add a value to a variant groups name is not shown.
   3. Deleting a variant value produced the following sql error.
         1054 - Unknown column 'id' in 'where clause'
         delete from products_options_values where id = '15'
   4. Could use a back button the variants value page to return to groups.  

4. inserting NEW products
   1. Had some difficulty in this area.  After saving a new product you are redirected to
      products_product_add_variants.php?cPath=&action=insert_product which ends in a blank page. Probably as a result of the missing CPath variable.

5. controlling products
   same issue as above. You are redirected to and again the CPath is blank.        
   products_product_add_variants.php?cPath=&pID=1&action=update_product

 

Dan

Share this post


Link to post
Share on other sites

@@dan.... did you took the last attachement?

 

There is no "products_options_values"  whatso ever in the code?

 

The redirecting stuff, yes that is "normal" as it is ONLY a test.

That is why the fixed url's are in the readme.txt

Edited by wHiTeHaT

Share this post


Link to post
Share on other sites

@@wHiTeHaT

 

There is no "products_options_values"  whatso ever in the code?

 

Henry...you probably figured it out already but if not have a look at TABLE_PRODUCTS_OPTIONS_VALUES on line 66 in products_variants_values.php

 

Also and you probably don't want to know this but there is no new zip attached to your last email. 

 

Maybe it's time for some sleep... :)

 

Dan

 

PS: Actually I just looked back and there are no zips in this thread at all now.  :-

Share this post


Link to post
Share on other sites

when adding new product:

 

1..categories tab is empty

 

2. then when entering a test new product

 

products_product_add_variants.php?action=new_product

 

After clicking save, we go to this page:

 

products_product_add_variants.php?cPath=&action=insert_product

 

Which is empty, meaning header is there, left column is there, but no content, 


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

When testing controlling products

 

products_product_add_variants.php?pID=1&action=new_product

 

On the general tab of product 1, the box to the right locked out, except for products status and date available. The rest of the fields are grayed out.

 

After entering some variants and coming back to product 1 I am able to update variants on the variant tab.

 

Images tab...tried to save image, did not save after rechecking product 1

 

As above, after the save, we go to a blank content page.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

@@altoid

 

ok........

 

-submits are not redirect correct..... so cpath stays unused, in the readme it is explicit told to use static urls (remember it is just a test, i am very aware of it)

-the general greyed out box is only grayed out when that product HAS variants, when remove all variants you will see it become active.

 

-images and categories are not part of the test.

 

 

The test is pure for testing create/read/update/delete the variants.

 

 

Thnx for testing so far.

Edited by wHiTeHaT

Share this post


Link to post
Share on other sites

In modules /products you use this : $_GET_VARS ==> Are you sure ? $_GET or  $HTTP_GET_VARS


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

Tuto for 2.4 :
- How to Display a new page with app
- How to make Header Tags under app APP
- How to make a
boostrap modal with external element

Share this post


Link to post
Share on other sites

 

Thnx for testing so far.

 

I am glad to help.

 

It looks like one goal of this is that the attributes will be assigned to the product within the product edit page.  I hope so, because the current system having to assign product attribute on admin>catalog>product attributes is a bit of a pain, both setting them up, then removing them later.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

@@Gyakutsuki, yep you right, however "that section" function execute() {

 

is not in use.

The idea behind these cm_ modules was to allow install new types of "variants". (in V3 this is done via individual classes).

It will go be changed when the system is ready.

 

Tnx for paying attention to it.

 

@@altoid

 

Yes, you are right, but..... we go not use the "word" attributes anymore :)

 

 

Each variant = equal to a product.

 

When you create a new variant within the product_products_add_variants.php

That variant is located inside the "osc_products" (for testing we use osc_ , but it will replace the current products table).

 

So imagine you have a graphiccard "matrox"

 

it go have product_id 1

inside product db table we go have

products_id = 1, parent_id = 0

then that product go have childs:

product_id =  44, parent_id = 1

 

That product go represent for example:

Matrox graphiccard (equals product_id 44)

-Memory: 16mb

-Model: premium

 

it get an individual status

it get an individual model/SKU

it get an individual product price

it get an individual stock

it get an individual available date

it get an individual tax class

it get an individual weight + weight class (kilogram,lbs....etc)

 

you will be able to set one of these variants as default selected

 

Screenshot

Edited by wHiTeHaT

Share this post


Link to post
Share on other sites

@@wHiTeHaT

 

Henry .... Still asleep? :D  ...

 

Okay ... Your first problem was :  when clicking a variant option -> you should not be able to select another option of the selected option-group.

 

This one I solved with

$('#'+label_id).prop('disabled', true);

So i put it in this part of your code

$('.variantsTree').change(function() {

	var product_id = $('.activeTags').attr('id');
	var selected = $(':selected', this);
	var label_id = selected.parent().attr('id');
	var label = selected.parent().attr('label');
	var value_id = selected.attr('value');     
	var value = selected.text();
	
	$('#'+label_id).prop('disabled', true);
//alert(label_id +''#  );		
		$(".activeTags").tagit({
			fieldName: 'group_id['+product_id+','+value_id+']'
			
			});
	
		$(".activeTags").tagit("createTag", label+' : '+value);
});

... testing please!

Share this post


Link to post
Share on other sites

@@wHiTeHaT

 

Second problem ... Should not be able to select variant options if no variant selected ... Solved!

 

Introduce modal for warning "no variant selected" :

$('#noVariantSelected').dialog({
	autoOpen: false,
	resizable: false,
	draggable: false,
	modal: true,
	buttons: {Cancel: function() {
				$(this).dialog('close');
				}
			}
	});

Add div just before closing div of tab 3

<div id="noVariantSelected" title="<?php echo TEXT_NO_VARANT_SELECTED_TITLE; ?>">
   <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><?php echo TEXT_VARIANT_CONFIRM_DELETE; ?></p>
</div>

Add an evaluation if class highlight exists :

	if ($(".highlight")[0]){
	       // Do something if class exists
		$('#'+label_id).prop('disabled', true);

		$(".activeTags").tagit({
			fieldName: 'group_id['+product_id+','+value_id+']'
		});
	
		$(".activeTags").tagit("createTag", label+' : '+value);

	} else {
		// Do something if class does not exist
    	        $('#noVariantSelected').dialog('open');
	}

... testing please!

Share this post


Link to post
Share on other sites

For the modal dialog:

$('#noVariantSelected').dialog({
	autoOpen: false,
	resizable: false,
	draggable: false,
	modal: true,
	buttons: {Cancel: function() {
				$(this).dialog('close');
				$(".variantsTree option:selected").prop("selected", false);
				}
			}
	});

we do: $(".variantsTree option:selected").prop("selected", false);

 

couse if you confirm the dialog (close), the selection stay's highlighted, if would go and highlight a variant.... it stay selected... and you cannot click it anymore.

Now you can.

Share this post


Link to post
Share on other sites

@@azpro , Now that we prevented to add more options from 1 optgroup, we also need to build an identifier for the labels that allows more then 1.

 


 

For example the Text label.

But imagine we also go add image upload.

 

But that can be done as last.

Now need to find a way to insert these options to the db.

 

====BUG

Also, you seem to made a mistake with disabling a label.Now that you disabled it, and select another variant, i cannot add any option from that label to the new selected variant.

The chosen option should be disabled then.... it is more complicated....sorry.

Edited by wHiTeHaT

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

×