Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Changing Price through HTML Links

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-18-2017, 04:45 PM
 
Local Hero Local Hero is offline
 

Senior Member
  
Join Date: May 2004
Location: UT
Posts: 121
 

Default Changing Price through HTML Links

I have a custom product store and I've made a designer page (outside of X-Cart) that will calculate the price based on many variables. In X-Cart 4, I could send code to the cart like this:

See Below - Edit won't work
__________________
X-Cart version 4.4.5
X-Cart version 5.3.2.8
Reply With Quote
  #2  
Old 04-18-2017, 04:51 PM
 
Local Hero Local Hero is offline
 

Senior Member
  
Join Date: May 2004
Location: UT
Posts: 121
 

Default Re: Changing Price through HTML Links

I have a custom product store and I've made a designer page (outside of X-Cart) that will calculate the price based on many variables. In X-Cart 4, I could send code to the cart like this:
Code:
GET /store/cart.php?mode=add&productid=17648&price=24&product_options[458]=HTRH&product_options[459]=HTR&product_options[460]=Acme%20Regular&product_options[461]=&product_options[462]=Acme%20Regular&product_options[463]=Black&product_options[464]=&product_options[465]=No&product_options[466]=LocalHero&product_options[467]=No%20Logo%20File%20Uploaded&product_options[468]=Adult/Youth&product_options[469]=White%20Jersey&product_options[470]=No&product_options[471]=&product_options[472]=http://www.localheromx.com/jersey/image/savedImage/htr-24-882.png&amount=1
This would fit nicely in X-Cart 4. But when I try something similar in X-Cart 5, the "price=24" does not work. It defaults to the price in the cart, even if the price is set to $0.00.

How do I change the price in X-Cart 5?
__________________
X-Cart version 4.4.5
X-Cart version 5.3.2.8
Reply With Quote
  #3  
Old 04-19-2017, 10:18 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Changing Price through HTML Links

What if a customer opens such a link but with "price=0.01". Will it allow him to buy the product for a cent?
It looks very unsecure to me.

I think you should look into using REST API to inject one-time validation codes into a custom XC5 table, then pass a hash from this code along with your "custom price" request and validate if the hash compares to the validation code stored in the database. But this requires a custom module, of course.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #4  
Old 04-20-2017, 02:04 AM
 
Local Hero Local Hero is offline
 

Senior Member
  
Join Date: May 2004
Location: UT
Posts: 121
 

Default Re: Changing Price through HTML Links

I understand your concern, but I had a custom application built to handle my custom product. There isn't a place where the customer can see any code to change. It all happens through the application and would be secure (I've used it in X-Cart 4 for years).

I just need to know what variable to put in to change the PRICE in X-Cart 5?
__________________
X-Cart version 4.4.5
X-Cart version 5.3.2.8
Reply With Quote
  #5  
Old 04-20-2017, 02:58 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Changing Price through HTML Links

You can't do this in the "stock X-Cart 5" due to security reasons.
You have to create a custom module that will allow you to do this on your site (and I still don't recommend going this way and suggest you to consider more secure methods).
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:02 PM.

   

 
X-Cart forums © 2001-2020