Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Ajax Buy Now


azer

Recommended Posts

Hi, Drako

Sorry for so late answer - job, job, job :(

 

Code which makes 3 item:

for method GET (button "BuyNow")

  reqAddCart.onreadystatechange = function() {
if (reqAddCart.readyState == 4) {
  if (reqAddCart.responseJS) {
	document.location.href = reqAddCart.responseJS.ajax_redirect;
	return;
  }
  else {
	document.getElementById('divShoppingCard').innerHTML = '<table border="0" width="100%" cellspacing="0" cellpadding="2">'+(reqAddCart.responseText||'')+'</table>';
	hideLoading();
	if ( SHOW_ADDED ) {
	  showOk();
	  timerID = setTimeout( "addHandler(document, \'mousemove\', hideOk)", 500);
	}
  }
}
 }

 

for method POST (button "AddProduct")

  reqAddCart.onreadystatechange = function() {
if (reqAddCart.readyState == 4) {
  if (reqAddCart.responseJS) {
	document.location.href = reqAddCart.responseJS.ajax_redirect;
	return;
  }
  else {
	document.getElementById('divShoppingCard').innerHTML = '<table width="100%">'+(reqAddCart.responseText||'')+'</table>'
	if ( SHOW_ADDED ) {
	  showOk();
	  timerID = setTimeout( "addHandler(document, \'mousemove\', hideOk)", 500);
	}
  }
}
 }

 

Luck!

 

P.S. Show me your site with my installed mod.

Link to comment
Share on other sites

 

 

Hi Medreces

 

Any possiblity you can provide the code to implement that image dragging to shopping cart when you click on "Buy now"

 

Also, i am having a prob. I have installed your contribution and when i click on "Buy Now" the clock comes up and thats it. There is no tick or anyhting. Just the clock keeps rotating. But when i click on the reload button the item is added to the cart. Happens with every item. But i press reload the item is added.

 

I have many contribs installed. They are:

 

AJAX Attribute Manager v2.1 beta

Bank Deposit

CCGV(trad)

Country-State Selector v1.3.3

Easy Populate v2.90b - Update

Payment method fee 2.1

Product Extra Fields v2_0i

Quantity Price Breaks for Separate Pricing Per Customer v1_02

Separate Pricing Per Customer v4.1.4

Western Union Module

 

 

Contributions to be installed:

STS v4.1

 

Any help would be much appreciated.

 

Thanks

Link to comment
Share on other sites

Hi Medreces

 

Any possiblity you can provide the code to implement that image dragging to shopping cart when you click on "Buy now"

 

Also, i am having a prob. I have installed your contribution and when i click on "Buy Now" the clock comes up and thats it. There is no tick or anyhting. Just the clock keeps rotating. But when i click on the reload button the item is added to the cart. Happens with every item. But i press reload the item is added.

 

I have many contribs installed. They are:

 

AJAX Attribute Manager v2.1 beta

Bank Deposit

CCGV(trad)

Country-State Selector v1.3.3

Easy Populate v2.90b - Update

Payment method fee 2.1

Product Extra Fields v2_0i

Quantity Price Breaks for Separate Pricing Per Customer v1_02

Separate Pricing Per Customer v4.1.4

Western Union Module

Contributions to be installed:

STS v4.1

 

Any help would be much appreciated.

 

Thanks

 

 

Same problem is still occourring... my headache is getting wrost... today i'll try to check the code line by line and what happen...

 

I've tryed to install the mod on a clean OSC with no problem, so the custom mod i've done to the site make it discfunction. Now it's a personal matter. I've got to make this mod work! ;)

my contribution: Alex's Contributions

Link to comment
Share on other sites

OK, just an update:

 

The problem is not the site code, but something in the DB: i've tried tu use the standard site with my database, and it give me the same problem as before, so the problem shoul be in the DB format, problably some call to the DB are sligthly different...

 

I'll post any news, trying to be of some help.

my contribution: Alex's Contributions

Link to comment
Share on other sites

Same problem is still occourring... my headache is getting wrost... today i'll try to check the code line by line and what happen...

 

I've tryed to install the mod on a clean OSC with no problem, so the custom mod i've done to the site make it discfunction. Now it's a personal matter. I've got to make this mod work! ;)

 

Playing with my store setting yesterday, I just noticed tha ajax buy now doesn't work when the GZIP compression is active, if this can help you.

 

 

hugh

 

www.thefrenchybee.com

Link to comment
Share on other sites

Sorry that I don't help you .I am on vacation. I will be available after 21st of July.

 

 

Are u joking? Are say that u are sorry cause u are on holiday?

 

