Jump to content
Sign in to follow this  
azer

Ajax Buy Now

Recommended Posts

i t s gonna be hard for me :

 

1. i use infobox admin contribution so , every box are called from the admin configuration , but i added manually the code in the column right

Can't we call the javascript from the shopping cart box instead of the column right ?

 

Edit includes/column_right.php	 

  Find this code:

require(DIR_WS_BOXES . 'shopping_cart.php');


  REPLACE WITH THIS CODE:

// AJAX Addto shopping_cart - Begin
?>
 <tr>
   <td style="padding: 0">
   <script language="JavaScript" src="includes/ajax_sc.js"></script>
	 <div id="divShoppingCard"><table border="0" width="100%" cellspacing="0" cellpadding="2"><?php  require(DIR_WS_BOXES . 'shopping_cart.php'); ?>
	 </table></div>
   </td>
 </tr>
<?php
// AJAX Addto shopping_cart - End

 

2. on the exemple website u got another feature of the image of the product taht moves to the shopping cart infobox ! i hope u add it to the next contribution version :blush:

 

3. Problem : when i click buy now , i got the image showing with green confiramtion, and the product is added to the cart

 

but i then click buy now on other product, it s not added in the cart !

i can only add again the same product i added at the beggingin, and it calculate well in the cart the number of unit and total price

 

ANY IDEAS ?


MS2

Share this post


Link to post
Share on other sites

Hi

 

1. The basic idea this contribution - minimal changes and maximal use code MS2.

What is responsible for a conclusion of boxing Shopping Cart? Correctly, shopping_cart.php! Means, it should be wrapped up in div and at addition of a product to Cart receive from server only html-code only baskets but not all page.

 

Give me link on reference on "infobox admin contribution" - I shall look.

 

2. Hmmm... Functional on example site same as in the contribution. Changed only visual. "If in one shop images fly is originally. If to all - platitude". (C - A.Berezin)

 

3. Link on problem? Used MS2? What contributions are installed? More detailed information necessary...

Edited by Medreces

Share this post


Link to post
Share on other sites

1. Ok.

a. Copy file catalog/includes/boxes/shopping_cart.php to catalog/includes/boxes/original_shopping_cart.php

b. In file catalog/includes/boxes/shopping_cart.php erase ALL rows. After erase insert next code:

 
<?php
// AJAX Addto shopping_cart - Begin
?>
 <tr>
   <td style="padding: 0">
   <script language="JavaScript" src="includes/ajax_sc.js"></script>
	 <div id="divShoppingCard"><table border="0" width="100%" cellspacing="0" cellpadding="2"><?php  require(DIR_WS_BOXES . 'original_shopping_cart.php'); ?>
	 </table></div>
   </td>
 </tr>
<?php
// AJAX Addto shopping_cart - End
?>

and SAVE it.

 

c. In catalog/ajax_shopping_cart.php find:

 
 require(DIR_WS_BOXES . 'shopping_cart.php');

and replace with:

 
 require(DIR_WS_BOXES . 'original_shopping_cart.php');

 

I didnt test this code! But I think, that it works.

 

2. Flying pictures in packing the contribution yet will not be. Sorry for my bad english :blush:

Share this post


Link to post
Share on other sites

Medreces

 

My catalog/includes/modules/product_listing.php:

 

$lc_text = '<form name="cart_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing['products_id']) . '"><input type="hidden" name="products_id" value="' . $listing['products_id'] . '"><input type="text" name="quantity" value="1" maxlength="5" size="5"><br>' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</form>';

 

Please help me to add:

 

// AJAX Addto shopping_cart - Begin

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'loading.gif', '', '', '', 'align="absmiddle" id="loading_' . $listing['products_id'] . '" style="visibility: hidden;"') . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

// AJAX Addto shopping_cart - End

 

I think you made a great contribution! Thank you!

 

Dennis

Share this post


Link to post
Share on other sites

hi,

 

great contribution, but for me its not working because no products where added to the shopping_cart... but i got the image showing with green confiramtion...

is there a problem with Ultimate Seo Urls?

 

regards pebosi

Share this post


Link to post
Share on other sites

2 Dennisra:

Unfortunately this version does not work with sending POST-data. It will be in following release.

 

2 pebosi

Can you show yours html_output.php? (my e-mail you know)

 

Thanks all for good words!

Share this post


Link to post
Share on other sites

