Dynamically setting the price used by cart

General ShopSite user discussion

Dynamically setting the price used by cart

Postby Rgkopchak » Thu Jul 25, 2019 7:23 am

Hello, sorry for the repost here, but I've got a major project I am working on and I was hoping to get a definitive answer. This would be a big change to the SS database, and I really don't want to make a mistake!

I use a custom PHP/mySQL site, that uses ShopSite only for the cart functionality. I am trying to set it up where I can pass the value of the item that is being added to the cart dynamically, rather than using the price set in the SS database.

Is the following the best (or only) way to achieve this?

    1) Turn Variable pricing on for all products.
    2) Set the price of ALL products to zero.
    3) Pass the price for ALL products via my custom HTML <input type="hidden" name="$MYSKU:price" value="$MYPRICE">

Are there any unintended consequences that I am not aware of?

Thank you very much for your time, I appreciate it.
Rgkopchak
 
Posts: 40
Joined: Wed Jul 28, 2010 7:45 am
Location: Missouri

Re: Dynamically setting the price used by cart

Postby cyoung » Fri Jul 26, 2019 2:46 pm

The only 'unintended consequence's to variable pricing is that a sneaky person that is technically inclined COULD look at the source of the add to cart buttons, see the hidden price input field, then create their own version of the button with a lower price input. This is the reason for having the regular Price of the product be the lowest a variable-priced product can be purchased for, it's a safety net to keep the merchant from being cheated.

However, if you want to review all the orders to make sure no one changed the form and submitted products with a too-low price, it can be done.
cyoung
 
Posts: 78
Joined: Wed Nov 09, 2016 11:01 am

Re: Dynamically setting the price used by cart

Postby Rgkopchak » Sat Jul 27, 2019 7:45 am

Thanks for the response, makes sense. I'll have to give this some thought. I don't *think* there is a way to prevent this sort of manipulation is there? There isn't a way to validate the html form is being submitted from www.mydomain.com is there?
Rgkopchak
 
Posts: 40
Joined: Wed Jul 28, 2010 7:45 am
Location: Missouri


Return to User Forum

Who is online

Users browsing this forum: Google [Bot] and 5 guests