WTF! Enjoy your holiday! I tankyou for this nice peace of mod, and the problem is not the mod itself but some modification i've done on my site. Just a matter of time and i'll find were the problem is!

 

THX one million again and enjoy your holiday! See you soon!

Edited by Drako

my contribution: Alex's Contributions

Link to comment
Share on other sites

Playing with my store setting yesterday, I just noticed tha ajax buy now doesn't work when the GZIP compression is active, if this can help you.

hugh

 

www.thefrenchybee.com

 

 

You are a genius! Now the problem is gone and the mod is working without any problem! Maybe someone more skilled than me can make this mod gzip compatible? Or the benefit of gzip ar not so valuable?

my contribution: Alex's Contributions

Link to comment
Share on other sites

You are a genius! Now the problem is gone and the mod is working without any problem! Maybe someone more skilled than me can make this mod gzip compatible? Or the benefit of gzip ar not so valuable?

 

I noticed that the GZIP accelerates significantly page and image loading times. I really enjoyed it.. for one day. (thanks for google analytics module that helped me to detect why and where we had a drop in orders) Having shopping cart filled seemed a better option to me :-)

 

Maybe Medreces (when back from vacation) can help us on that, as I have no idea on what's involved in Gzip/Ajax interaction

Edited by pixclinic
Link to comment
Share on other sites

Hi!

Thanks for a nice contribute.

It works well with my site except on the site where I also use the "Switch between Displaying Prices Inc./Ex. VAT" contrib.

If I have an item in my cart and then try to change from Inc to Exc (or reverse) it doesn't work.

 

You can try at: Liljankoski Online

Link to comment
Share on other sites

Ok .. at last i got it to work. Just one weird thing now.

 

Whenever you press on "buy now" rather than having the image move to the shopping cart it just appears on top of the shopping cart and then it gets added to the shopping cart.

 

How do i get the image drag to the shopping cart when you press on "buy now"?

Link to comment
Share on other sites

Ok .. at last i got it to work. Just one weird thing now.

 

Whenever you press on "buy now" rather than having the image move to the shopping cart it just appears on top of the shopping cart and then it gets added to the shopping cart.

 

How do i get the image drag to the shopping cart when you press on "buy now"?

 

be sure you have the div called flyimg at the source (in the product info page) you probably only have the other one in the shopping cart box

Link to comment
Share on other sites

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')"><div id="fly_img">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>

 

This is from the code that i was supposed to enter in product_info.php. Have i entered this right? Is there something else i am missing? Any other files that need to be modified. I have also entered the div in the shopping_cart.php

Edited by CGhoST
Link to comment
Share on other sites

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')"><div id="fly_img">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>

 

This is from the code that i was supposed to enter in product_info.php. Have i entered this right? Is there something else i am missing? Any other files that need to be modified. I have also entered the div in the shopping_cart.php

 

 

java script remove the space ! B)

MS2

Link to comment
Share on other sites

here is mine:

 

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')"><div id="fly_img">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH*2, SMALL_IMAGE_HEIGHT*2) . '</div><br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>

 

and yes, javascript is one word in my code too, it's split by the board

Edited by pixclinic
Link to comment
Share on other sites

hi,I hv installed the great contribution step by step follow the newest version readme txt.

But I hv two problems.

1.

It only works in firefox.

 

In IE ,It will be reloaded to the shopping_cart.php just as the old method when press the add to cart button.

I installed seo url,xsell,pwa,htc contribution ,all prodcut list with image,on my osc.

 

2.

It don't hv the fly img effect also even in firefox.

Pixclinic gave some tips to make it.

However I am new to osc ,and I don't know php,I hv copy the Pixclinic 's product_info file to my one,could anyboby post the corrected shopping_cart.php? I really don't know how and where to enter the div.

 

Is it ok to hv the fly img effect if the two files are modifyed?

 

Thank you .Hope someone can help me.

Terman

Link to comment
Share on other sites

Hi

 

I installed this and it does not work on my product listing page.

 

We do have the qty there so I followed the post that said to update teh module/product_listing.php file but I ended up with two qty fields and two buy now buttons and one was clearly the Ajax one but it did nothing just spun its wheels.

 

 

okay I missed the fact there are TWO case statements like the one he said to replace. read more carefully next time ...

 

thanks

Kym

Edited by flying_kites
Link to comment
Share on other sites

The problem is solved. For working with STS need to add

<script language="JavaScript" src="includes/ajax_sc.js"></script><div id="divShoppingCard">$cartbox</div>

into your sts_template.html. Thank you Medreces, for this great contrib.

Link to comment
Share on other sites

Has anyone managed to get the flying image part working, or is there a complete contrib available with that in it?

 

The flying image is not part of the original MOD's code. How to modidy the mod is explained earler in this thread

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...