Hi Medreces,

Great contribution you've made! Just what I was looking for. But... :blush:

I have "Quantity Box in Product Listing by Acheron" contribution installed:

http://www.oscommerce.com/community/contributions,2147/

Is it posible to make them compatible or to have same functionality implemented in your contrib?

I think the problem is somewhat similar as Dennisra has.

Thanks a lot. Your input is greatly appreciated.

Regards,

LAMPB.


He who does not add, detracts;

Share this post


Link to post
Share on other sites

Hi, Lampb!

 

Yes, you are right.You have the same problems as Dennisra. I plan to have the new release till this weekend.

 

Thank you for you worm words .

Kind regards, :rolleyes:

Share this post


Link to post
Share on other sites

added to a heavily modified store.

 

a sample of the listing is:

 

<td align="center" class="productListing-data"> <a href="http://shop.com/product_info.php?cPath=53&products_id=146"><img src="imagemagic.php?img=images/dura-glass2_med.gif&w=100&h=65&page=" width="100" height="65" border="0" alt="Dura-Glas II 1.5 HP 115/230v" title="Dura-Glas II 1.5 HP 115/230v"></a> <br> <a href="http://shop.com/product_info.php?cPath=53&products_id=146">Dura-Glas II 1.5 HP 115/230v</a> <br> $349.00 <br><a href="http://shop.com/index.php?cPath=53&sort=2a&action=buy_now&products_id=146" onclick="doBuyNowGet('cPath=53&sort=2a&action=buy_now&products_id=146', 146); return false;"><img src="images/loading.gif" align="absmiddle" id="loading_" style="visibility: hidden;" border="0" alt=""><img src="includes/languages/english/images/buttons/button_buy_now.gif" border="0" alt="Buy Now" title="Buy Now"></a> </td>

 

the shopping cart looks like:

 

	   <td style="padding: 0">
   <script language="JavaScript" src="includes/ajax_sc.js"></script>

	 <div id="divShoppingCard"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<!-- shopping_cart //-->

	  <tr>
		<td>
		  <table border="0" width="100%" cellspacing="0" cellpadding="0">
			<tr>
			  <td class="infoBoxHeading"><img src="templates/bts/images/infobox/corner_left.gif" border="0" alt="" width="15" height="27"></td>
			  <td width="100%" class="infoBoxHeading" background="templates/bts/images/infobox/background.gif">Shopping Cart</td>

			  <td class="infoBoxHeading" nowrap><a href="http://shop.com/shopping_cart.php"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title="more" width="15" height="27"></a></td>
			</tr>
		  </table>
		  <table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBox">
		  <tr>
			<td>
			  <table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents">
				  <tr>
					<td background="templates/bts/images/infobox/box_bg_l.gif" style=" background-repeat:repeat-y"><img src="templates/bts/images/spacer.gif" border="0" alt="" width="8" height="4"></td>

					<td class="boxText" width="100%"><img src="templates/bts/images/spacer.gif" border="0" alt="" width="120" height="7"></td>
				 	<td background="templates/bts/images/infobox/box_bg_r.gif" style="background-repeat:repeat-y"><img src="templates/bts/images/spacer.gif" border="0" alt="" width="12" height="4"></td>
				  </tr>
			  </table>
			  <table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents">
				  <tr>
					<td background="templates/bts/images/infobox/box_bg_l.gif" style=" background-repeat:repeat-y"><img src="templates/bts/images/spacer.gif" border="0" alt="" width="8" height="4"></td>
					<td class="boxText" width="100%">0 items</td>

				 	<td background="templates/bts/images/infobox/box_bg_r.gif" style="background-repeat:repeat-y"><img src="templates/bts/images/spacer.gif" border="0" alt="" width="12" height="4"></td>
				  </tr>
			  </table>
			  <table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents">
				<tr>
					<td background="templates/bts/images/infobox/corner_left_flip.gif" style="background-repeat:no-repeat"><img src="templates/bts/images/spacer.gif" border="0" alt="" width="40" height="10"></td>
					<td width="100%" background="templates/bts/images/infobox/backgroundfb.gif" style=" background-repeat:repeat-x"><img src="templates/bts/images/spacer.gif" border="0" alt="" height="10"></td>
				 	<td background="templates/bts/images/infobox/corner_right_flip.gif" style="background-repeat:no-repeat"><img src="templates/bts/images/spacer.gif" border="0" alt="" width="40" height="10"></td>
				</tr>

			  </table> 	
			</td>
		  </tr>
		</table>
		</td>
	  </tr>
