Contributions
Ajax Buy Now
All simple: Buy Now without reload page
Expand All / Collapse All
When Firefox 4 and 3.(something) was released ajax buy now stoped woriking for some shops. I tried to write the code in the form,, but I guess it was to much characters.
I didn't get it to work with so I contacted a friend who made a quick fix.
He wanted to rewrite the whole code, but we settled with creating and changing ajax_sc.js to a big javascript instead. So yeah its a pretty big script,but at least it works att Lilon.se, http://www.lilon.se.
So here's a fix to get Ajax Buy Now work with Firefox 4.
You just replace the ajax_sc.js.
Ok all thanks to Pixclinic. Forget prior package, the demo site doesn't even use, and Jquery is needed?
Go with this
in product_info.php: the button that adds to the wishlist is coded as follows:
CODE
echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params()) . '&wishlist_x=wishlist">' . tep_image_button('button_wishlist.gif', 'Add to Wishlist') . '</a>';
in application top, before the shopping cart actions:
CODE
//Wishlist actions (must be before shopping cart actions)
if(isset($HTTP_GET_VARS['wishlist_x'])) {
if(isset($HTTP_GET_VARS['products_id'])) {
if(isset($HTTP_GET_VARS['id'])) {
$attributes_id = $HTTP_GET_VARS['id'];
tep_session_register('attributes_id');
}
$wishlist_id = $HTTP_GET_VARS['products_id'];
tep_session_register('wishlist_id');
}
tep_redirect(tep_href_link(FILENAME_WISHLIST));
}
Attached are small modifications for Wish list (http://addons.oscommerce.com/info/1682) so that it will work with AJAX BUY Now Contribution(http://addons.oscommerce.com/info/4105)
Working Demo can be found here : http://cartzlink.com/product_info.php/cartz-link-p-43
Thanks
This fix is for "Dynamic_force_attribute_selection" 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)
If you're seeing problems with location of loading image (ie. not showing over click event, but elsewhere on page); its likely due to the scrollTop and scrollLeft in the ajax_sc.js file.
This is a replacement for ajax_sc.js that detects which scroll method the browser supports and corrects the x-y location of the loading images.
simply replace includes/ajax_sc.js with this file.
In the previous archive the places of a folder "classes" is incorrectly specified. Now it is correctly.
Buy Now without reload page v1.1
Now:
- corrected boxing width Shopping Cart
- support "Use Search-Engine Safe URLs" - credits A.Berezin.
- add visual acknowledgement of addition
See http://www.netso.ru/index.php?cPath=1_68
NOT DEMO-SHOP!!! Only russian language!
Sorry my bad english ;-)
All simple: Buy Now without reload page
Note: Contributions are used at own risk.