Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 ASP (Windows server) versions
 AddToCart Ajax posting
Author « Topic »  

gwilson
Starting Member

44 Posts

Pre-sales questions only
(More Details...)

Posted - 08/08/2019 :  09:48:43  
I have a customized JQuery/Javascript that displays for select products that allows the customer to use a product size control.
As they select a larger dimension product, the price is computed and displayed. $("#pricediv0").text(newPrice.toFixed(2); Works really slick.

However, I need to pass the new price from prodDetail.asp to the ajax callback that processes the ajaxaddcartcb() in ectcart.js
I found two locations where the price is retrieved: try { pprice = decodeURIComponent(retvals[baseind + 3]) } catch (err) { pprice = 'ERROR' }
and try{pprice=decodeURIComponent(retvals[5])}catch(err){pprice='ERROR'}

But I can't locate the Ajax calling routine that sets these values. I presume it would be visible in the proddetails.asp & incproddetails.asp code.
If I can change to pprice values passed to Ajax via ectcart.js function ajaxaddcart(frmid){ where ajaxaddcartcb;} is referenced,
this should allow a workable path to add the product with new price to the cart.

Vince
Administrator

42465 Posts

Posted - 08/08/2019 :  10:12:07  
Hi there
If you look in inccart.asp for the line...
if getpost("ajaxadd")="true" then
I think that is what you are looking for.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

gwilson
Starting Member

44 Posts

Pre-sales questions only
(More Details...)

Posted - 08/08/2019 :  13:29:12  
Vince - this is getting me closer. I am able to get a session('newPrice') that is set from a aspx page, but I can't set it using that method from the Add To Cart button as it calls AJAX. I need to somehow get the client-side value from the price div to a session value..
inccart.asp / sub addproduct(theid) does a product lookup to get the price from the "products" and that is where I need to override the value.
addedprods(3,numaddedprods)=thepprice

At this point it's a language problem going between asp, aspx, html and javascript/jquery. server-side vs client-side.

gwilson
Starting Member

44 Posts

Pre-sales questions only
(More Details...)

Posted - 08/08/2019 :  17:52:48  
There is no way that I'm aware of to pass values from JS client side and asp server side, in the addtocart functions.

Since the cart code does a select pprice for that product, I need to afterward, replace the value that is retrieved from the db with the newPrice calculated on the client.
If I can 'trigger' as ASP submit() I might be able to set the session value, then somehow allow the add to cart popup to be called from axaj.

Any ideas?

Vince
Administrator

42465 Posts

Posted - 08/09/2019 :  01:13:05  
The cart already allows for "multiplier" options which will multiply the value given by the value of the item. Would this be the way to go, to set the product up with a multiplier option then add your JavaScript selector to that? Then whatever result you get from your script you set as the products multiplier option value.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000