<!-- shopping_cart_eof //-->

	 </table></div>
   </td>

 </tr>

 

what's happening...

 

listing shows up, I click on buynow button, continues to place the stuff in the cart, but then refreshes the page to the shopping cart.

 

As you can see, we are flowing all this through the BTS system, I placed the catalog/ajax_shopping_cart.php in the root location (we don't use catalog so it's at / ) so if the call is to /ajax_shopping_cart.php it should have worked. any idea why the buynow is going to the shopping_cart instead of the ajax_shopping_cart?


The king of kluge...

? Do you really know what is and isn't working in your store? ≡ ?

Share this post


Link to post
Share on other sites

Hi there,

 

I love the look and functionality of the contribution, however i have installed it and it is still the same as before. I do have a heavily modded site, as you will see here... My Webpage

 

Any ideas how to get it working?

 

cheers

 

stubbsy

Share this post


Link to post
Share on other sites

so I go to the reference site http://www.netso.ru/index.php?cPath=107 and click on the "buy now" and it has a really cool transition effect. So I go to look at the source code and do a search for ajax_sc.js and firefox returns nothing.

 

I'm at a loss...

 

Yes, this is a cool mod, but when the reference site doesn't even show a call to the javascript file that the directions tell us to include, it's frustrating.


The king of kluge...

? Do you really know what is and isn't working in your store? ≡ ?

Share this post


Link to post
Share on other sites

This is it:

<script language="JavaScript" src="includes/woutreload.js"></script>

Just a different name for ajax_sc.js

Share this post


Link to post
Share on other sites

Fine, then I'm at a loss as to why this isn't working... any suggestions?


The king of kluge...

? Do you really know what is and isn't working in your store? ≡ ?

Share this post


Link to post
Share on other sites
No, sorry I don't. I do not have it working yet either.

 

maybe is we provide a few more nice worm words we can get this arther kewl mod working and then we will all be very happy...


The king of kluge...

? Do you really know what is and isn't working in your store? ≡ ?

Share this post


Link to post
Share on other sites

Hi everybody!

I am sorry that I can't answer you immediately or soon after your question: I am not very often here.

 

This conttibution works good on the clean OS COMMERCE. Now I am working with the new release which I'll try to make friends with SEO-url 's contributions. Overwhile the sending of forms will be added .The visual of confirmation will be changed ( It will become more simple).

 

Thank you for your understanding,

 

Medreces.

Share this post


Link to post
Share on other sites
Hi everybody!

I am sorry that I can't answer you immediately or soon after your question: I am not very often here.

 

This conttibution works good on the clean OS COMMERCE. Now I am working with the new release which I'll try to make friends with SEO-url 's contributions. Overwhile the sending of forms will be added .The visual of confirmation will be changed ( It will become more simple).

 

Thank you for your understanding,

 

Medreces.

 

It's nice to know that it works well with a clean osc, but the reality is that MOST of us don't have a "clean install" and we are plugging this into a working site (with STS or BTS) and that the changes we made, in accordence to the directions supplied in the contribution, didn't work.

 

As my code sample shows, the javascript file is included and the div is included where you said they should be, and the code on the link looks like the code on the link in your pages. Based on this it shouldn't matter what other applications/mods I have integrated. It should work. It doesn't. So the question are, were there instructions in the readme that were missing? have we installed the contribution incorrectly? is there a step that we didn't follow or was left out?

 

Yes, this is s VERY slick mod. But if it doesn't install, then it's not all that slick.I should be able to have all my instance of PRODUCT_LISTING_COL (rather than PRODUCT_LISTING since I use the other format of listing) deliver the buy_now with the correct code in the link and the proper application of the mod. I installed in accordence of the instructions and it didn't work. This has to be addressed before SEO URLs as it means that there is something wrong in either the instructions or the basic application.

 

Sorry if I sound a bit frustrated, but as I don't know javascript well (I may have written a book on web programming, but javasript isn't my strong suit) I am not really competant at debugging this, so I am looking for support from the author.


The king of kluge...

? Do you really know what is and isn't working in your store? ≡ ?

Share this post


Link to post
Share on other sites

The author is working on a revised version now from what I hear. I think we just need to be patient.

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  

×