Jump to content
Sign in to follow this  
azer

Ajax Buy Now

Recommended Posts

Ok, i'm getting a big headache on this...

 

I've tryed to find how the contrib stop working on my site, but i think i'm at a dead end. Can you give me a precise hint on how the third point work exactly? :(


my contribution: Alex's Contributions

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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"?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
java script remove the space ! B)

its not a space it's the forum board I think that causes it.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

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
Sign in to follow this  

×