Configurable products #107

merged 27 commits into from Aug 30, 2011


None yet

2 participants


No description provided.

kdzwinel added some commits Aug 21, 2011
@kdzwinel kdzwinel Easy variations browsing on 'variable product' page:
- faster - AJAX calls after each variation selection were removed
- simpler - client won't see a 'variation doesn't exist' message anymore (it is impossible for him to select variation that doesn't exist)
@kdzwinel kdzwinel Futher variable product related changes
The way that client selects variations had been changed in my last commit, now I've done some clean up. A lot of code was removed or simplified (needs testing).

While I was modifying the cart class I also fixed some issues:
- user ability to save a negative product quantity (may have resulted in negative stock qty)
- invalid redirection to the blog main page for blogs that are being kept outside the root folder (i.e. instead of
- some documentation fixes and supplements

An example of a github code comment :)

kdzwinel added some commits Aug 23, 2011
@kdzwinel kdzwinel Rob confirmed that script.js.php was abandoned long ago - I'm removin…
…g it.
@kdzwinel kdzwinel - redundant line brakes removed from jigoshop-admin
- small code simplification in jigoshop-admin
- comments starting with # changed to //# (as they are deprecated in php5) - there may be more of them, I'm not sure if I found all of them
@kdzwinel kdzwinel Trying to download non existing file, directory or unreadable file (i…
….e. /?download_file=231&order=123& was causing server error.

It was fixed to show wp_die message.
@kdzwinel kdzwinel Order admin page:
- shipping and billing fields code simplified
- localization support added
@kdzwinel kdzwinel Some more code simplifications on admin order page. 1a576fb
@kdzwinel kdzwinel 'first name' field label was displayed twice. c7f1bc3
@kdzwinel kdzwinel order save function - code simplification and formating f6d55f9
@kdzwinel kdzwinel Modifying and saving order via backend doesn't corrupt order anymore.
Variation data are stored correctly.
There are some more smaller issues to work on though:
i.e. when user buys two products of the same variation with different attribute values, these data may be incorrectly saved after modification by admin
@kdzwinel kdzwinel Merge branch 'dev' of git:// into dev
@kdzwinel kdzwinel Displaying all variation attributes correctly on user (frontend) orde…
…r page.
@kdzwinel kdzwinel Small code improvements and comments. ff943d8
@kdzwinel kdzwinel Making some parts of the code more readable. c1fda86
@kdzwinel kdzwinel Some more code cleaning. These changes are only cosmetic - should not…
… affect functionality.
@kdzwinel kdzwinel Setting variation visibility to 'hidden' when it is not enabled (post…
…_status == 'private').
@kdzwinel kdzwinel Variations that are not enabled are now hidden from user (they were v…
…isible which was a bug).
@kdzwinel kdzwinel Code readability, checking if $_POST[] values are set before using them. 0cb453c
@kdzwinel kdzwinel Formatting, code simplification and readability. No functional changes. 4f59282
@kdzwinel kdzwinel New product variations that are already covered by older variations a…
…re being disabled after saving product.
@kdzwinel kdzwinel Displaying errors messages when one, or more, variations were disable…
…d due to an error.

This error is being shown when user creates two variations with same or overlapping set of attributes. Variation created later will be disabled while saving the product. I'm not sure if the message is grammatically correct so probably someone who feels more confident about his English should have a look at it ;) Also, should we report new translation keys somewhere? How would translation contributors know that there is something new to translate?

kdzwinel added some commits Aug 28, 2011
@kdzwinel kdzwinel Fixing a bug where values of variation attributes where overwritten b…
…y values of another variation (same variation ID, different attribute values) when order was modified by admin.
@kdzwinel kdzwinel Merge branch 'dev' of git:// into dev + t…
…ypo fix + checking if product was found before making any operations on it


It might be worth wrapping javascript files that use jquery in a wrapper so we can trim down the filesize

    // code goes in here

Yes, I agree. It was a pain to remember about using jQuery instead of $.


should be get_available_attributes_variations() i will change this

Ah, sorry. I use this function in jigoshop_template_functions.php, so it needs fixing there to.


Not a huge fan of this script block, possible to send it to javascript via other means? data attribute or hidden input maybe?

In my opinion JSON is a natural choice for javascript. Normally data like this would be fetched using AJAX but in this case AJAX request is redundant, we can embed the data directly (this are details about all variations of the product that javascript uses to display information about available options, product availability etc.). What exactly don't you like about this? What do you mean by 'data attribute' or 'hidden input'?

I think there should be a clear separation between frontend & backend code, its not a deal breaker just an ideal.
A possible way we could send the data is by attaching it to an element using the data attribute or by inserting the json through the value field of a hidden input? Not sure if this is a best practice or not though..

Hm, I never thought of backend/frontend separation in such cases before, sounds convincing.

Do I understand the alternatives you are talking about correctly?:

1)"using the data attribute":
<div data-variation-id="123" data-attribute-values="a,b,c" etc.>

2) "hidden input":
<input type='hidden' value='{variatons:[{id:1,name:sgdsfds}, etc.}' />

First one may be problematic but will look better, second one is a bit messy but easy to implement.

That's right. Is it not possible to stick json in a data attribute? (never actually tried)

@studioromeo studioromeo merged commit d5df3e7 into jigoshop:dev Aug 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment