Contributions
Dynamic force attribute selection
This feature will add forced selection on each attribute in products attribute dropdown boxes. After modification has been made, it will automatically add validation before submitting product to shopping cart. The validation will alert user on which product is missing selection.
This contribution was added because I could not find any right now that will automatically validate your product attributes (no matter how many there are). The feature is also language aware so remember to do step three in all languages you intend to use...
Expand All / Collapse All
This fix is for "Ajax Buy Now" Users !
--------------------------------------------------------------
This is a small change but works correctly for ajax buy now users including me.
Until users don't make this change with Dynamic_force_attribute_selection , ajax buy now will not work correctly.
As I seen on forum, one of the problems for users is to not able to find bug.(for exp. user jake seymour's web-pages)
This bug becomes to users of using Dynamic_force_attribute_selection contribution
Users do not realize that so this change was needed.
---------------------------------------------------------------------------------------------------------------------------------------
********************************************
1)Open products_info.php file:
Find:
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'onSubmit="return validate(this);"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
And Replace With:
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
********************************************
2)Open the ajax_sc.js file.
Find:
function doAddProduct(form) {
And Replace With:
function doAddProduct(form) {
var attributes_force=validate();
if(attributes_force==false) return false;
********************************************
3)On v1.6 the only small change is "function validate()", do not change it with "function validate(cart_quantity)".
If you do change it, it will not work.
********************************************
That's all.
Seyhun Cavus(faaliyet)
v1.7 Changes:
-------------------------------
How I realize the bug.First I add shadowbox for pictures.Then to make it work on IE7 I change
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> line with
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
And after that I found out that dynamic attribute force doesn't work.
As it has to be suitable with standarts and to make it work with populer javascript plugins (exp shadowbox) I made these needed changes.
********************************************************************************************
-Changed all lines of "attibute force" in product_info.php
Now it works on FF2+, IE6+ ,Safari ,Chrome ...
Now it works with the web standarts." <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">"
-Added id option to get full attribute control.
-Added the support for the contribution "options as images"
-Added the upgrade logs.
PS:On v1.6 the only small change is "function validate()", do not change it with "function validate(cart_quantity)".
If you do change it, it will not work.
********************************************************************************************
Seyhun Cavus(faaliyet)
+ Combined wilderfalk's FF bugfix in with v1.5.1
+ added update guides
Complete Package + update guide
This useful contribution works fine with IE, Opera and Safari.
But not in Firefox ...until now.
cart_quantity was not defined in the Javascript-section in product_info.php
Complete package
+ improved options as images code
+ cleaned up install docs
This is a great contribution. I added comments to beginning and ends of code (eg // BOF Dynamic force attribute selection) and corrected a few minor syntax errors, also added a bit of code for options as images users.
This feature will add forced selection on each attribute in products attribute dropdown boxes. After modification has been made, it will automatically add validation before submitting product to shopping cart. The validation will alert user on which product is missing selection.
This contribution was added because I could not find any right now that will automatically validate your product attributes (no matter how many there are). The feature is also language aware so remember to do step three in all languages you intend to use...
Note: Contributions are used at own risk.